Data: Disable "Create" buttons for non-admins
This commit is contained in:
@ -5,9 +5,12 @@
|
||||
import { get_by_value } from "$lib/database";
|
||||
import { PXX_COLORS } from "$lib/config";
|
||||
import type { RaceResult } from "$lib/schema";
|
||||
import { pbUser } from "$lib/pocketbase";
|
||||
|
||||
let { data }: { data: PageData } = $props();
|
||||
|
||||
let disabled: boolean = $derived(!$pbUser?.admin);
|
||||
|
||||
const modalStore: ModalStore = getModalStore();
|
||||
|
||||
const result_handler = async (event: Event, id?: string) => {
|
||||
@ -92,7 +95,7 @@
|
||||
</svelte:head>
|
||||
|
||||
<div class="pb-2">
|
||||
<Button width="w-full" color="tertiary" onclick={result_handler} shadow>
|
||||
<Button width="w-full" color="tertiary" onclick={result_handler} shadow {disabled}>
|
||||
<span class="font-bold">Create Race Result</span>
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user