Skip to content

Commit

Permalink
fix(ui): update chatbar reply ui (#645)
Browse files Browse the repository at this point in the history
  • Loading branch information
Flemmli97 authored Oct 3, 2024
1 parent 4c7c081 commit 87bb322
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 26 deletions.
3 changes: 2 additions & 1 deletion src/lib/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@
"send-coin": "Send Coin",
"show-participants": "Participants",
"group-settings": "Settings",
"replyTo": "Replying to: {user}"
"replyTo": "Replying to: {user}",
"attachments-count": "Attachments: {amount}"
},
"community": {
"title": "Satellite Community - General",
Expand Down
39 changes: 14 additions & 25 deletions src/lib/layouts/Chatbar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -179,31 +179,10 @@
{/each}

{#if replyTo.attachments.length > 0}
{#each replyTo.attachments as attachment}
{#if attachment.kind === MessageAttachmentKind.File || attachment.location.length == 0}
<FileEmbed
fileInfo={{
id: "1",
isRenaming: OperationState.Initial,
source: "unknown",
name: attachment.name,
size: attachment.size,
icon: Shape.Document,
type: "unknown/unknown",
remotePath: "",
}} />
{:else if attachment.kind === MessageAttachmentKind.Image}
<ImageEmbed source={attachment.location} name={attachment.name} filesize={attachment.size} />
{:else if attachment.kind === MessageAttachmentKind.Text}
<TextDocument />
{:else if attachment.kind === MessageAttachmentKind.STL}
<STLViewer url={attachment.location} name={attachment.name} filesize={attachment.size} />
{:else if attachment.kind === MessageAttachmentKind.Audio}
<AudioEmbed location={attachment.location} name={attachment.name} size={attachment.size} />
{:else if attachment.kind === MessageAttachmentKind.Video}
<VideoEmbed location={attachment.location} name={attachment.name} size={attachment.size} />
{/if}
{/each}
<div class="attachment-container">
<Icon icon={Shape.Document} size={Size.Large} />
{$_("chat.attachments-count", { values: { amount: replyTo.attachments.length } })}
</div>
{/if}
</Message>
<ProfilePicture id={resolved.key} hook="message-group-remote-profile-picture" size={Size.Small} image={resolved.profile.photo.image} status={resolved.profile.status} highlight={Appearance.Default} notifications={0} />
Expand Down Expand Up @@ -286,6 +265,16 @@
overflow: hidden;
text-align: left;
}
.attachment-container {
display: flex;
align-items: center;
background-color: var(--alt-color);
padding: var(--padding-minimal);
border-radius: var(--border-radius-less);
}
.sticker {
width: 45px;
}
}
:global(.button) {
position: absolute;
Expand Down

0 comments on commit 87bb322

Please sign in to comment.