Skip to content

Commit e97b1c9

Browse files
authored
refactor: remove redundant CardSection theme state (#2381)
1 parent 3a231de commit e97b1c9

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/components/CardSection.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import clsx from 'clsx'
2-
import { CSSProperties, JSX, useState, useEffect } from 'react'
2+
import { CSSProperties, JSX } from 'react'
33
import { useColorMode } from '@docusaurus/theme-common'
44
import Card, { CardItem } from '@site/src/components/Card'
55

@@ -19,11 +19,7 @@ export default function CardSection({
1919
colorPalette,
2020
}: CardSectionProps): JSX.Element {
2121
const { colorMode } = useColorMode()
22-
const [theme, setTheme] = useState('')
23-
24-
useEffect(() => {
25-
setTheme(colorMode)
26-
}, [colorMode])
22+
const theme = colorMode
2723

2824
return (
2925
<section className={styles.wrapper}>

0 commit comments

Comments
 (0)