Skip to content

Commit

Permalink
Add moderation button to user menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Prospector committed Sep 14, 2024
1 parent 95cd485 commit 060682a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions apps/frontend/src/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@
</template>
<template #revenue> <CurrencyIcon aria-hidden="true" /> Revenue </template>
<template #analytics> <ChartIcon aria-hidden="true" /> Analytics </template>
<template #moderation> <ModerationIcon aria-hidden="true" /> Moderation </template>
<template #sign-out> <LogOutIcon aria-hidden="true" /> Sign out </template>
</OverflowMenu>
<ButtonStyled v-else color="brand">
Expand Down Expand Up @@ -778,6 +779,7 @@ const userMenuOptions = computed(() => {
link: "/settings",
},
];
// TODO: Only show if user has projects
options = [
...options,
Expand All @@ -801,6 +803,24 @@ const userMenuOptions = computed(() => {
link: "/dashboard/analytics",
},
];
if (
(auth.value && auth.value.user && auth.value.user.role === "moderator") ||
auth.value.user.role === "admin"
) {
options = [
...options,
{
divider: true,
},
{
id: "moderation",
color: "orange",
link: "/moderation/review",
},
];
}
options = [
...options,
{
Expand Down

0 comments on commit 060682a

Please sign in to comment.