2022-07-29 19:11:09 +00:00
|
|
|
<template>
|
2022-08-06 11:06:51 +00:00
|
|
|
<div v-if="user.name" class="topbar__container">
|
2022-07-29 19:11:09 +00:00
|
|
|
<div class="topbar__username">
|
2022-08-06 11:06:51 +00:00
|
|
|
{{ user.name }}
|
2022-07-29 19:11:09 +00:00
|
|
|
</div>
|
|
|
|
<div class="topbar__separator" />
|
|
|
|
<div class="topbar__actionbar">
|
2022-08-06 11:06:51 +00:00
|
|
|
<div v-if="user.isAdmin" class="topbar__actionbar__admin">
|
|
|
|
Admin
|
|
|
|
</div>
|
|
|
|
<div v-if="user.isGamemaster" class="topbar__actionbar__gamemaster">
|
|
|
|
Collect Quotes | Start | Continue | Idle | Finish
|
|
|
|
</div>
|
|
|
|
<div v-else class="topbar__actionbar__user">
|
|
|
|
{{ game.name }}
|
|
|
|
</div>
|
2022-07-29 19:11:09 +00:00
|
|
|
</div>
|
|
|
|
<div class="topbar__separator" />
|
|
|
|
<div class="topbar__logout-button-container">
|
|
|
|
<Button class="topbar__logout-button" :border="false" @click="actionLogout">Logout</Button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
import { useRouter } from '#app'
|
|
|
|
import useAuth from '@/composables/useAuth';
|
2022-07-29 21:41:24 +00:00
|
|
|
import { useUserinfoStore } from "@/stores/UserinfoStore"
|
2022-08-06 11:06:51 +00:00
|
|
|
import { useGameinfoStore } from "@/stores/GameinfoStore"
|
2022-07-29 21:41:24 +00:00
|
|
|
|
2022-08-06 11:06:51 +00:00
|
|
|
const user = useUserinfoStore()
|
|
|
|
const game = useGameinfoStore()
|
2022-07-29 19:11:09 +00:00
|
|
|
|
|
|
|
const actionLogout = async () => {
|
|
|
|
await useAuth().logout()
|
|
|
|
useRouter().push('/')
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
@import '~/assets/css/components';
|
|
|
|
|
|
|
|
.topbar {
|
|
|
|
&__container {
|
|
|
|
display: flex;
|
|
|
|
width: 100%;
|
|
|
|
height: 64px;
|
|
|
|
align-items: center;
|
|
|
|
background-color: $topbar-background-color;
|
2022-07-30 09:49:50 +00:00
|
|
|
font-size: 16px;
|
|
|
|
font-family: $font-primary;
|
|
|
|
font-weight: bold;
|
2022-07-29 19:11:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&__username,
|
|
|
|
&__logout-button-container {
|
|
|
|
width: 128px;
|
|
|
|
padding: 0 16px;
|
|
|
|
text-align: center;
|
|
|
|
color: $text-primary-color;
|
|
|
|
}
|
2022-07-30 09:49:50 +00:00
|
|
|
|
2022-07-29 19:11:09 +00:00
|
|
|
&__actionbar {
|
|
|
|
flex-grow: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
&__separator {
|
|
|
|
width: 1px;
|
|
|
|
height: calc(64px - 2 * 16px);
|
|
|
|
margin: 16px 0;
|
|
|
|
background-color: $topbar-separator-color;
|
|
|
|
}
|
|
|
|
|
|
|
|
&__logout-button {
|
|
|
|
color: $text-primary-color;
|
2022-07-29 21:41:24 +00:00
|
|
|
font-size: 16px;
|
2022-07-30 09:49:50 +00:00
|
|
|
font-family: $font-primary;
|
2022-07-29 19:11:09 +00:00
|
|
|
|
|
|
|
&:hover {
|
|
|
|
color: $text-primary-hover-color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|