Added automatic setting change for drawing when erased all
This commit is contained in:
parent
0bec582116
commit
aebc0f9267
@ -1,4 +1,4 @@
|
||||
import React from "react";
|
||||
import React, { useEffect } from "react";
|
||||
import { Flex, IconButton } from "theme-ui";
|
||||
|
||||
import ColorControl from "./ColorControl";
|
||||
@ -24,6 +24,13 @@ function DrawingToolSettings({
|
||||
onToolAction,
|
||||
disabledActions,
|
||||
}) {
|
||||
// Change to brush if on erase and it gets disabled
|
||||
useEffect(() => {
|
||||
if (settings.type === "erase" && disabledActions.includes("erase")) {
|
||||
onSettingChange({ type: "brush" });
|
||||
}
|
||||
}, [disabledActions, settings, onSettingChange]);
|
||||
|
||||
return (
|
||||
<Flex sx={{ alignItems: "center" }}>
|
||||
<ColorControl
|
||||
|
Loading…
Reference in New Issue
Block a user