username update, status message update, status overwriting, global
status in client
This commit is contained in:
parent
9ffb3cf283
commit
d9f5919b60
11 changed files with 235 additions and 79 deletions
|
|
@ -14,7 +14,8 @@
|
|||
import Button, { buttonVariants } from './ui/button/button.svelte';
|
||||
import User from './extra/User.svelte';
|
||||
import type { SessionValidationResult } from '$lib/server/auth';
|
||||
import type { OverviewData } from '$lib';
|
||||
import { Status, statuses, type OverviewData, type OverviewUser } from '$lib';
|
||||
import Label from './ui/label/label.svelte';
|
||||
|
||||
let {
|
||||
currentPage = $bindable<string | null>(),
|
||||
|
|
@ -259,6 +260,7 @@
|
|||
subPage = null;
|
||||
}}
|
||||
user={friend}
|
||||
crown={false}
|
||||
></User>
|
||||
</Sidebar.MenuSubButton>
|
||||
</Sidebar.MenuSubItem>
|
||||
|
|
@ -349,5 +351,66 @@
|
|||
</Sidebar.Menu>
|
||||
</Sidebar.Group>
|
||||
</Sidebar.Content>
|
||||
<Sidebar.Footer class="border-t-2 p-2">
|
||||
<Dialog.Root>
|
||||
<Dialog.Trigger>
|
||||
<User user={user as unknown as OverviewUser} crown={false} />
|
||||
</Dialog.Trigger>
|
||||
|
||||
<Dialog.Content>
|
||||
<form method="POST" action="?/updateProfile">
|
||||
<Dialog.Header>
|
||||
<Dialog.Title>Edit profile</Dialog.Title>
|
||||
<Dialog.Description>Update how others see you.</Dialog.Description>
|
||||
</Dialog.Header>
|
||||
|
||||
<div class="">
|
||||
<Label for="userName">Username</Label>
|
||||
<Input
|
||||
id="userName"
|
||||
name="userName"
|
||||
placeholder="Your name"
|
||||
value={user?.username}
|
||||
required
|
||||
minlength={2}
|
||||
maxlength={32}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- Presence -->
|
||||
<div class="space-y-1">
|
||||
<Label for="status">Status</Label>
|
||||
<select id="status" name="status" class="input" required>
|
||||
<option value={Status.ONLINE} selected={user?.statusOverwrite === Status.ONLINE}
|
||||
>Online</option
|
||||
>
|
||||
<option value={Status.DND} selected={user?.statusOverwrite === Status.DND}
|
||||
>Do Not Disturb</option
|
||||
>
|
||||
<option value={Status.OFFLINE} selected={user?.statusOverwrite === Status.OFFLINE}
|
||||
>Offline</option
|
||||
>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="space-y-1">
|
||||
<Label for="statusMessage">Status message</Label>
|
||||
<Input
|
||||
id="statusMessage"
|
||||
name="statusMessage"
|
||||
placeholder="What's going on?"
|
||||
value={user?.statusMessage ?? ''}
|
||||
maxlength={64}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<Dialog.Footer>
|
||||
<Dialog.Close class={buttonVariants({ variant: 'outline' })}>Cancel</Dialog.Close>
|
||||
<Button type="submit">Save</Button>
|
||||
</Dialog.Footer>
|
||||
</form>
|
||||
</Dialog.Content>
|
||||
</Dialog.Root>
|
||||
</Sidebar.Footer>
|
||||
<Sidebar.Rail />
|
||||
</Sidebar.Root>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue