mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-01 11:59:14 -04:00
refactor(ui): getting ride of naive ui buttons
This commit is contained in:
parent
df989e24b3
commit
c45bce36f9
44 changed files with 738 additions and 204 deletions
20
src/ui/theme/theme.store.ts
Normal file
20
src/ui/theme/theme.store.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
import { defineStore } from 'pinia';
|
||||
|
||||
export const useThemeStore = defineStore('ui-theme', {
|
||||
state: () => ({
|
||||
themeType: useStorage<'dark' | 'light'>('ui-store:theme-type', 'dark') as Ref<'dark' | 'light'>,
|
||||
}),
|
||||
getters: {
|
||||
isDarkTheme(): boolean {
|
||||
return this.themeType === 'dark';
|
||||
},
|
||||
isLightTheme(): boolean {
|
||||
return this.themeType === 'light';
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
toggleTheme() {
|
||||
this.themeType = this.isDarkTheme ? 'light' : 'dark';
|
||||
},
|
||||
},
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue