From 62746c88e1263ebffa81d634991c95e923e2006e Mon Sep 17 00:00:00 2001 From: megrogan Date: Wed, 20 Dec 2023 16:31:49 +0000 Subject: [PATCH] Community breadcrumb in favourites scope --- .../src/components/home/ChatSubtext.svelte | 17 +++++- .../src/components/home/ChatSummary.svelte | 20 ++++++- .../components/home/CurrentChatHeader.svelte | 59 +++++++++++++++---- 3 files changed, 78 insertions(+), 18 deletions(-) diff --git a/frontend/app/src/components/home/ChatSubtext.svelte b/frontend/app/src/components/home/ChatSubtext.svelte index 31885e413d..371e8940b9 100644 --- a/frontend/app/src/components/home/ChatSubtext.svelte +++ b/frontend/app/src/components/home/ChatSubtext.svelte @@ -1,13 +1,16 @@ {#if chat.kind === "direct_chat"} @@ -37,7 +46,7 @@ {/if} -
+
{chat.memberCount.toLocaleString()} {$_("members")}
@@ -58,4 +67,8 @@ font-weight: 700; } } + + .clickable { + cursor: pointer; + } diff --git a/frontend/app/src/components/home/ChatSummary.svelte b/frontend/app/src/components/home/ChatSummary.svelte index 0792a6a7a6..1f81287454 100644 --- a/frontend/app/src/components/home/ChatSummary.svelte +++ b/frontend/app/src/components/home/ChatSummary.svelte @@ -289,10 +289,14 @@ } $: displayDate = client.getDisplayDate(chatSummary); - $: selectedCommunity = client.selectedCommunity; + $: communities = client.communities; + $: community = + chatSummary.kind === "channel" + ? $communities.get({ kind: "community", communityId: chatSummary.id.communityId }) + : undefined; $: blocked = chatSummary.kind === "direct_chat" && $blockedUsers.has(chatSummary.them.userId); $: readonly = client.isChatReadOnly(chatSummary.id); - $: canDelete = getCanDelete(chatSummary, $selectedCommunity); + $: canDelete = getCanDelete(chatSummary, community); $: pinned = client.pinned($chatListScope.kind, chatSummary.id); $: muted = chatSummary.membership.notificationsMuted; @@ -344,7 +348,13 @@
-

{chat.name}

+

+ {#if community !== undefined && $chatListScope.kind === "favourite"} + {community.name} + {">"} + {/if} + {chat.name} +

@@ -672,7 +682,11 @@ .chat-name { h4 { @include font(medium, normal, fs-100); + display: flex; + flex-direction: row; + gap: $sp2; } + display: flex; align-items: center; gap: $sp2; diff --git a/frontend/app/src/components/home/CurrentChatHeader.svelte b/frontend/app/src/components/home/CurrentChatHeader.svelte index c886d51dea..581cc07502 100644 --- a/frontend/app/src/components/home/CurrentChatHeader.svelte +++ b/frontend/app/src/components/home/CurrentChatHeader.svelte @@ -1,5 +1,11 @@ @@ -134,11 +154,21 @@ size={AvatarSize.Default} />
-
+
{#if isMultiUser && !readonly} - - {chat.name} - +
+ {#if $selectedCommunity !== undefined && $chatListScope.kind === "favourite"} + + {$selectedCommunity.name} + + {">"} + + {chat.name} + + {:else} + {chat.name} + {/if} +
{:else if hasUserProfile} {chat.name} @@ -157,9 +187,10 @@ {:else if chat.typing !== undefined} {chat.typing} {:else if isMultiUser} -
- -
+ {:else} {/if} @@ -197,10 +228,6 @@ @include font(book, normal, fs-80); @include ellipsis(); color: var(--txt-light); - - .members { - cursor: pointer; - } } .avatar { @@ -211,7 +238,7 @@ } } - .group-details { + .pointer { cursor: pointer; } @@ -235,6 +262,12 @@ padding: 0 $sp2; } + .title { + display: flex; + flex-direction: row; + gap: $sp3; + } + .back { flex: 0 0 10px; margin-right: 5px;