diff options
Diffstat (limited to 'ui/routes')
| -rw-r--r-- | ui/routes/(app)/+layout.svelte | 4 | ||||
| -rw-r--r-- | ui/routes/(app)/ch/[channel]/+page.svelte | 4 | ||||
| -rw-r--r-- | ui/routes/(app)/me/+page.svelte | 84 | ||||
| -rw-r--r-- | ui/routes/+layout.svelte | 4 |
4 files changed, 18 insertions, 78 deletions
diff --git a/ui/routes/(app)/+layout.svelte b/ui/routes/(app)/+layout.svelte index 84090e7..84c71ec 100644 --- a/ui/routes/(app)/+layout.svelte +++ b/ui/routes/(app)/+layout.svelte @@ -91,7 +91,7 @@ </script> <svelte:head> - <title>understory</title> + <title>pilcrow</title> </svelte:head> {#if loading} @@ -106,7 +106,7 @@ <CreateChannelForm /> </div> </nav> - <main> + <main class="pl-4"> {@render children?.()} </main> </div> diff --git a/ui/routes/(app)/ch/[channel]/+page.svelte b/ui/routes/(app)/ch/[channel]/+page.svelte index 49c1c29..0961665 100644 --- a/ui/routes/(app)/ch/[channel]/+page.svelte +++ b/ui/routes/(app)/ch/[channel]/+page.svelte @@ -2,12 +2,14 @@ import { page } from '$app/stores'; import ActiveChannel from '$lib/components/ActiveChannel.svelte'; import MessageInput from '$lib/components/MessageInput.svelte'; + import { messages } from '$lib/store'; let channel = $derived($page.params.channel); + let messageRuns = $derived($messages.inChannel(channel)); </script> <div class="active-channel"> - <ActiveChannel {channel} /> + <ActiveChannel {messageRuns} /> </div> <div class="create-message max-h-full"> <MessageInput {channel} /> diff --git a/ui/routes/(app)/me/+page.svelte b/ui/routes/(app)/me/+page.svelte index 8d24a61..aded292 100644 --- a/ui/routes/(app)/me/+page.svelte +++ b/ui/routes/(app)/me/+page.svelte @@ -1,79 +1,17 @@ <script> - import { goto } from '$app/navigation'; - import { changePassword, logOut } from '$lib/apiServer.js'; - import { currentUser } from '$lib/store'; - + import LogOut from '$lib/components/LogOut.svelte'; import Invites from '$lib/components/Invites.svelte'; - - let currentPassword = $state(''), - newPassword = $state(''), - confirmPassword = $state(''), - passwordForm; - let pending = $state(false); - let valid = $derived(newPassword === confirmPassword && newPassword !== currentPassword); - let disabled = $derived(pending || !valid); - - async function onLogOut(event) { - event.preventDefault(); - const response = await logOut(); - if (200 <= response.status && response.status < 300) { - currentUser.update(() => null); - goto('/login'); - } - } - - async function onPasswordChange(event) { - event.preventDefault(); - pending = true; - let response = await changePassword(currentPassword, newPassword); - switch (response.status) { - case 200: - passwordForm.reset(); - break; - } - pending = false; - } + import ChangePassword from '$lib/components/ChangePassword.svelte'; </script> -<form onsubmit={onLogOut}> - <button class="btn variant-filled" type="submit">log out</button> -</form> - -<form onsubmit={onPasswordChange} bind:this={passwordForm}> - <label - >current password - <input - class="input" - name="currentPassword" - type="password" - placeholder="password" - bind:value={currentPassword} - /> - </label> - - <label - >new password - <input - class="input" - name="newPassword" - type="password" - placeholder="password" - bind:value={newPassword} - /> - </label> - - <label - >confirm new password - <input - class="input" - name="confirmPassword" - type="password" - placeholder="password" - bind:value={confirmPassword} - /> - </label> +<div class="mb-4"> + <ChangePassword /> +</div> - <button class="btn variant-filled" type="submit" {disabled}> change password </button> -</form> +<div class="mb-4"> + <Invites /> +</div> -<Invites /> +<div> + <LogOut /> +</div> diff --git a/ui/routes/+layout.svelte b/ui/routes/+layout.svelte index ef3e823..8940659 100644 --- a/ui/routes/+layout.svelte +++ b/ui/routes/+layout.svelte @@ -30,10 +30,10 @@ <img class="w-8 h-8" alt="logo" src={logo} /> </button> </svelte:fragment> - <a href="/">understory</a> + <a href="/">pilcrow</a> <svelte:fragment slot="trail"> {#if $currentUser} - <div class="rounded-full bg-secondary-400 px-2 py-1"> + <div class="rounded-full bg-secondary-400 px-3 py-1"> <a href="/me">@{$currentUser.username}</a> </div> {/if} |
