FitTrackee/fittrackee_client/src/views/DashBoard.vue

63 lines
1.6 KiB
Vue
Raw Normal View History

2021-07-25 13:34:44 +02:00
<template>
2021-08-08 11:49:01 +02:00
<div id="dashboard">
2021-08-18 17:10:16 +02:00
<div class="container">
<UserStats :user="authUser" v-if="authUser.username" />
</div>
<div class="container">
<div class="left-container dashboard-container">
<UserMonthStats :user="authUser" />
<UserRecords />
</div>
<div class="right-container dashboard-container">
<UserCalendar />
<Timeline />
</div>
</div>
2021-07-25 13:34:44 +02:00
</div>
</template>
2021-08-18 17:10:16 +02:00
<script lang="ts">
import { computed, ComputedRef, defineComponent } from 'vue'
import Timeline from '@/components/Dashboard/Timeline.vue'
import UserCalendar from '@/components/Dashboard/UserCalendar.vue'
import UserMonthStats from '@/components/Dashboard/UserMonthStats.vue'
import UserRecords from '@/components/Dashboard/UserRecords.vue'
import UserStats from '@/components/Dashboard/UserStats.vue'
2021-08-18 17:10:16 +02:00
import { USER_STORE } from '@/store/constants'
2021-08-21 18:36:44 +02:00
import { IAuthUserProfile } from '@/types/user'
2021-08-18 17:10:16 +02:00
import { useStore } from '@/use/useStore'
export default defineComponent({
name: 'Dashboard',
components: {
Timeline,
UserCalendar,
UserMonthStats,
UserRecords,
2021-08-18 17:10:16 +02:00
UserStats,
},
setup() {
const store = useStore()
const authUser: ComputedRef<IAuthUserProfile> = computed(
() => store.getters[USER_STORE.GETTERS.AUTH_USER_PROFILE]
)
return { authUser }
},
})
</script>
<style lang="scss">
@import '~@/scss/base';
.dashboard-container {
display: flex;
flex-direction: column;
}
.left-container {
width: 35%;
}
.right-container {
width: 65%;
}
</style>