Skip to content

Commit

Permalink
Merge pull request #13670 from ethereum/master
Browse files Browse the repository at this point in the history
`master` to `dev`
  • Loading branch information
wackerow authored Aug 16, 2024
2 parents a6c9086 + 06614fb commit 79d2f71
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/components/AdoptionChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ const ColumnName = ({ children }: ChildOnlyProp) => (

const AdoptionChart = () => {
const { t } = useTranslation("page-what-is-ethereum")
const { theme } = useTheme()
const isDark = theme === "dark"
const { resolvedTheme } = useTheme()
const isDark = resolvedTheme === "dark"

return (
<Flex>
Expand Down
6 changes: 3 additions & 3 deletions src/components/Nav/useNav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import useColorModeValue from "@/hooks/useColorModeValue"

export const useNav = () => {
const { t } = useTranslation("common")
const { theme, setTheme } = useTheme()
const { resolvedTheme, setTheme } = useTheme()
const { setColorMode } = useColorMode()

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

const toggleColorMode = () => {
setTheme(theme === "dark" ? "light" : "dark")
setColorMode(theme === "dark" ? "light" : "dark")
setTheme(resolvedTheme === "dark" ? "light" : "dark")
setColorMode(resolvedTheme === "dark" ? "light" : "dark")
trackCustomEvent({
eventCategory: "nav bar",
eventAction: "click",
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useColorModeValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ function useColorModeValue<TLight = unknown, TDark = unknown>(
light: TLight,
dark: TDark
) {
const { theme } = useTheme()
const { resolvedTheme } = useTheme()

return theme === "light" ? light : dark
return resolvedTheme === "light" ? light : dark
}

export default useColorModeValue
4 changes: 2 additions & 2 deletions src/hooks/useNavMenuColorsTw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ type NavMenuColors = {
* TODO: rename to useNavMenuColors when the desktop menu is migrated.
*/
export const useNavMenuColorsTw = (): NavMenuColors => {
const { theme } = useTheme()
const isLight = theme === "light"
const { resolvedTheme } = useTheme()
const isLight = resolvedTheme === "light"

return {
body: "text-body",
Expand Down

0 comments on commit 79d2f71

Please sign in to comment.