You've already forked AstralRinth
forked from didirus/AstralRinth
* Begin affiliates frontend * Significant work on hooking up affiliates ui * Clean up server nodes menu * affiliates work * update affiliate time * oops * fix local import * fix local import x2 * remove line in dashboard * lint
83 lines
2.3 KiB
Vue
83 lines
2.3 KiB
Vue
<template>
|
|
<div class="normal-page">
|
|
<div class="normal-page__sidebar">
|
|
<aside class="universal-card">
|
|
<h1>Dashboard</h1>
|
|
<NavStack>
|
|
<NavStackItem link="/dashboard" label="Overview">
|
|
<DashboardIcon aria-hidden="true" />
|
|
</NavStackItem>
|
|
<NavStackItem link="/dashboard/notifications" label="Notifications">
|
|
<NotificationsIcon aria-hidden="true" />
|
|
</NavStackItem>
|
|
<NavStackItem link="/dashboard/reports" label="Active reports">
|
|
<ReportIcon aria-hidden="true" />
|
|
</NavStackItem>
|
|
<NavStackItem link="/dashboard/analytics" label="Analytics">
|
|
<ChartIcon aria-hidden="true" />
|
|
</NavStackItem>
|
|
|
|
<h3>Manage</h3>
|
|
<NavStackItem v-if="true" link="/dashboard/projects" label="Projects">
|
|
<ListIcon aria-hidden="true" />
|
|
</NavStackItem>
|
|
<NavStackItem v-if="true" link="/dashboard/organizations" label="Organizations">
|
|
<OrganizationIcon aria-hidden="true" />
|
|
</NavStackItem>
|
|
<NavStackItem
|
|
link="/dashboard/collections"
|
|
:label="formatMessage(commonMessages.collectionsLabel)"
|
|
>
|
|
<LibraryIcon aria-hidden="true" />
|
|
</NavStackItem>
|
|
<NavStackItem
|
|
v-if="isAffiliate"
|
|
link="/dashboard/affiliate-links"
|
|
:label="formatMessage(commonMessages.affiliateLinksButton)"
|
|
>
|
|
<AffiliateIcon aria-hidden="true" />
|
|
</NavStackItem>
|
|
<NavStackItem link="/dashboard/revenue" label="Revenue">
|
|
<CurrencyIcon aria-hidden="true" />
|
|
</NavStackItem>
|
|
</NavStack>
|
|
</aside>
|
|
</div>
|
|
<div class="normal-page__content">
|
|
<NuxtPage :route="route" />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
<script setup lang="ts">
|
|
import {
|
|
AffiliateIcon,
|
|
BellIcon as NotificationsIcon,
|
|
ChartIcon,
|
|
CurrencyIcon,
|
|
DashboardIcon,
|
|
LibraryIcon,
|
|
ListIcon,
|
|
OrganizationIcon,
|
|
ReportIcon,
|
|
} from '@modrinth/assets'
|
|
import { commonMessages } from '@modrinth/ui'
|
|
import { type User, UserBadge } from '@modrinth/utils'
|
|
|
|
import NavStack from '~/components/ui/NavStack.vue'
|
|
import NavStackItem from '~/components/ui/NavStackItem.vue'
|
|
|
|
const auth = (await useAuth()) as Ref<{ user: User | null }>
|
|
|
|
const isAffiliate = computed(() => {
|
|
return auth.value.user && auth.value.user.badges & UserBadge.AFFILIATE
|
|
})
|
|
|
|
const { formatMessage } = useVIntl()
|
|
|
|
definePageMeta({
|
|
middleware: 'auth',
|
|
})
|
|
|
|
const route = useNativeRoute()
|
|
</script>
|