Add type to controls and change colour types

This commit is contained in:
Mitchell McCaffrey
2021-07-09 22:06:32 +10:00
parent 72b6994a2e
commit 49b8caa2d7
21 changed files with 238 additions and 148 deletions

View File

@@ -0,0 +1,27 @@
import { Flex } from "theme-ui";
import ColorControl from "./ColorControl";
import { PointerToolSettings } from "../../../types/Pointer";
type PointerToolSettingsProps = {
settings: PointerToolSettings;
onSettingChange: (change: Partial<PointerToolSettings>) => void;
};
function PointerToolSettings({
settings,
onSettingChange,
}: PointerToolSettingsProps) {
return (
<Flex sx={{ alignItems: "center" }}>
<ColorControl
color={settings.color}
onColorChange={(color) => onSettingChange({ color })}
exclude={["black", "darkGray", "lightGray", "white"]}
/>
</Flex>
);
}
export default PointerToolSettings;