mirror of
https://github.com/Ategon/Jamjar.git
synced 2025-02-12 06:16:21 +00:00
Only show mod zone if user is a mod
This commit is contained in:
parent
743c217ab2
commit
b816523cf9
1 changed files with 41 additions and 41 deletions
|
@ -201,8 +201,8 @@ export default function PostCard({
|
||||||
<></>
|
<></>
|
||||||
)}
|
)}
|
||||||
</DropdownSection>
|
</DropdownSection>
|
||||||
<DropdownSection title="Mod Zone">
|
{user?.mod ? (
|
||||||
{user?.mod ? (
|
<DropdownSection title="Mod Zone">
|
||||||
<DropdownItem
|
<DropdownItem
|
||||||
key="remove"
|
key="remove"
|
||||||
startContent={<X />}
|
startContent={<X />}
|
||||||
|
@ -236,45 +236,45 @@ export default function PostCard({
|
||||||
>
|
>
|
||||||
Remove
|
Remove
|
||||||
</DropdownItem>
|
</DropdownItem>
|
||||||
) : (
|
{user?.admin && !post.author.mod ? (
|
||||||
<></>
|
<DropdownItem
|
||||||
)}
|
key="promote-mod"
|
||||||
{user?.admin && !post.author.mod ? (
|
startContent={<Shield />}
|
||||||
<DropdownItem
|
description="Promote user to Mod"
|
||||||
key="promote-mod"
|
>
|
||||||
startContent={<Shield />}
|
Appoint as mod
|
||||||
description="Promote user to Mod"
|
</DropdownItem>
|
||||||
>
|
) : (
|
||||||
Appoint as mod
|
<></>
|
||||||
</DropdownItem>
|
)}
|
||||||
) : (
|
{user?.admin &&
|
||||||
<></>
|
post.author.mod &&
|
||||||
)}
|
post.author.id !== user.id ? (
|
||||||
{user?.admin &&
|
<DropdownItem
|
||||||
post.author.mod &&
|
key="demote-mod"
|
||||||
post.author.id !== user.id ? (
|
startContent={<ShieldX />}
|
||||||
<DropdownItem
|
description="Demote user from Mod"
|
||||||
key="demote-mod"
|
>
|
||||||
startContent={<ShieldX />}
|
Remove as mod
|
||||||
description="Demote user from Mod"
|
</DropdownItem>
|
||||||
>
|
) : (
|
||||||
Remove as mod
|
<></>
|
||||||
</DropdownItem>
|
)}
|
||||||
) : (
|
{user?.admin && !post.author.admin ? (
|
||||||
<></>
|
<DropdownItem
|
||||||
)}
|
key="promote-admin"
|
||||||
{user?.admin && !post.author.admin ? (
|
startContent={<ShieldAlert />}
|
||||||
<DropdownItem
|
description="Promote user to Admin"
|
||||||
key="promote-admin"
|
>
|
||||||
startContent={<ShieldAlert />}
|
Appoint as admin
|
||||||
description="Promote user to Admin"
|
</DropdownItem>
|
||||||
>
|
) : (
|
||||||
Appoint as admin
|
<></>
|
||||||
</DropdownItem>
|
)}
|
||||||
) : (
|
</DropdownSection>
|
||||||
<></>
|
) : (
|
||||||
)}
|
<></>
|
||||||
</DropdownSection>
|
)}
|
||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue