diff options
Diffstat (limited to 'ui/lib')
| -rw-r--r-- | ui/lib/components/ActiveChannel.svelte | 4 | ||||
| -rw-r--r-- | ui/lib/components/ChangePassword.svelte | 7 | ||||
| -rw-r--r-- | ui/lib/components/Channel.svelte | 2 | ||||
| -rw-r--r-- | ui/lib/components/CreateChannelForm.svelte | 7 | ||||
| -rw-r--r-- | ui/lib/components/LogIn.svelte | 8 | ||||
| -rw-r--r-- | ui/lib/components/Message.svelte | 8 | ||||
| -rw-r--r-- | ui/lib/components/MessageInput.svelte | 11 | ||||
| -rw-r--r-- | ui/lib/components/MessageRun.svelte | 6 | ||||
| -rw-r--r-- | ui/lib/store/channels.svelte.js | 9 | ||||
| -rw-r--r-- | ui/lib/store/messages.svelte.js | 2 |
10 files changed, 13 insertions, 51 deletions
diff --git a/ui/lib/components/ActiveChannel.svelte b/ui/lib/components/ActiveChannel.svelte index ba62d6c..9c181e4 100644 --- a/ui/lib/components/ActiveChannel.svelte +++ b/ui/lib/components/ActiveChannel.svelte @@ -5,7 +5,5 @@ </script> {#each messageRuns as { sender, messages }} - <div> - <MessageRun {sender} {messages} /> - </div> + <MessageRun {sender} {messages} /> {/each} diff --git a/ui/lib/components/ChangePassword.svelte b/ui/lib/components/ChangePassword.svelte index 51ebccd..bf94ea7 100644 --- a/ui/lib/components/ChangePassword.svelte +++ b/ui/lib/components/ChangePassword.svelte @@ -35,12 +35,7 @@ <label >new password - <input - name="newPassword" - type="password" - placeholder="password" - bind:value={newPassword} - /> + <input name="newPassword" type="password" placeholder="password" bind:value={newPassword} /> </label> <label diff --git a/ui/lib/components/Channel.svelte b/ui/lib/components/Channel.svelte index 2fc3249..c73340f 100644 --- a/ui/lib/components/Channel.svelte +++ b/ui/lib/components/Channel.svelte @@ -3,7 +3,7 @@ </script> <a href="/ch/{id}"> - <li class:active={active}> + <li class:active> {#if hasUnreads} <span class="badge has-unreads">❦</span> {:else} diff --git a/ui/lib/components/CreateChannelForm.svelte b/ui/lib/components/CreateChannelForm.svelte index 8fab4c4..85c85bb 100644 --- a/ui/lib/components/CreateChannelForm.svelte +++ b/ui/lib/components/CreateChannelForm.svelte @@ -16,11 +16,6 @@ </script> <form onsubmit={handleSubmit}> - <input - type="text" - placeholder="create channel" - bind:value={name} - {disabled} - /> + <input type="text" placeholder="create channel" bind:value={name} {disabled} /> <button type="submit">➕</button> </form> diff --git a/ui/lib/components/LogIn.svelte b/ui/lib/components/LogIn.svelte index 44aab44..5bfdae2 100644 --- a/ui/lib/components/LogIn.svelte +++ b/ui/lib/components/LogIn.svelte @@ -12,13 +12,7 @@ <form class="form" {onsubmit}> <label for="username"> username - <input - name="username" - type="text" - placeholder="username" - bind:value={username} - {disabled} - /> + <input name="username" type="text" placeholder="username" bind:value={username} {disabled} /> </label> <label for="password"> password diff --git a/ui/lib/components/Message.svelte b/ui/lib/components/Message.svelte index 6918b5d..1b1598b 100644 --- a/ui/lib/components/Message.svelte +++ b/ui/lib/components/Message.svelte @@ -25,13 +25,7 @@ } </script> -<div - class="message" - class:delete-armed={deleteArmed} - role="article" - data-at={at} - {onmouseleave} - > +<div class="message" class:delete-armed={deleteArmed} role="article" data-at={at} {onmouseleave}> <div class="handle"> {atFormatted} {#if editable} diff --git a/ui/lib/components/MessageInput.svelte b/ui/lib/components/MessageInput.svelte index 25a0352..162db1b 100644 --- a/ui/lib/components/MessageInput.svelte +++ b/ui/lib/components/MessageInput.svelte @@ -24,13 +24,6 @@ </script> <form bind:this={form} onsubmit={onSubmit}> - <textarea - onkeydown={onKeyDown} - bind:value - {disabled} - type="search" - ></textarea> - <button - type="submit" - >»</button> + <textarea onkeydown={onKeyDown} bind:value {disabled} type="search"></textarea> + <button type="submit">»</button> </form> diff --git a/ui/lib/components/MessageRun.svelte b/ui/lib/components/MessageRun.svelte index dec5f4f..bee64e8 100644 --- a/ui/lib/components/MessageRun.svelte +++ b/ui/lib/components/MessageRun.svelte @@ -8,11 +8,7 @@ let ownMessage = $derived($currentUser !== null && $currentUser.id == sender); </script> -<div - class="message-run" - class:own-message={ownMessage} - class:other-message={!ownMessage} -> +<div class="message-run" class:own-message={ownMessage} class:other-message={!ownMessage}> <span class="username"> @{name}: </span> diff --git a/ui/lib/store/channels.svelte.js b/ui/lib/store/channels.svelte.js index 8919be0..c82f9aa 100644 --- a/ui/lib/store/channels.svelte.js +++ b/ui/lib/store/channels.svelte.js @@ -1,5 +1,5 @@ import { DateTime } from 'luxon'; -const EPOCH_STRING = "1970-01-01T00:00:00Z"; +const EPOCH_STRING = '1970-01-01T00:00:00Z'; // For reasons unclear to me, a straight up class definition with a constructor // doesn't seem to work, reactively. So we resort to this. @@ -15,7 +15,7 @@ function makeChannelObject({ id, name, draft = '', lastReadAt = null, scrollPosi name, lastReadAt: lastReadAt || DateTime.fromISO(EPOCH_STRING), draft, - scrollPosition, + scrollPosition }; } @@ -33,10 +33,7 @@ export class Channels { } addChannel(id, name) { - this.channels = [ - ...this.channels, - makeChannelObject({ id, name }), - ]; + this.channels = [...this.channels, makeChannelObject({ id, name })]; this.sort(); return this; } diff --git a/ui/lib/store/messages.svelte.js b/ui/lib/store/messages.svelte.js index ba4c895..dadade6 100644 --- a/ui/lib/store/messages.svelte.js +++ b/ui/lib/store/messages.svelte.js @@ -5,7 +5,7 @@ import DOMPurify from 'dompurify'; const RUN_COALESCE_MAX_INTERVAL = 10 /* min */ * 60 /* sec */ * 1000; /* ms */ export class Messages { - channels = $state({}); // Mapping<ChannelId, Message> + channels = $state({}); // Mapping<ChannelId, Message> inChannel(channel) { return this.channels[channel] || []; |
