Files
Modrinth-plus/pages/dashboard.vue

108 lines
3.0 KiB
Vue
Raw Normal View History

2021-03-29 18:14:06 -07:00
<template>
<div class="page-container">
<div class="page-contents">
<div class="sidebar-l">
<div v-if="$auth.user != null" class="card page-nav">
<nuxt-link :to="'/dashboard/projects'" class="tab">
2021-03-29 18:14:06 -07:00
<ModIcon />
My mods
</nuxt-link>
<nuxt-link :to="'/dashboard/notifications'" class="tab">
2021-03-29 18:14:06 -07:00
<NotificationsIcon />
Notifications
<div v-if="this.$user.notifications.count > 0" class="notif-count">
{{ this.$user.notifications.count }}
</div>
2021-03-29 18:14:06 -07:00
</nuxt-link>
<nuxt-link :to="'/dashboard/follows'" class="tab">
<FollowIcon />
Followed mods
</nuxt-link>
2021-03-29 18:14:06 -07:00
<nuxt-link
v-if="
$auth.user.role === 'admin' || $auth.user.role === 'moderator'
"
:to="'/dashboard/moderation'"
class="tab"
2021-03-29 18:14:06 -07:00
>
<ModerationIcon />
Moderation
</nuxt-link>
<nuxt-link :to="'/dashboard/settings'" class="tab">
2021-03-29 18:14:06 -07:00
<SettingsIcon />
Settings
</nuxt-link>
<nuxt-link :to="'/dashboard/privacy'" class="tab">
<ShieldIcon />
Privacy settings
2021-04-10 21:54:16 -07:00
</nuxt-link>
2021-03-29 18:14:06 -07:00
</div>
<div v-else class="card page-nav">
<a :href="authUrl" class="tab">
<UserIcon />
Log in
</a>
<nuxt-link :to="'/dashboard/privacy'" class="tab">
<SettingsIcon />
Privacy settings
</nuxt-link>
</div>
<m-footer class="footer" hide-small />
2021-03-29 18:14:06 -07:00
</div>
<div class="content">
<NuxtChild />
<m-footer class="footer" hide-big centered />
2021-03-29 18:14:06 -07:00
</div>
</div>
</div>
</template>
<script>
import ModIcon from '~/assets/images/sidebar/mod.svg?inline'
import ModerationIcon from '~/assets/images/sidebar/admin.svg?inline'
import SettingsIcon from '~/assets/images/sidebar/settings.svg?inline'
import NotificationsIcon from '~/assets/images/sidebar/notifications.svg?inline'
import FollowIcon from '~/assets/images/utils/heart.svg?inline'
import UserIcon from '~/assets/images/utils/user.svg?inline'
import ShieldIcon from '~/assets/images/utils/shield.svg?inline'
2021-03-29 18:14:06 -07:00
2021-05-02 14:58:27 -07:00
import MFooter from '~/components/layout/MFooter'
2021-03-29 18:14:06 -07:00
export default {
name: 'DashboardPage',
components: {
ModIcon,
ModerationIcon,
SettingsIcon,
NotificationsIcon,
FollowIcon,
UserIcon,
ShieldIcon,
2021-05-02 14:58:27 -07:00
MFooter,
},
computed: {
authUrl() {
return `${this.$axios.defaults.baseURL}auth/init?url=${this.$store.app.$config.utils.domain}${this.$route.fullPath}`
},
2021-03-29 18:14:06 -07:00
},
}
</script>
<style lang="scss" scoped>
.hideSmall {
2021-03-29 18:14:06 -07:00
padding-top: 0;
}
.notif-count {
display: flex;
justify-content: center;
align-items: center;
background-color: rgba(180, 180, 180, 0.4);
border-radius: 2rem;
padding: 0.1rem 0.35rem;
margin: 0 0.2rem 0 auto;
font-size: 0.9rem;
}
2021-03-29 18:14:06 -07:00
</style>