/
theme.tsx
31 lines (29 loc) · 897 Bytes
/
theme.tsx
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
import { useMemo } from 'react'
import { Theme } from '@nivo/core'
import { useTheme } from '../../../theming/context'
export const useAxisTheme = (): Theme => {
const theme = useTheme()
const nivoTheme: Theme = useMemo(() => {
return {
...theme.nivo,
axis: {
...theme.nivo.axis,
domain: {
...theme.nivo.axis!.domain,
line: {
...theme.nivo.axis!.domain!.line,
strokeWidth: 1,
},
},
legend: {
...theme.nivo.axis!.legend,
text: {
...theme.nivo.axis!.legend!.text,
fill: theme.colors.accent,
},
},
},
}
}, [theme])
return nivoTheme
}