mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 12:11:08 -04:00
Compare commits
3 Commits
dark-cust-
...
dark-view-
| Author | SHA1 | Date | |
|---|---|---|---|
| 5ce6844028 | |||
| c541114992 | |||
| db89a93faa |
@ -1,50 +0,0 @@
|
|||||||
<template>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
class="
|
|
||||||
flex
|
|
||||||
h-8
|
|
||||||
w-8
|
|
||||||
items-center
|
|
||||||
justify-center
|
|
||||||
rounded-md
|
|
||||||
transition
|
|
||||||
hover:bg-zinc-900/5
|
|
||||||
dark:hover:bg-white/5
|
|
||||||
"
|
|
||||||
@click="onChange"
|
|
||||||
>
|
|
||||||
<BaseIcon v-if="!globalStore.isDarkModeOn" class="h-5 w-5 text-black" name="SunIcon" />
|
|
||||||
<BaseIcon v-else class="h-5 w-5 text-white" name="MoonIcon" />
|
|
||||||
</button>
|
|
||||||
</template>
|
|
||||||
<script setup>
|
|
||||||
import { computed } from 'vue'
|
|
||||||
import { useGlobalStore } from '@/scripts/customer/stores/global'
|
|
||||||
|
|
||||||
const globalStore = useGlobalStore()
|
|
||||||
|
|
||||||
const enabled = computed(
|
|
||||||
()=>
|
|
||||||
localStorage.getItem('theme') === 'dark' ||
|
|
||||||
document.documentElement.classList.contains('dark')
|
|
||||||
)
|
|
||||||
|
|
||||||
globalStore.isDarkModeOn = enabled.value
|
|
||||||
|
|
||||||
function onChange() {
|
|
||||||
globalStore.isDarkModeOn = !globalStore.isDarkModeOn
|
|
||||||
|
|
||||||
if (globalStore.isDarkModeOn) {
|
|
||||||
localStorage.theme = 'dark'
|
|
||||||
document.documentElement.classList.add('dark')
|
|
||||||
document.documentElement.style.setProperty('color-scheme', 'dark')
|
|
||||||
} else {
|
|
||||||
localStorage.theme = 'light'
|
|
||||||
document.documentElement.classList.remove('dark')
|
|
||||||
document.documentElement.style.setProperty('color-scheme', 'light')
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
@ -44,8 +44,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="hidden sm:ml-6 sm:flex sm:items-center">
|
<div class="hidden sm:ml-6 sm:flex sm:items-center">
|
||||||
<!-- Dark mode Toggle -->
|
|
||||||
<CustomerLightDarkButton/>
|
|
||||||
|
|
||||||
<!-- Profile dropdown -->
|
<!-- Profile dropdown -->
|
||||||
|
|
||||||
@ -136,7 +134,6 @@
|
|||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
<div class="pt-4 pb-3 border-t border-gray-200 dark:border-gray-500">
|
<div class="pt-4 pb-3 border-t border-gray-200 dark:border-gray-500">
|
||||||
<div class="flex items-center justify-between pr-5">
|
|
||||||
<div class="flex items-center px-4">
|
<div class="flex items-center px-4">
|
||||||
<div class="shrink-0">
|
<div class="shrink-0">
|
||||||
<img class="h-10 w-10 rounded-full" :src="previewAvatar" alt="" />
|
<img class="h-10 w-10 rounded-full" :src="previewAvatar" alt="" />
|
||||||
@ -149,9 +146,6 @@
|
|||||||
{{ globalStore.currentUser.email }}
|
{{ globalStore.currentUser.email }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<!-- Dark mode Toggle -->
|
|
||||||
<CustomerLightDarkButton/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-3 space-y-1">
|
<div class="mt-3 space-y-1">
|
||||||
<router-link
|
<router-link
|
||||||
@ -178,7 +172,6 @@ import { useRoute, useRouter } from 'vue-router'
|
|||||||
import { ref, watch, computed } from 'vue'
|
import { ref, watch, computed } from 'vue'
|
||||||
import { useGlobalStore } from '@/scripts/customer/stores/global'
|
import { useGlobalStore } from '@/scripts/customer/stores/global'
|
||||||
import MainLogo from '@/scripts/components/icons/MainLogo.vue'
|
import MainLogo from '@/scripts/components/icons/MainLogo.vue'
|
||||||
import CustomerLightDarkButton from '@/scripts/components/CustomerLightDarkButton.vue'
|
|
||||||
import {
|
import {
|
||||||
Disclosure,
|
Disclosure,
|
||||||
DisclosureButton,
|
DisclosureButton,
|
||||||
|
|||||||
@ -13,8 +13,7 @@ export const useGlobalStore = defineStore({
|
|||||||
currentUser: null,
|
currentUser: null,
|
||||||
companySlug: '',
|
companySlug: '',
|
||||||
mainMenu: null,
|
mainMenu: null,
|
||||||
enabledModules: [],
|
enabledModules: []
|
||||||
isDarkModeOn: false
|
|
||||||
}),
|
}),
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|||||||
Reference in New Issue
Block a user