feat: gameboard ui
This commit is contained in:
+10
-16
@@ -3,8 +3,8 @@
|
||||
<nav class="max-w-full p-5 flex flex-row justify-between align-middle">
|
||||
<div class="align-middle text-xl">
|
||||
<RouterLink to="/"> {{ pageTitle }} </RouterLink>
|
||||
<span class="text-xs" v-if="authStore.currentUser">
|
||||
({{ authStore.currentUser?.name }})
|
||||
<span class="text-xs" v-if="authStore.currentUser"
|
||||
> ({{ authStore.currentUser?.name }})
|
||||
</span>
|
||||
</div>
|
||||
<NavBar @logout="logout" :userLoggedIn="authStore.isLoggedIn" />
|
||||
@@ -17,26 +17,22 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { RouterLink, RouterView } from 'vue-router';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { RouterLink, RouterView } from 'vue-router'
|
||||
import { toast } from 'vue-sonner'
|
||||
import 'vue-sonner/style.css'
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { Toaster } from '@/components/ui/sonner'
|
||||
import NavBar from './components/layout/NavBar.vue';
|
||||
import { useAuthStore } from './stores/auth';
|
||||
import { useSocketStore } from './stores/socket';
|
||||
import NavBar from './components/layout/NavBar.vue'
|
||||
import { useAuthStore } from './stores/auth'
|
||||
import { useSocketStore } from './stores/socket'
|
||||
|
||||
const authStore = useAuthStore()
|
||||
const socketStore = useSocketStore()
|
||||
|
||||
|
||||
const year = new Date().getFullYear()
|
||||
const pageTitle = ref(`DAD ${year}/${String(year + 1).slice(-2)}`)
|
||||
|
||||
|
||||
|
||||
const logout = () => {
|
||||
|
||||
toast.promise(authStore.logout(), {
|
||||
loading: 'Calling API',
|
||||
success: () => {
|
||||
@@ -44,14 +40,12 @@ const logout = () => {
|
||||
},
|
||||
error: (data) => `[API] Error saving game - ${data?.response?.data?.message}`,
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
socketStore.handleConnection()
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style></style>`
|
||||
<style></style>
|
||||
`
|
||||
|
||||
Reference in New Issue
Block a user