Skip to content

Commit 06614fb

Browse files
authored
Merge pull request #13663 from ethereum/hotfix-resolved-theme
Hotfix color theme
2 parents 4a42c02 + d89d1fd commit 06614fb

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/components/AdoptionChart.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ const ColumnName = ({ children }: ChildOnlyProp) => (
4949

5050
const AdoptionChart = () => {
5151
const { t } = useTranslation("page-what-is-ethereum")
52-
const { theme } = useTheme()
53-
const isDark = theme === "dark"
52+
const { resolvedTheme } = useTheme()
53+
const isDark = resolvedTheme === "dark"
5454

5555
return (
5656
<Flex>

src/components/Nav/useNav.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import useColorModeValue from "@/hooks/useColorModeValue"
3030

3131
export const useNav = () => {
3232
const { t } = useTranslation("common")
33-
const { theme, setTheme } = useTheme()
33+
const { resolvedTheme, setTheme } = useTheme()
3434
const { setColorMode } = useColorMode()
3535

3636
const colorToggleEvent = useColorModeValue("dark mode", "light mode") // This will be inverted as the state is changing
@@ -466,8 +466,8 @@ export const useNav = () => {
466466
}
467467

468468
const toggleColorMode = () => {
469-
setTheme(theme === "dark" ? "light" : "dark")
470-
setColorMode(theme === "dark" ? "light" : "dark")
469+
setTheme(resolvedTheme === "dark" ? "light" : "dark")
470+
setColorMode(resolvedTheme === "dark" ? "light" : "dark")
471471
trackCustomEvent({
472472
eventCategory: "nav bar",
473473
eventAction: "click",

src/hooks/useColorModeValue.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ function useColorModeValue<TLight = unknown, TDark = unknown>(
1313
light: TLight,
1414
dark: TDark
1515
) {
16-
const { theme } = useTheme()
16+
const { resolvedTheme } = useTheme()
1717

18-
return theme === "light" ? light : dark
18+
return resolvedTheme === "light" ? light : dark
1919
}
2020

2121
export default useColorModeValue

src/hooks/useNavMenuColorsTw.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ type NavMenuColors = {
2323
* TODO: rename to useNavMenuColors when the desktop menu is migrated.
2424
*/
2525
export const useNavMenuColorsTw = (): NavMenuColors => {
26-
const { theme } = useTheme()
27-
const isLight = theme === "light"
26+
const { resolvedTheme } = useTheme()
27+
const isLight = resolvedTheme === "light"
2828

2929
return {
3030
body: "text-body",

0 commit comments

Comments
 (0)