File tree Expand file tree Collapse file tree 2 files changed +2
-26
lines changed Expand file tree Collapse file tree 2 files changed +2
-26
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ import {
18
18
BsUiChecksGrid ,
19
19
} from "react-icons/bs"
20
20
import { PiFlask , PiUsersFourLight } from "react-icons/pi"
21
- import { useColorMode } from "@chakra-ui/react"
22
21
23
22
import EthereumIcon from "@/components/icons/ethereum-icon.svg"
24
23
@@ -29,8 +28,6 @@ import type { NavSections } from "./types"
29
28
export const useNav = ( ) => {
30
29
const { t } = useTranslation ( "common" )
31
30
const { setTheme, resolvedTheme } = useTheme ( )
32
- // TODO Remove when removing chakra provider
33
- const { setColorMode } = useColorMode ( )
34
31
35
32
const linkSections : NavSections = {
36
33
learn : {
@@ -476,7 +473,7 @@ export const useNav = () => {
476
473
const targetTheme = resolvedTheme === "dark" ? "light" : "dark"
477
474
478
475
setTheme ( targetTheme )
479
- setColorMode ( targetTheme )
476
+ // setColorMode(targetTheme)
480
477
481
478
trackCustomEvent ( {
482
479
eventCategory : "nav bar" ,
Original file line number Diff line number Diff line change 1
- import { useMemo } from "react"
2
- import merge from "lodash/merge"
3
1
import { ThemeProvider as NextThemesProvider } from "next-themes"
4
2
import type { ThemeProviderProps } from "next-themes/dist/types"
5
- import { ChakraBaseProvider , createLocalStorageManager } from "@chakra-ui/react"
6
-
7
- import customTheme from "@/@chakra-ui/theme"
8
3
9
4
import { COLOR_MODE_STORAGE_KEY } from "@/lib/constants"
10
5
11
- import { useLocaleDirection } from "@/hooks/useLocaleDirection"
12
-
13
- const colorModeManager = createLocalStorageManager ( COLOR_MODE_STORAGE_KEY )
14
-
15
6
/**
16
7
* Primary theming wrapper for use with color mode. Uses the theme provider
17
8
* from `next-themes`.
18
9
*
19
10
* Applied to _app.tsx as the main provider for the project, and supplied as the
20
11
* primary decorator to Storybook.
21
- *
22
- * NOTE: This also includes the Chakra Provider. This will be removed after migration to ShadCN/Tailwind is complete
23
12
*/
24
13
const ThemeProvider = ( { children } : Pick < ThemeProviderProps , "children" > ) => {
25
- const direction = useLocaleDirection ( )
26
-
27
- const theme = useMemo ( ( ) => merge ( customTheme , { direction } ) , [ direction ] )
28
14
return (
29
15
< NextThemesProvider
30
16
attribute = "data-theme"
31
17
defaultTheme = "light"
32
- enableSystem = { false }
33
18
disableTransitionOnChange
34
19
storageKey = { COLOR_MODE_STORAGE_KEY }
35
20
>
36
- < ChakraBaseProvider
37
- theme = { theme }
38
- colorModeManager = { colorModeManager }
39
- resetCSS = { false }
40
- >
41
- { children }
42
- </ ChakraBaseProvider >
21
+ { children }
43
22
</ NextThemesProvider >
44
23
)
45
24
}
You can’t perform that action at this time.
0 commit comments