Skip to content

Commit

Permalink
Theme and premium switcher
Browse files Browse the repository at this point in the history
  • Loading branch information
ilestis committed Jan 24, 2025
1 parent 51eaaf8 commit 2218c45
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions resources/views/layouts/header.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,41 @@

@auth()
@if(app()->isLocal())
@php $themeUrl = \Illuminate\Support\Str::before(request()->fullUrl(), '_theme=');
$themeUrl .= \Illuminate\Support\Str::contains($themeUrl, '?') ? '&' : '?';
@php
$themeUrl = \Illuminate\Support\Str::before(request()->fullUrl(), '_theme=');
$themeUrl .= \Illuminate\Support\Str::contains($themeUrl, '?') ? '&' : '?';
$premiumUrl = \Illuminate\Support\Str::before(request()->fullUrl(), '_boosted=');
$premiumUrl .= \Illuminate\Support\Str::contains($premiumUrl, '?') ? '&' : '?';
@endphp
<div class="dropdown">
<button type="button" class="rounded hover:text-accent text-2xl" data-dropdown aria-expanded="false">
<x-icon class="fa-regular fa-gem" />
</button>
<div class="dropdown-menu hidden" role="menu">
@if (request()->has('_boosted'))
<x-dropdowns.item
link="{!! $premiumUrl !!}">
Reset
</x-dropdowns.item>
@else
<x-dropdowns.item
link="{!! $premiumUrl . '_boosted=0' !!}">
Disable premium
</x-dropdowns.item>
@endif
</div>
</div>
<div class="dropdown">
<button type="button" class="rounded hover:text-accent text-2xl" data-dropdown aria-expanded="false">
<x-icon class="fa-solid fa-palette" />
</button>
<div class="dropdown-menu hidden" role="menu">
@if (request()->has('_theme'))
<x-dropdowns.item
link="{!! $themeUrl . '' !!}">
Reset
</x-dropdowns.item>
@endif
<x-dropdowns.item
link="{!! $themeUrl . '_theme=base' !!}">
Light
Expand Down

0 comments on commit 2218c45

Please sign in to comment.