Skip to content

Commit ba5b827

Browse files
authored
Merge branch 'main' into feat/add-speedtest-button
2 parents e775e70 + 49fdce4 commit ba5b827

File tree

3 files changed

+96
-0
lines changed

3 files changed

+96
-0
lines changed

resources/views/layouts/app.blade.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,11 @@ class="p-2 rounded-md transition-all"
115115
@endauth
116116
</div>
117117
</header>
118+
@include('layouts.partials.header')
118119
119120
{{ $slot }}
121+
122+
@include('layouts.partials.footer')
120123
</main>
121124
122125
{{-- Scripts --}}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<footer>
2+
<div class="flex items-center justify-end">
3+
<div class="flex justify-center gap-x-2">
4+
@if (\App\Services\GitHub\Repository::updateAvailable())
5+
<x-filament::badge>
6+
{{ __('general.update_available') }}
7+
</x-filament::badge>
8+
@endif
9+
10+
<a href="https://github.com/alexjustesen/speedtest-tracker/releases" class="underline text-sm text-gray-700 hover:text-gray-300" target="_blank" rel="noopener noreferrer">
11+
{{ config('speedtest.build_version') }}
12+
</a>
13+
</div>
14+
</div>
15+
</footer>
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<header class="flex flex-col gap-4 sm:flex-row sm:justify-between sm:items-center">
2+
<div>
3+
<h1 class="text-2xl font-bold tracking-tight text-gray-950 dark:text-white sm:text-3xl">{{ $title ?? 'Page Title' }} - {{ config('app.name') }}</h1>
4+
</div>
5+
6+
<div class="flex items-center shrink-0 gap-4">
7+
<div
8+
x-data="{ theme: null }"
9+
x-init="
10+
theme = localStorage.getItem('theme') || 'system'
11+
$watch('theme', () => {
12+
localStorage.setItem('theme', theme)
13+
const effectiveTheme = theme === 'system'
14+
? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')
15+
: theme
16+
if (effectiveTheme === 'dark') {
17+
document.documentElement.classList.add('dark')
18+
} else {
19+
document.documentElement.classList.remove('dark')
20+
}
21+
$dispatch('theme-changed', theme)
22+
})
23+
"
24+
class="flex items-center gap-1 p-1 rounded-lg bg-gray-100 dark:bg-gray-800"
25+
>
26+
<button
27+
type="button"
28+
x-on:click="theme = 'light'"
29+
x-bind:class="{ 'bg-white dark:bg-gray-900 shadow-sm': theme === 'light' }"
30+
class="p-2 rounded-md transition-all"
31+
aria-label="Light mode"
32+
>
33+
<x-tabler-sun class="size-4" />
34+
</button>
35+
36+
<button
37+
type="button"
38+
x-on:click="theme = 'dark'"
39+
x-bind:class="{ 'bg-white dark:bg-gray-900 shadow-sm': theme === 'dark' }"
40+
class="p-2 rounded-md transition-all"
41+
aria-label="Dark mode"
42+
>
43+
<x-tabler-moon class="size-4" />
44+
</button>
45+
46+
<button
47+
type="button"
48+
x-on:click="theme = 'system'"
49+
x-bind:class="{ 'bg-white dark:bg-gray-900 shadow-sm': theme === 'system' }"
50+
class="p-2 rounded-md transition-all"
51+
aria-label="System theme"
52+
>
53+
<x-tabler-device-desktop class="size-4" />
54+
</button>
55+
</div>
56+
57+
@auth
58+
<x-filament::button
59+
href="{{ url('/admin') }}"
60+
icon="tabler-layout-dashboard"
61+
iconButton="true"
62+
tag="a"
63+
size="lg"
64+
>
65+
{{ __('general.admin') }}
66+
</x-filament::button>
67+
@else
68+
<x-filament::button
69+
href="{{ url('/login') }}"
70+
icon="tabler-login"
71+
tag="a"
72+
size="lg"
73+
>
74+
{{ __('auth.sign_in') }}
75+
</x-filament::button>
76+
@endauth
77+
</div>
78+
</header>

0 commit comments

Comments
 (0)