From 7715e747a29b84f98d3b229c2aa56bc5b41cada7 Mon Sep 17 00:00:00 2001 From: ari melody Date: Sun, 30 Jun 2024 20:53:51 +0100 Subject: [PATCH] slight post UI polish --- src/lib/ui/Navigation.svelte | 4 +- src/lib/ui/post/ActionBar.svelte | 101 +++++++++++++++++++ src/lib/ui/post/ActionButton.svelte | 3 +- src/lib/ui/post/Body.svelte | 36 +++---- src/lib/ui/post/Post.svelte | 134 ++------------------------ src/lib/ui/post/ReactionBar.svelte | 43 +++++++++ src/lib/ui/post/ReactionButton.svelte | 3 +- src/lib/ui/post/ReplyContext.svelte | 63 ++---------- 8 files changed, 185 insertions(+), 202 deletions(-) create mode 100644 src/lib/ui/post/ActionBar.svelte create mode 100644 src/lib/ui/post/ReactionBar.svelte diff --git a/src/lib/ui/Navigation.svelte b/src/lib/ui/Navigation.svelte index c360530..04f5402 100644 --- a/src/lib/ui/Navigation.svelte +++ b/src/lib/ui/Navigation.svelte @@ -145,7 +145,6 @@ {`@${client.user.username}@${client.user.host}`} - {/if} @@ -153,7 +152,8 @@ campfire v{VERSION}
diff --git a/src/lib/ui/post/ActionBar.svelte b/src/lib/ui/post/ActionBar.svelte new file mode 100644 index 0000000..c40418e --- /dev/null +++ b/src/lib/ui/post/ActionBar.svelte @@ -0,0 +1,101 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + diff --git a/src/lib/ui/post/ActionButton.svelte b/src/lib/ui/post/ActionButton.svelte index d78bee1..d338c19 100644 --- a/src/lib/ui/post/ActionButton.svelte +++ b/src/lib/ui/post/ActionButton.svelte @@ -74,7 +74,8 @@ button.disabled { opacity: .5; - cursor: initial; + /* cursor: initial; */ + cursor: not-allowed; } .icon { diff --git a/src/lib/ui/post/Body.svelte b/src/lib/ui/post/Body.svelte index f56b766..1e068b3 100644 --- a/src/lib/ui/post/Body.svelte +++ b/src/lib/ui/post/Body.svelte @@ -25,23 +25,25 @@ {#if post.text} {@html rich_text} {/if} -
- {#each post.files as file} -
- {#if file.type === "image"} - - {file.description} - - {:else if file.type === "video"} - - {/if} -
- {/each} -
+ {#if post.files && post.files.length > 0} +
+ {#each post.files as file} +
+ {#if file.type === "image"} + + {file.description} + + {:else if file.type === "video"} + + {/if} +
+ {/each} +
+ {/if} {#if post.boost && post.text}

this is quoting a post! quotes are not supported yet.

diff --git a/src/lib/ui/post/Post.svelte b/src/lib/ui/post/Post.svelte index 63ace94..a569df3 100644 --- a/src/lib/ui/post/Post.svelte +++ b/src/lib/ui/post/Post.svelte @@ -1,25 +1,15 @@ + +
+ {#each post.reactions as reaction} + toggleReaction(reaction)} + bind:active={reaction.me} + bind:count={reaction.count} + disabled={reaction.name.includes('@')} + title={reaction.name} + label=""> + {#if reaction.url} + {reaction.name} + {:else} + {reaction.name} + {/if} + + {/each} + + + +
+ + diff --git a/src/lib/ui/post/ReactionButton.svelte b/src/lib/ui/post/ReactionButton.svelte index caf246e..fee3a97 100644 --- a/src/lib/ui/post/ReactionButton.svelte +++ b/src/lib/ui/post/ReactionButton.svelte @@ -67,7 +67,8 @@ } button.disabled { - cursor: initial; + /* cursor: initial; */ + cursor: not-allowed; } .icon { diff --git a/src/lib/ui/post/ReplyContext.svelte b/src/lib/ui/post/ReplyContext.svelte index 7c2ace5..57c88df 100644 --- a/src/lib/ui/post/ReplyContext.svelte +++ b/src/lib/ui/post/ReplyContext.svelte @@ -1,9 +1,4 @@