mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
refactor toolbutton.tsx - add default props (#1492)
This commit is contained in:
parent
4369d88898
commit
0c2aa951d6
1 changed files with 7 additions and 2 deletions
|
@ -49,8 +49,8 @@ export const ToolButton = React.forwardRef(function (
|
|||
<button
|
||||
className={`ToolIcon_type_button ToolIcon ${sizeCn}${
|
||||
props.selected ? " ToolIcon--selected" : ""
|
||||
} ${props.className || ""} ${
|
||||
props.visible || props.visible == null
|
||||
} ${props.className} ${
|
||||
props.visible
|
||||
? "ToolIcon_type_button--show"
|
||||
: "ToolIcon_type_button--hide"
|
||||
}`}
|
||||
|
@ -94,3 +94,8 @@ export const ToolButton = React.forwardRef(function (
|
|||
</label>
|
||||
);
|
||||
});
|
||||
|
||||
ToolButton.defaultProps = {
|
||||
visible: true,
|
||||
className: "",
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue