-
-
Notifications
You must be signed in to change notification settings - Fork 109
Expand file tree
/
Copy pathdashboard.blade.php
More file actions
206 lines (177 loc) · 8.25 KB
/
dashboard.blade.php
File metadata and controls
206 lines (177 loc) · 8.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
<!DOCTYPE html>
<html
lang="{{ str_replace('_', '-', app()->getLocale()) }}"
x-data="{
// Persisted theme preference: 'light' | 'dark' | 'system'
themePreference: $persist('system').as('themeMode'),
// Effective dark-mode flag derived from preference + OS
isDark: false,
prefersDarkQuery: window.matchMedia('(prefers-color-scheme: dark)'),
applyTheme() {
this.isDark =
this.themePreference === 'dark' ||
(this.themePreference === 'system' && this.prefersDarkQuery.matches)
},
init() {
const valid = ['light', 'dark', 'system']
// Initial compute
this.applyTheme()
// React to OS preference changes while in 'system' mode
this.prefersDarkQuery.addEventListener('change', () => {
if (this.themePreference === 'system') {
this.applyTheme()
}
})
// React to user-selected preference changes
this.$watch('themePreference', () => this.applyTheme())
},
}"
x-bind:class="{ 'dark': isDark === true }"
>
<head>
<meta
http-equiv="Content-Security-Policy"
content="upgrade-insecure-requests"
/>
<meta charset="utf-8" />
<meta
http-equiv="X-UA-Compatible"
content="IE=edge"
/>
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
/>
<meta
name="csrf-token"
content="{{ csrf_token() }}"
/>
<title>{{ isset($title) ? $title . ' - ' : '' }}NativePHP</title>
{{-- Favicon --}}
<link
rel="icon"
href="{{ asset('favicon.svg') }}"
type="image/svg+xml"
/>
<!-- Fathom - beautiful, simple website analytics -->
@production
<script
src="https://cdn.usefathom.com/script.js"
data-site="HALHTNZU"
defer
></script>
@endproduction
{{-- Styles --}}
<style>
[x-cloak] {
display: none !important;
}
</style>
@livewireStyles
@vite('resources/css/app.css')
@stack('head')
</head>
<body
x-cloak
class="min-h-screen bg-white font-poppins antialiased dark:bg-zinc-900 dark:text-white"
>
<flux:sidebar sticky collapsible="mobile" class="border-r border-zinc-200 bg-zinc-50 dark:border-zinc-700 dark:bg-zinc-900">
<flux:sidebar.header>
<flux:sidebar.brand
href="{{ route('welcome') }}"
logo="{{ asset('favicon.svg') }}"
name="NativePHP"
/>
<flux:sidebar.collapse class="lg:hidden" />
</flux:sidebar.header>
<flux:sidebar.nav>
<flux:sidebar.item icon="home" href="{{ route('dashboard') }}" :current="request()->routeIs('dashboard')">
Dashboard
</flux:sidebar.item>
<flux:sidebar.item icon="key" href="{{ route('customer.licenses.list') }}" :current="request()->routeIs('customer.licenses.*')">
Licenses
</flux:sidebar.item>
@feature(App\Features\ShowPlugins::class)
<flux:sidebar.item icon="shopping-bag" href="{{ route('customer.purchased-plugins.index') }}" :current="request()->routeIs('customer.purchased-plugins.*')">
Purchased Plugins
</flux:sidebar.item>
@endfeature
<flux:sidebar.item icon="clock" href="{{ route('customer.purchase-history.index') }}" :current="request()->routeIs('customer.purchase-history.*')">
Purchase History
</flux:sidebar.item>
<flux:sidebar.group expandable heading="Community" class="grid">
<flux:sidebar.item href="{{ route('customer.showcase.index') }}" :current="request()->routeIs('customer.showcase.*')">
Showcase
</flux:sidebar.item>
<flux:sidebar.item href="https://discord.gg/nativephp" target="_blank">
Discord
</flux:sidebar.item>
</flux:sidebar.group>
@feature(App\Features\ShowPlugins::class)
<flux:sidebar.group expandable heading="Developer" class="grid">
<flux:sidebar.item href="{{ route('customer.developer.onboarding') }}" :current="request()->routeIs('customer.developer.onboarding', 'customer.developer.dashboard')">
Hub
</flux:sidebar.item>
<flux:sidebar.item href="{{ route('customer.plugins.index') }}" :current="request()->routeIs('customer.plugins.*')">
My Plugins
</flux:sidebar.item>
<flux:sidebar.item href="{{ route('customer.developer.settings') }}" :current="request()->routeIs('customer.developer.settings')">
Settings
</flux:sidebar.item>
</flux:sidebar.group>
@endfeature
</flux:sidebar.nav>
<flux:sidebar.spacer />
@php $unreadCount = auth()->user()->unreadNotifications()->count(); @endphp
<flux:sidebar.nav>
<flux:sidebar.item icon="bell" href="{{ route('customer.notifications') }}" :current="request()->routeIs('customer.notifications')" :badge="$unreadCount > 0 ? $unreadCount : null">
Notifications
</flux:sidebar.item>
<flux:sidebar.item icon="link" href="{{ route('customer.integrations') }}" :current="request()->routeIs('customer.integrations')">
Integrations
</flux:sidebar.item>
<flux:sidebar.item icon="credit-card" href="{{ route('customer.billing-portal') }}">
Manage Subscription
</flux:sidebar.item>
</flux:sidebar.nav>
<flux:dropdown position="top" align="start" class="max-lg:hidden">
<flux:sidebar.profile :name="auth()->user()->name ?? auth()->user()->email" />
<flux:menu>
<flux:menu.item icon="cog-6-tooth" href="{{ route('customer.settings') }}">Settings</flux:menu.item>
<flux:menu.item icon="arrow-right-start-on-rectangle" x-on:click.prevent="$refs.logoutForm.submit()">
Log out
</flux:menu.item>
</flux:menu>
</flux:dropdown>
<form x-ref="logoutForm" method="POST" action="{{ route('customer.logout') }}" class="hidden">
@csrf
</form>
</flux:sidebar>
{{-- Mobile header with sidebar toggle --}}
<flux:header class="lg:hidden">
<flux:sidebar.toggle class="lg:hidden" icon="bars-2" inset="left" />
<flux:spacer />
<a href="{{ route('customer.notifications') }}" class="relative p-2 text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200">
<x-heroicon-o-bell class="size-5" />
@if ($unreadCount > 0)
<span class="absolute right-1 top-1 size-2 rounded-full bg-blue-500"></span>
@endif
</a>
<flux:dropdown position="top" align="start">
<flux:profile :name="auth()->user()->name ?? auth()->user()->email" />
<flux:menu>
<flux:menu.item icon="cog-6-tooth" href="{{ route('customer.settings') }}">Settings</flux:menu.item>
<flux:menu.item icon="arrow-right-start-on-rectangle" x-on:click.prevent="document.querySelector('form[x-ref=logoutForm]').submit()">
Log out
</flux:menu.item>
</flux:menu>
</flux:dropdown>
</flux:header>
<flux:main container>
{{ $slot }}
</flux:main>
@livewireScriptConfig
@fluxScripts
@vite('resources/js/app.js')
</body>
</html>