mirror of
https://github.com/zhigang1992/react.git
synced 2026-05-20 04:11:29 +08:00
docs(colors): update colors when themes change
This commit is contained in:
@@ -64,8 +64,8 @@ export const getCurrentColor = (palette: ZeitUIThemesPalette, type: string, inde
|
||||
}
|
||||
|
||||
if (type === 'highlight') {
|
||||
if (index < 3) return palette.background
|
||||
return palette.foreground
|
||||
if (index < 3) return 'white'
|
||||
return 'black'
|
||||
}
|
||||
|
||||
return palette.background
|
||||
|
||||
@@ -39,7 +39,10 @@ const Colors: React.FC<Props> = ({
|
||||
copy(text)
|
||||
setToast(({ text: <span>Copied <Code>{text}</Code></span> }))
|
||||
}
|
||||
const colorItems = useMemo(() => getColorItem(type, theme.palette, copyText), [])
|
||||
const colorItems = useMemo(
|
||||
() => getColorItem(type, theme.palette, copyText),
|
||||
[type, theme.palette],
|
||||
)
|
||||
|
||||
return (
|
||||
<div className="colors">
|
||||
|
||||
Reference in New Issue
Block a user