Skip to content

Commit

Permalink
Remove color picker on tool bar
Browse files Browse the repository at this point in the history
  • Loading branch information
low-earth-orbit committed Oct 21, 2024
1 parent 4bc79c3 commit 653a561
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 49 deletions.
2 changes: 1 addition & 1 deletion components/Canvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ export default function Canvas() {
id: uuid(),
type: selectedTool === "eraser" ? "eraserStroke" : "ink",
points: [pos.x, pos.y],
stroke: selectedTool === "eraser" ? undefined : inkColor,
stroke: selectedTool === "eraser" ? inkColor : inkColor,
strokeWidth: selectedTool === "eraser" ? eraserSize : inkWidth,
};
setNewObject(newLine);
Expand Down
48 changes: 0 additions & 48 deletions components/toolbar/Toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,6 @@ function Toolbar({ objects, onDelete, isDarkMode }: ToolbarProps) {

const toolbarBgColor = isDarkMode ? "bg-gray-500" : "bg-white";

// color picker
const [colorPickerAnchorEl, setColorPickerAnchorEl] =
useState<HTMLButtonElement | null>(null);

const isColorPickerAnchorElOpen = Boolean(colorPickerAnchorEl);

const handleClickColorPickerButton = (
event: React.MouseEvent<HTMLButtonElement>,
) => {
setColorPickerAnchorEl(event.currentTarget);
};

const handleCloseColorPicker = () => {
setColorPickerAnchorEl(null);
};

// shapes popover
const [shapesAnchorEl, setShapesAnchorEl] =
useState<HTMLButtonElement | null>(null);
Expand Down Expand Up @@ -176,16 +160,6 @@ function Toolbar({ objects, onDelete, isDarkMode }: ToolbarProps) {
</IconButton>
</Tooltip>

{/* color picker */}
<Tooltip title="Color">
<IconButton
aria-label="open color palette"
onClick={handleClickColorPickerButton}
>
<Palette />
</IconButton>
</Tooltip>

{/* eraser */}
<Tooltip title="Eraser">
<IconButton
Expand Down Expand Up @@ -240,28 +214,6 @@ function Toolbar({ objects, onDelete, isDarkMode }: ToolbarProps) {
</Tooltip>
</ButtonGroup>

{/* colorPickerPopover */}
{/* <Popover
id="colorPickerPopover"
open={isColorPickerAnchorElOpen}
anchorEl={colorPickerAnchorEl}
onClose={handleCloseColorPicker}
anchorOrigin={{
vertical: "top",
horizontal: "center",
}}
transformOrigin={{
vertical: "bottom",
horizontal: "center",
}}
>
<HexColorPicker
className="p-2"
color={color}
onChange={onSelectColor}
/>
</Popover> */}

{/* lineWeightPopover */}
{/* <Popover
id="lineWeightPopover"
Expand Down

0 comments on commit 653a561

Please sign in to comment.