Skip to content

Commit

Permalink
fix: don't show disclaimer banner on internal sites
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiio committed Oct 2, 2024
1 parent 5607e57 commit b6a3d4a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 21 deletions.
5 changes: 5 additions & 0 deletions app/View/Components/Site/Banner.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,21 @@

namespace App\View\Components\Site;

use App\Services\Features;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;

class Banner extends Component
{
public ?string $text;

public bool $isExternalSite;

public function __construct(?string $text = null)
{
$this->text = $text;

$this->isExternalSite = ! Features::isCode4RomaniaSite();
}

public function render(): View
Expand Down
43 changes: 22 additions & 21 deletions resources/views/components/site/banner.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,30 @@ class="flex items-center max-w-2xl text-sm hover:text-blue-600 focus:text-blue-6
class="hover:text-blue-600 focus:text-blue-600 focus:outline-0 hover:underline focus:underline"
href="https://www.commitglobal.org"
target="_blank"
rel="noopener"
>
rel="noopener">
{{ $text }}
</a>
<div class="flex gap-1 leading-relaxed">
<a
class="font-semibold hover:underline focus:underline"
href="https://www.commitglobal.org/en/disclaimer-website-factory"
target="_blank"
rel="noopener"
>
@lang('banner.disclaimer')
</a>
<span class="text-gray-500" aria-hidden="true">|</span>
<a
class="font-semibold hover:underline focus:underline"
href="https://www.commitglobal.org/en/forms/report-website-factory"
target="_blank"
rel="noopener"
>
@lang('banner.report_issue')
</a>
</div>

@if ($isExternalSite)
<div class="flex gap-1 leading-relaxed">
<a
class="font-semibold hover:underline focus:underline"
href="https://www.commitglobal.org/en/disclaimer-website-factory"
target="_blank"
rel="noopener">
@lang('banner.disclaimer')
</a>
<span class="text-gray-500" aria-hidden="true">|</span>
<a
class="font-semibold hover:underline focus:underline"
href="https://www.commitglobal.org/en/forms/report-website-factory"
target="_blank"
rel="noopener">
@lang('banner.report_issue')
</a>
</div>
@endif

</div>
</div>
</aside>

0 comments on commit b6a3d4a

Please sign in to comment.