mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 22:27:16 +01:00
Refactor: removed default exports.
This commit is contained in:
parent
cd944e14ce
commit
f83a12d6cd
343 changed files with 555 additions and 1046 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { useEffect, useMemo } from 'react';
|
||||
import useStore, { setTheme } from '@/store/app';
|
||||
import { useApp, setTheme } from '@/store/app';
|
||||
import { getItem, setItem } from '@/lib/storage';
|
||||
import { DEFAULT_THEME, THEME_COLORS, THEME_CONFIG } from '@/lib/constants';
|
||||
import { colord } from 'colord';
|
||||
|
|
@ -7,7 +7,7 @@ import { colord } from 'colord';
|
|||
const selector = (state: { theme: string }) => state.theme;
|
||||
|
||||
export function useTheme() {
|
||||
const theme = useStore(selector) || getItem(THEME_CONFIG) || DEFAULT_THEME;
|
||||
const theme = useApp(selector) || getItem(THEME_CONFIG) || DEFAULT_THEME;
|
||||
const primaryColor = colord(THEME_COLORS[theme].primary);
|
||||
|
||||
const colors = useMemo(() => {
|
||||
|
|
@ -60,5 +60,3 @@ export function useTheme() {
|
|||
|
||||
return { theme, saveTheme, colors };
|
||||
}
|
||||
|
||||
export default useTheme;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue