-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathAppToolbar.vue
92 lines (81 loc) · 2.06 KB
/
AppToolbar.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<script setup lang="ts">
import { ref, watch } from "vue";
import SlideToggle from "@/components/SlideToggle.vue";
import SkoreLogo from "@/components/icons/SkoreLogo.vue";
import { useThemesStore } from "@/stores/themes";
const themesStore = useThemesStore();
const isDarkModeForced = ref(themesStore.currentTheme === "dark");
watch(isDarkModeForced, (forceDarkMode) => {
themesStore.setTheme(forceDarkMode ? "dark" : "light");
});
watch(
() => themesStore.currentTheme,
() => {
isDarkModeForced.value = themesStore.currentTheme === "dark";
}
);
</script>
<template>
<div class="app-toolbar">
<div class="logo">
<SkoreLogo />
</div>
<nav>
<slot></slot>
</nav>
<div class="tools">
<div class="dark-light">
<i class="icon icon-sun" />
<SlideToggle v-model:is-toggled="isDarkModeForced" />
<i class="icon icon-moon" />
</div>
</div>
</div>
</template>
<style scoped>
.app-toolbar {
display: flex;
min-width: var(--width-toolbar);
height: 100dvh;
flex-direction: column;
border-right: solid var(--stroke-width-md) var(--color-stroke-background-primary);
background-color: var(--color-background-secondary);
& .logo {
display: flex;
height: var(--height-header);
align-items: center;
justify-content: center;
border-bottom: solid var(--stroke-width-md) var(--color-stroke-background-primary);
& svg {
width: calc(var(--width-toolbar) * 0.8);
}
}
& nav {
display: flex;
flex: 1;
flex-direction: column;
align-items: center;
padding: var(--spacing-12) 0;
gap: var(--spacing-10);
}
& .tools {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: var(--spacing-8) 0;
gap: var(--spacing-8);
& .dark-light {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
gap: var(--spacing-4);
& .icon {
color: var(--color-text-primary);
font-size: var(--font-size-xs);
}
}
}
}
</style>