docs(colors): update colors when themes change

This commit is contained in:
unix
2020-04-05 04:41:52 +08:00
parent 0eae2db958
commit 5072d38a8e
2 changed files with 6 additions and 3 deletions

View File

@@ -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

View File

@@ -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">