fix(website): make ColorGenerator functional (#6344)

This commit is contained in:
Shun Wakatsuki 2022-01-14 22:24:09 +09:00 committed by GitHub
parent 99dbf1a121
commit f1fd346925
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -97,7 +97,7 @@ function ColorGenerator(): JSX.Element {
const colorValue = event.target.value.replace(/^#+/, '');
try {
Color(`#${baseColor}`);
Color(`#${colorValue}`);
setBaseColor(colorValue);
} catch {
// Don't update for invalid colors.