design: tweak design

This commit is contained in:
Xyphyn committed 2023-07-30 14:44:43 -07:00
1 parent ddea19e6b9
commit 62baf475b6
7 files changed
+57 -36

No files matched your search

@@ -69,16 +69,13 @@
<StickyCard> <StickyCard>
<div class="flex flex-row gap-3 items-center"> <div class="flex flex-row gap-3 items-center">
<Avatar <Avatar
width={42} width={48}
url={community_view.community.icon ?? url={community_view.community.icon}
`https://api.dicebear.com/6.x/initials/svg?seed=${community_view.community.name}`}
alt={community_view.community.name} alt={community_view.community.name}
/> />
<div class="flex flex-col"> <div class="flex flex-col gap-0">
<h1 class="font-bold text-base"> <h1 class="font-bold text-xl">{community_view.community.title}</h1>
{community_view.community.title} <span class="dark:text-zinc-400 text-slate-600 text-sm">
</h1>
<span class="opacity-60 text-sm">
!{community_view.community.name}@{new URL( !{community_view.community.name}@{new URL(
community_view.community.actor_id community_view.community.actor_id
).hostname} ).hostname}
+2 -2
View File
@@ -10,15 +10,15 @@
import { ToastType, toast } from '$lib/components/ui/toasts/toasts.js' import { ToastType, toast } from '$lib/components/ui/toasts/toasts.js'
export let post: PostView export let post: PostView
export let actions: boolean = true export let actions: boolean = true
export let hideCommunity = false
</script> </script>
<Card class="bg-white flex flex-col w-full p-5 gap-2.5"> <Card class="bg-white flex flex-col w-full p-5 gap-2.5">
<div class="flex flex-row w-full gap-2.5"> <div class="flex flex-row w-full gap-2.5">
<div class="flex flex-col gap-1.5 grow"> <div class="flex flex-col gap-1.5 grow">
<PostMeta <PostMeta
community={post.community} community={hideCommunity ? undefined : post.community}
user={post.creator} user={post.creator}
published={new Date(post.post.published + 'Z')} published={new Date(post.post.published + 'Z')}
upvotes={post.counts.upvotes} upvotes={post.counts.upvotes}
+11 -6
View File
@@ -13,7 +13,7 @@
Trash, Trash,
} from 'svelte-hero-icons' } from 'svelte-hero-icons'
export let community: Community export let community: Community | undefined = undefined
export let user: Person | undefined = undefined export let user: Person | undefined = undefined
export let published: Date export let published: Date
@@ -31,15 +31,20 @@
</script> </script>
<span class="flex flex-row gap-2 text-sm items-center"> <span class="flex flex-row gap-2 text-sm items-center">
<Avatar url={community.icon} width={24} alt={community.name} /> {#if community}
<Avatar url={community.icon} width={24} alt={community.name} />
{/if}
<div class="flex flex-col text-xs"> <div class="flex flex-col text-xs">
<CommunityLink {community} /> {#if community}
<CommunityLink {community} />
{/if}
<span <span
class="text-slate-600 dark:text-zinc-400 flex flex-row gap-1 flex-wrap" class="text-slate-600 dark:text-zinc-400 flex flex-row gap-1 flex-wrap items-center"
> >
{#if user} {#if user}
<UserLink {user} /> <div class="mr-0.5 text-zinc-100">
<span>•</span> <UserLink avatarSize={20} {user} avatar={!community} />
</div>
{/if} {/if}
<RelativeDate date={published} /> <RelativeDate date={published} />
{#if upvotes != undefined && downvotes != undefined} {#if upvotes != undefined && downvotes != undefined}
@@ -23,7 +23,12 @@
{#if avatar} {#if avatar}
<Avatar url={user.avatar} alt={user.name} width={avatarSize} /> <Avatar url={user.avatar} alt={user.name} width={avatarSize} />
{/if} {/if}
<span class="flex flex-wrap gap-0" class:text-red-500={user.admin}> <span
class="flex flex-wrap gap-0"
class:ml-0.5={avatar}
class:text-red-500={user.admin}
class:font-bold={user.admin}
>
{#if $userSettings.showInstance} {#if $userSettings.showInstance}
{user.name} {user.name}
<span class="text-slate-500 dark:text-zinc-400 font-normal"> <span class="text-slate-500 dark:text-zinc-400 font-normal">
+5 -3
View File
@@ -32,6 +32,8 @@
<Navbar /> <Navbar />
<ToastContainer /> <ToastContainer />
<Moderation /> <Moderation />
<main class="mx-auto max-w-5xl p-4 flex-1 w-full"> <div class="flex flex-row w-full mx-auto max-w-6xl">
<slot /> <main class="p-4 flex-[3]">
</main> <slot />
</main>
</div>
+22 -12
View File
@@ -12,6 +12,7 @@
import { userSettings } from '$lib/settings.js' import { userSettings } from '$lib/settings.js'
import Modal from '$lib/components/ui/modal/Modal.svelte' import Modal from '$lib/components/ui/modal/Modal.svelte'
import Pageination from '$lib/components/ui/Pageination.svelte' import Pageination from '$lib/components/ui/Pageination.svelte'
import Avatar from '$lib/components/ui/Avatar.svelte'
export let data export let data
@@ -20,14 +21,11 @@
<svelte:head> <svelte:head>
<title>{data.posts.posts[0]?.community.name}</title> <title>{data.posts.posts[0]?.community.name}</title>
<meta <meta name="og:title" content={data.community.community.name} />
name="og:title" {#if data.community.community.description}
content={data.community.community_view.community.name}
/>
{#if data.community.community_view.community.description}
<meta <meta
name="og:description" name="og:description"
content={data.community.community_view.community.description} content={data.community.community.description}
/> />
{/if} {/if}
<meta name="og:url" content={$page.url.toString()} /> <meta name="og:url" content={$page.url.toString()} />
@@ -36,15 +34,27 @@
<Modal bind:open={sidebar}> <Modal bind:open={sidebar}>
<span slot="title">Sidebar</span> <span slot="title">Sidebar</span>
<div class="mx-auto"> <div class="mx-auto">
<CommunityCard community_view={data.community.community_view} /> <CommunityCard community_view={data.community} />
</div> </div>
</Modal> </Modal>
<div class="flex flex-col md:flex-row gap-4 w-full"> <div class="flex flex-col md:flex-row gap-4 w-full">
<div class="flex flex-col gap-4 max-w-full w-full min-w-0"> <div class="flex flex-col gap-4 max-w-full w-full min-w-0">
<h1 class="text-2xl font-bold"> <div class="flex flex-row gap-3 items-center">
{data.community.community_view.community.title} <Avatar
</h1> width={48}
url={data.community.community.icon}
alt={data.community.community.name}
/>
<div class="flex flex-col gap-0">
<h1 class="font-bold text-xl">{data.community.community.title}</h1>
<span class="dark:text-zinc-400 text-slate-600 text-sm">
!{data.community.community.name}@{new URL(
data.community.community.actor_id
).hostname}
</span>
</div>
</div>
<div class="md:hidden"> <div class="md:hidden">
<Button color="secondary" on:click={() => (sidebar = true)}> <Button color="secondary" on:click={() => (sidebar = true)}>
Sidebar Sidebar
@@ -68,7 +78,7 @@
</div> </div>
{#each data.posts.posts as post, index (post.post.id)} {#each data.posts.posts as post, index (post.post.id)}
<div in:fly={{ y: -8, opacity: 0, delay: index < 4 ? index * 100 : 0 }}> <div in:fly={{ y: -8, opacity: 0, delay: index < 4 ? index * 100 : 0 }}>
<Post {post} /> <Post hideCommunity={true} {post} />
</div> </div>
{/each} {/each}
<Pageination <Pageination
@@ -82,6 +92,6 @@
/> />
</div> </div>
<div class="hidden md:block"> <div class="hidden md:block">
<CommunityCard community_view={data.community.community_view} /> <CommunityCard community_view={data.community} />
</div> </div>
</div> </div>
+6 -4
View File
@@ -20,9 +20,11 @@ export async function load(req: any) {
sort: sort, sort: sort,
auth: get(authData)?.token, auth: get(authData)?.token,
}), }),
community: await getClient().getCommunity({ community: (
name: req.params.name, await getClient().getCommunity({
auth: get(authData)?.token, name: req.params.name,
}), auth: get(authData)?.token,
})
).community_view,
} }
} }