feat: add community cards with a hacky slot parameter
This commit is contained in:
1 parent
b65d78b973
commit
d2b27803b4
9 files changed
+78
-39
No files matched your search
@@ -25,7 +25,7 @@
|
||||
export let version: string | undefined = undefined
|
||||
</script>
|
||||
|
||||
<StickyCard>
|
||||
<StickyCard class="w-full {$$props.class}">
|
||||
<div class="flex flex-row gap-3 items-center">
|
||||
{#if site.site.icon}
|
||||
<Avatar width={42} url={site.site.icon} alt={site.site.name} />
|
||||
@@ -59,20 +59,19 @@
|
||||
<FormattedNumber number={site.counts.communities} />
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex flex-row items-center">
|
||||
<Button href="/modlog" size="sm" class="rounded-r-none">
|
||||
<div class="flex flex-col 3xl:flex-row 3xl:items-center gap-2 3xl:gap-0">
|
||||
<Button href="/modlog" class="3xl:rounded-r-none">
|
||||
<Icon src={Newspaper} size="16" mini />
|
||||
Modlog
|
||||
</Button>
|
||||
<Button
|
||||
href="/legal"
|
||||
size="sm"
|
||||
class="rounded-l-none rounded-r-none border-x-0"
|
||||
class="3xl:rounded-l-none 3xl:rounded-r-none 3xl:border-x-0"
|
||||
>
|
||||
<Icon src={BuildingOffice} size="16" mini />
|
||||
Legal
|
||||
</Button>
|
||||
<Button href="/instances" size="sm" class="rounded-l-none">
|
||||
<Button href="/instances" class="3xl:rounded-l-none">
|
||||
<Icon src={ServerStack} size="16" mini />
|
||||
Instances
|
||||
</Button>
|
||||
|
||||
@@ -141,18 +141,21 @@
|
||||
</Modal>
|
||||
{/if}
|
||||
|
||||
<StickyCard>
|
||||
<StickyCard class="min-w-full {$$props.class}">
|
||||
<div class="flex flex-row gap-3 items-center">
|
||||
<div class="flex-shrink-0">
|
||||
<Avatar
|
||||
width={48}
|
||||
width={42}
|
||||
url={community_view.community.icon}
|
||||
alt={community_view.community.name}
|
||||
/>
|
||||
</div>
|
||||
<div class="flex flex-col gap-0">
|
||||
<h1 class="font-bold text-xl">{community_view.community.title}</h1>
|
||||
<span class="dark:text-zinc-400 text-slate-600 text-sm">
|
||||
<span
|
||||
class="dark:text-zinc-400 text-slate-600 text-sm break-words max-w-full"
|
||||
style="word-break: break-all;"
|
||||
>
|
||||
!{community_view.community.name}@{new URL(
|
||||
community_view.community.actor_id
|
||||
).hostname}
|
||||
@@ -209,7 +212,6 @@
|
||||
<div class="w-full mt-2 flex flex-col gap-2">
|
||||
<Button
|
||||
href="/create/post"
|
||||
color="ghost"
|
||||
size="lg"
|
||||
disabled={community_view.community.posting_restricted_to_mods}
|
||||
>
|
||||
@@ -219,7 +221,6 @@
|
||||
<Button
|
||||
disabled={loading.subscribing}
|
||||
loading={loading.subscribing}
|
||||
color="ghost"
|
||||
size="lg"
|
||||
on:click={subscribe}
|
||||
>
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
>
|
||||
<slot
|
||||
name="sidebar"
|
||||
class="hidden md:flex sticky top-16 justify-self-end left-0 w-full max-w-full"
|
||||
style="grid-area: sidebar; max-width: 20rem;"
|
||||
class="hidden md:flex sticky top-16 left-0 w-full max-w-full"
|
||||
style="grid-area: sidebar; width: 100% !important;"
|
||||
/>
|
||||
<slot
|
||||
name="main"
|
||||
@@ -39,8 +39,8 @@
|
||||
/>
|
||||
<slot
|
||||
name="suffix"
|
||||
class="hidden xl:flex w-full justify-self-start"
|
||||
style="grid-area: suffix; max-width: 20rem;"
|
||||
class="max-xl:hidden w-full"
|
||||
style="grid-area: suffix;"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -76,13 +76,13 @@
|
||||
|
||||
@media (min-width: 1280px) {
|
||||
.content {
|
||||
grid-template-columns: 1fr 3fr 1fr;
|
||||
grid-template-columns: 20% 1fr 20%;
|
||||
justify-items: end center start;
|
||||
grid-template-areas: 'sidebar main suffix';
|
||||
}
|
||||
}
|
||||
|
||||
.limit-width {
|
||||
max-width: 96rem;
|
||||
max-width: 100rem;
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user