feat: put community card actions on the bottom

This commit is contained in:
Xyphyn committed 2023-10-12 15:07:07 -07:00
1 parent 6bd686c22b
commit 010ae783cc
1 file changed
+16 -16
@@ -25,6 +25,7 @@
import { import {
Calendar, Calendar,
ChatBubbleOvalLeftEllipsis, ChatBubbleOvalLeftEllipsis,
Check,
Cog6Tooth, Cog6Tooth,
EllipsisHorizontal, EllipsisHorizontal,
Fire, Fire,
@@ -208,35 +209,36 @@
</div> </div>
</div> </div>
{/if} {/if}
<Markdown source={community_view.community.description} />
{#if $profile?.jwt} {#if $profile?.jwt}
<div class="w-full mt-2 flex flex-col gap-2"> <div
<Button class="flex flex-row items-center gap-2 sticky bottom-0 drop-shadow-xl"
href="/create/post"
size="lg"
disabled={community_view.community.posting_restricted_to_mods}
> >
<Icon src={PencilSquare} mini size="16" slot="prefix" />
Create Post
</Button>
<Button <Button
disabled={loading.subscribing} disabled={loading.subscribing}
loading={loading.subscribing} loading={loading.subscribing}
size="lg" size="md"
color={community_view.subscribed == 'Subscribed'
? 'secondary'
: 'primary'}
on:click={subscribe} on:click={subscribe}
class="flex-1 relative z-[inherit]"
> >
<div
class="absolute top-0 left-0 bg-white dark:bg-black w-full h-full -z-10 rounded-md"
/>
<Icon <Icon
src={community_view.subscribed == 'Subscribed' ? Minus : Plus} src={community_view.subscribed == 'Subscribed' ? Check : Plus}
mini mini
size="16" size="16"
slot="prefix" slot="prefix"
/> />
{community_view.subscribed == 'Subscribed' || {community_view.subscribed == 'Subscribed' ||
community_view.subscribed == 'Pending' community_view.subscribed == 'Pending'
? 'Unsubscribe' ? 'Subscribed'
: 'Subscribe'} : 'Subscribe'}
</Button> </Button>
<div class="flex flex-row gap-2 ml-auto"> {#if $profile?.user && amMod($profile.user, community_view.community)}
{#if $profile.user && amMod($profile.user, community_view.community)}
<Button <Button
href="/c/{fullCommunityName( href="/c/{fullCommunityName(
community_view.community.name, community_view.community.name,
@@ -255,7 +257,7 @@
<Icon src={NoSymbol} size="16" mini slot="prefix" /> <Icon src={NoSymbol} size="16" mini slot="prefix" />
{community_view.blocked ? 'Unblock' : 'Block'} {community_view.blocked ? 'Unblock' : 'Block'}
</MenuButton> </MenuButton>
{#if $profile.user && isAdmin($profile.user)} {#if $profile?.user && isAdmin($profile.user)}
<MenuButton <MenuButton
color="danger-subtle" color="danger-subtle"
on:click={() => (purgingCommunity = !purgingCommunity)} on:click={() => (purgingCommunity = !purgingCommunity)}
@@ -266,7 +268,5 @@
{/if} {/if}
</Menu> </Menu>
</div> </div>
</div>
{/if} {/if}
<Markdown source={community_view.community.description} />
</StickyCard> </StickyCard>