Skip to content

Commit 72b7f8d

Browse files
refactor(upgrade-status): implement useColorModeValue
1 parent 50f4abf commit 72b7f8d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/UpgradeStatus.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react"
22
import { TranslationKey } from "../utils/translations"
33
import Translation from "./Translation"
4-
import { Heading, Text, useColorMode, VStack } from "@chakra-ui/react"
4+
import { Heading, Text, useColorModeValue, VStack } from "@chakra-ui/react"
55

66
export interface IStyledContainer {
77
isShipped: boolean
@@ -18,10 +18,10 @@ const UpgradeStatus: React.FC<IProps> = ({
1818
children,
1919
isShipped = false,
2020
}) => {
21-
const { colorMode } = useColorMode()
22-
const border = colorMode === "dark" ? "2px solid" : "none"
21+
const border = useColorModeValue("none", "2px solid")
2322
const darkBorderColor = isShipped ? "#3fb181" : "#a4a4ff"
24-
const borderColor = colorMode === "dark" ? darkBorderColor : undefined
23+
24+
const borderColor = useColorModeValue(undefined, darkBorderColor)
2525

2626
return (
2727
<VStack

0 commit comments

Comments
 (0)