fix: remove AdminDialog and admin option from header profile dropdown
Shared web-ui package already dropped this in a prior sync; this app's layout was still wiring up the removed onAdmin prop and AdminDialog. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
bbf5d8bb05
commit
80cf207d37
1 file changed
+1
-13
@@ -1,6 +1,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import { page } from '$app/state';
|
import { page } from '$app/state';
|
||||||
import { AdminDialog, AppShell as SharedAppShell, ProfileDialog } from '@gabriel20xx/web-ui';
|
import { AppShell as SharedAppShell, ProfileDialog } from '@gabriel20xx/web-ui';
|
||||||
import { Tooltip } from 'bits-ui';
|
import { Tooltip } from 'bits-ui';
|
||||||
import AuthPage from '$lib/features/auth/AuthPage.svelte';
|
import AuthPage from '$lib/features/auth/AuthPage.svelte';
|
||||||
import { createAuthStore } from '$lib/features/auth/auth.svelte.js';
|
import { createAuthStore } from '$lib/features/auth/auth.svelte.js';
|
||||||
@@ -18,8 +18,6 @@
|
|||||||
];
|
];
|
||||||
let settingsOpen = $state(false);
|
let settingsOpen = $state(false);
|
||||||
let credentialsOpen = $state(false);
|
let credentialsOpen = $state(false);
|
||||||
let adminOpen = $state(false);
|
|
||||||
const isAdmin = $derived(auth.status?.role === 'admin' || auth.status?.role === 'superadmin');
|
|
||||||
|
|
||||||
async function saveProfile(input) {
|
async function saveProfile(input) {
|
||||||
await auth.updateCredentials({
|
await auth.updateCredentials({
|
||||||
@@ -50,7 +48,6 @@
|
|||||||
username={auth.status.username ?? ''}
|
username={auth.status.username ?? ''}
|
||||||
onLogout={() => auth.logout()}
|
onLogout={() => auth.logout()}
|
||||||
onProfile={() => (credentialsOpen = true)}
|
onProfile={() => (credentialsOpen = true)}
|
||||||
onAdmin={isAdmin ? () => (adminOpen = true) : undefined}
|
|
||||||
onSettings={() => (settingsOpen = true)}
|
onSettings={() => (settingsOpen = true)}
|
||||||
>
|
>
|
||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
@@ -59,15 +56,6 @@
|
|||||||
</Tooltip.Provider>
|
</Tooltip.Provider>
|
||||||
|
|
||||||
<SettingsDialog bind:open={settingsOpen} />
|
<SettingsDialog bind:open={settingsOpen} />
|
||||||
<AdminDialog
|
|
||||||
bind:open={adminOpen}
|
|
||||||
currentRole={auth.status?.role ?? 'user'}
|
|
||||||
currentUserId={auth.status?.id}
|
|
||||||
onCreateUser={(input) => auth.createUser(input)}
|
|
||||||
onDeleteUser={(id) => auth.deleteUser(id)}
|
|
||||||
onListUsers={() => auth.listUsers()}
|
|
||||||
onUpdateUser={(id, input) => auth.updateUser(id, input)}
|
|
||||||
/>
|
|
||||||
<ProfileDialog
|
<ProfileDialog
|
||||||
bind:open={credentialsOpen}
|
bind:open={credentialsOpen}
|
||||||
currentUsername={auth.status?.username ?? ''}
|
currentUsername={auth.status?.username ?? ''}
|
||||||
|
|||||||
Reference in new issue
Block a user