mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 14:17:13 +01:00
Updated reports components.
This commit is contained in:
parent
f5bc3dc6c2
commit
0f6cdf8b80
95 changed files with 580 additions and 698 deletions
|
|
@ -41,6 +41,7 @@ export * from './useMessages';
|
|||
export * from './useModified';
|
||||
export * from './usePagedQuery';
|
||||
export * from './useRegionNames';
|
||||
export * from './useReport';
|
||||
export * from './useSticky';
|
||||
export * from './useNavigation';
|
||||
export * from './useTheme';
|
||||
|
|
|
|||
6
src/components/hooks/useReport.ts
Normal file
6
src/components/hooks/useReport.ts
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import { useContext } from 'react';
|
||||
import { ReportContext } from '@/app/(main)/reports/[reportId]/Report';
|
||||
|
||||
export function useReport() {
|
||||
return useContext(ReportContext);
|
||||
}
|
||||
|
|
@ -8,6 +8,7 @@ const selector = (state: { theme: string }) => state.theme;
|
|||
|
||||
export function useTheme() {
|
||||
const theme = useApp(selector) || getItem(THEME_CONFIG) || DEFAULT_THEME;
|
||||
const { primary, text, line, fill } = THEME_COLORS[theme];
|
||||
const primaryColor = colord(THEME_COLORS[theme].primary);
|
||||
|
||||
const colors = useMemo(() => {
|
||||
|
|
@ -16,8 +17,8 @@ export function useTheme() {
|
|||
...THEME_COLORS[theme],
|
||||
},
|
||||
chart: {
|
||||
text: THEME_COLORS[theme].gray700,
|
||||
line: THEME_COLORS[theme].gray200,
|
||||
text,
|
||||
line,
|
||||
views: {
|
||||
hoverBackgroundColor: primaryColor.alpha(0.7).toRgbString(),
|
||||
backgroundColor: primaryColor.alpha(0.4).toRgbString(),
|
||||
|
|
@ -32,10 +33,10 @@ export function useTheme() {
|
|||
},
|
||||
},
|
||||
map: {
|
||||
baseColor: THEME_COLORS[theme].primary,
|
||||
fillColor: THEME_COLORS[theme].gray100,
|
||||
strokeColor: THEME_COLORS[theme].primary,
|
||||
hoverColor: THEME_COLORS[theme].primary,
|
||||
baseColor: primary,
|
||||
fillColor: fill,
|
||||
strokeColor: primary,
|
||||
hoverColor: primary,
|
||||
},
|
||||
};
|
||||
}, [theme]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue