From 62baf475b607f311282a3af6981e1e440b42e3de Mon Sep 17 00:00:00 2001 From: Xyphyn Date: Sun, 30 Jul 2023 14:44:43 -0700 Subject: [PATCH] design: tweak design --- .../lemmy/community/CommunityCard.svelte | 13 +++---- src/lib/components/lemmy/post/Post.svelte | 4 +-- src/lib/components/lemmy/post/PostMeta.svelte | 17 ++++++---- src/lib/components/lemmy/user/UserLink.svelte | 7 +++- src/routes/+layout.svelte | 8 +++-- src/routes/c/[name]/+page.svelte | 34 ++++++++++++------- src/routes/c/[name]/+page.ts | 10 +++--- 7 files changed, 57 insertions(+), 36 deletions(-) diff --git a/src/lib/components/lemmy/community/CommunityCard.svelte b/src/lib/components/lemmy/community/CommunityCard.svelte index 8c1e0832..efee833c 100644 --- a/src/lib/components/lemmy/community/CommunityCard.svelte +++ b/src/lib/components/lemmy/community/CommunityCard.svelte @@ -69,16 +69,13 @@
-
-

- {community_view.community.title} -

- +
+

{community_view.community.title}

+ !{community_view.community.name}@{new URL( community_view.community.actor_id ).hostname} diff --git a/src/lib/components/lemmy/post/Post.svelte b/src/lib/components/lemmy/post/Post.svelte index b39ed726..e6d1bed4 100644 --- a/src/lib/components/lemmy/post/Post.svelte +++ b/src/lib/components/lemmy/post/Post.svelte @@ -10,15 +10,15 @@ import { ToastType, toast } from '$lib/components/ui/toasts/toasts.js' export let post: PostView - export let actions: boolean = true + export let hideCommunity = false
- + {#if community} + + {/if}
- + {#if community} + + {/if} {#if user} - - • +
+ +
{/if} {#if upvotes != undefined && downvotes != undefined} diff --git a/src/lib/components/lemmy/user/UserLink.svelte b/src/lib/components/lemmy/user/UserLink.svelte index e284b091..eaba1ec6 100644 --- a/src/lib/components/lemmy/user/UserLink.svelte +++ b/src/lib/components/lemmy/user/UserLink.svelte @@ -23,7 +23,12 @@ {#if avatar} {/if} - + {#if $userSettings.showInstance} {user.name} diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 45bc9b16..ee869782 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -32,6 +32,8 @@ -
- -
+
+
+ +
+
diff --git a/src/routes/c/[name]/+page.svelte b/src/routes/c/[name]/+page.svelte index ef1d90a4..448abbeb 100644 --- a/src/routes/c/[name]/+page.svelte +++ b/src/routes/c/[name]/+page.svelte @@ -12,6 +12,7 @@ import { userSettings } from '$lib/settings.js' import Modal from '$lib/components/ui/modal/Modal.svelte' import Pageination from '$lib/components/ui/Pageination.svelte' + import Avatar from '$lib/components/ui/Avatar.svelte' export let data @@ -20,14 +21,11 @@ {data.posts.posts[0]?.community.name} - - {#if data.community.community_view.community.description} + + {#if data.community.community.description} {/if} @@ -36,15 +34,27 @@ Sidebar
- +
-

- {data.community.community_view.community.title} -

+
+ +
+

{data.community.community.title}

+ + !{data.community.community.name}@{new URL( + data.community.community.actor_id + ).hostname} + +
+
{#each data.posts.posts as post, index (post.post.id)}
- +
{/each}
diff --git a/src/routes/c/[name]/+page.ts b/src/routes/c/[name]/+page.ts index 6d085617..a86275c5 100644 --- a/src/routes/c/[name]/+page.ts +++ b/src/routes/c/[name]/+page.ts @@ -20,9 +20,11 @@ export async function load(req: any) { sort: sort, auth: get(authData)?.token, }), - community: await getClient().getCommunity({ - name: req.params.name, - auth: get(authData)?.token, - }), + community: ( + await getClient().getCommunity({ + name: req.params.name, + auth: get(authData)?.token, + }) + ).community_view, } }