ui changes and cs prices
All checks were successful
Test and deploy staging / staging (push) Successful in 11m52s
All checks were successful
Test and deploy staging / staging (push) Successful in 11m52s
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
<script lang="ts">
|
||||
import { resolve } from '$app/paths';
|
||||
import { authClient } from '$lib/auth-client';
|
||||
import { Button } from '$lib/components/ui/button/index.js';
|
||||
import * as Card from '$lib/components/ui/card/index.js';
|
||||
import { Badge } from '$lib/components/ui/badge/index.js';
|
||||
import type { PageProps } from './$types';
|
||||
let { data }: PageProps = $props();
|
||||
let busy = $state(false);
|
||||
@@ -32,41 +35,47 @@
|
||||
</div>
|
||||
<p class="text-sm text-gray-500">Account ID: <code>{data.user?.id}</code></p>
|
||||
|
||||
<div class="rounded border p-4 space-y-3">
|
||||
<h2 class="font-bold">Sign-in methods</h2>
|
||||
<p class="text-sm text-gray-600">
|
||||
Link a provider here to use it with this account and keep your saved progress together.
|
||||
</p>
|
||||
{#if message || data.oauthError}<p role="alert" class="text-red-700">
|
||||
{message ||
|
||||
'Linking failed or was cancelled. The provider may already belong to another account.'}
|
||||
</p>{/if}
|
||||
{#if data.linkedProviders.includes('credential')}<p>Email and password connected</p>{/if}
|
||||
{#each ['google', 'osu'] as provider (provider)}
|
||||
{@const label = provider === 'google' ? 'Google' : 'osu!'}
|
||||
{#if data.linkedProviders.includes(provider)}<p>{label} connected</p>
|
||||
{:else if data.providers[provider as 'google' | 'osu']}<button
|
||||
class="block rounded border px-4 py-2 disabled:opacity-50"
|
||||
disabled={busy}
|
||||
onclick={() => link(provider as 'google' | 'osu')}>Connect {label}</button
|
||||
<Card.Root
|
||||
><Card.Header><Card.Title>Sign-in methods</Card.Title></Card.Header><Card.Content
|
||||
class="space-y-3"
|
||||
>
|
||||
<p class="text-sm text-gray-600">
|
||||
Link a provider here to use it with this account and keep your saved progress together.
|
||||
</p>
|
||||
{#if message || data.oauthError}<p role="alert" class="text-red-700">
|
||||
{message ||
|
||||
'Linking failed or was cancelled. The provider may already belong to another account.'}
|
||||
</p>{/if}
|
||||
{#if data.linkedProviders.includes('credential')}<Badge variant="secondary"
|
||||
>Email and password connected</Badge
|
||||
>{/if}
|
||||
{/each}
|
||||
</div>
|
||||
{#each ['google', 'osu'] as provider (provider)}
|
||||
{@const label = provider === 'google' ? 'Google' : 'osu!'}
|
||||
{#if data.linkedProviders.includes(provider)}<Badge variant="secondary"
|
||||
>{label} connected</Badge
|
||||
>
|
||||
{:else if data.providers[provider as 'google' | 'osu']}<Button
|
||||
variant="outline"
|
||||
disabled={busy}
|
||||
onclick={() => link(provider as 'google' | 'osu')}>Connect {label}</Button
|
||||
>{/if}
|
||||
{/each}
|
||||
</Card.Content></Card.Root
|
||||
>
|
||||
{#if data.isAdmin}
|
||||
<div class="rounded border p-4 space-y-3">
|
||||
<h2 class="font-bold">Administration</h2>
|
||||
<div class="flex flex-wrap gap-4">
|
||||
<a class="underline" href={resolve('/blog')}>Blog articles</a><a
|
||||
class="underline"
|
||||
href={resolve('/lists')}>Lists</a
|
||||
><a class="underline" href={resolve('/projects/animaldex/admin')}>Animaldex moderation</a><a
|
||||
class="underline"
|
||||
href={resolve('/projects/progress')}>Progress</a
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<Card.Root
|
||||
><Card.Header><Card.Title>Administration</Card.Title></Card.Header><Card.Content>
|
||||
<div class="flex flex-wrap gap-4">
|
||||
<a class="underline" href={resolve('/blog')}>Blog articles</a><a
|
||||
class="underline"
|
||||
href={resolve('/lists')}>Lists</a
|
||||
><a class="underline" href={resolve('/projects/animaldex/admin')}>Animaldex moderation</a
|
||||
><a class="underline" href={resolve('/projects/progress')}>Progress</a>
|
||||
</div>
|
||||
</Card.Content></Card.Root
|
||||
>
|
||||
{/if}
|
||||
<form method="POST" action="/logout">
|
||||
<button class="rounded border px-4 py-2">Log out</button>
|
||||
<Button type="submit" variant="outline">Log out</Button>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user