Add shape fill option to drawings

This commit is contained in:
Mitchell McCaffrey
2021-08-06 10:12:30 +10:00
parent cbaf23cd09
commit 27bcc127bc
9 changed files with 84 additions and 8 deletions

View File

@@ -0,0 +1,28 @@
import { IconButton } from "theme-ui";
import ShapeFillOnIcon from "../../../icons/ShapeFillOnIcon";
import ShapeFillOffIcon from "../../../icons/ShapeFillOffIcon";
type ShapeFillToggleProps = {
useShapeFill: boolean;
onShapeFillChange: (useShapeFill: boolean) => void;
};
function ShapeFillToggle({
useShapeFill,
onShapeFillChange,
}: ShapeFillToggleProps) {
return (
<IconButton
aria-label={
useShapeFill ? "Disable Shape Fill (G)" : "Enable Shape Fill (G)"
}
title={useShapeFill ? "Disable Shape Fill (G)" : "Enable Shape Fill (G)"}
onClick={() => onShapeFillChange(!useShapeFill)}
>
{useShapeFill ? <ShapeFillOnIcon /> : <ShapeFillOffIcon />}
</IconButton>
);
}
export default ShapeFillToggle;