refactor toolbutton.tsx - add default props (#1492)
This commit is contained in:
parent
4369d88898
commit
0c2aa951d6
@ -49,8 +49,8 @@ export const ToolButton = React.forwardRef(function (
|
|||||||
<button
|
<button
|
||||||
className={`ToolIcon_type_button ToolIcon ${sizeCn}${
|
className={`ToolIcon_type_button ToolIcon ${sizeCn}${
|
||||||
props.selected ? " ToolIcon--selected" : ""
|
props.selected ? " ToolIcon--selected" : ""
|
||||||
} ${props.className || ""} ${
|
} ${props.className} ${
|
||||||
props.visible || props.visible == null
|
props.visible
|
||||||
? "ToolIcon_type_button--show"
|
? "ToolIcon_type_button--show"
|
||||||
: "ToolIcon_type_button--hide"
|
: "ToolIcon_type_button--hide"
|
||||||
}`}
|
}`}
|
||||||
@ -94,3 +94,8 @@ export const ToolButton = React.forwardRef(function (
|
|||||||
</label>
|
</label>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
ToolButton.defaultProps = {
|
||||||
|
visible: true,
|
||||||
|
className: "",
|
||||||
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user