Web: Components: added show icon props

This commit is contained in:
Viktor Fomin 2021-07-20 13:07:50 +03:00
parent 514aadfc13
commit 0127a555c8
2 changed files with 10 additions and 3 deletions

View File

@ -13,6 +13,7 @@ const SnackBar = ({
btnText,
onAction,
textColor,
showIcon,
...rest
}) => {
const onActionClick = useCallback(
@ -27,9 +28,11 @@ const SnackBar = ({
console.log("Snackbar render");
return (
<StyledSnackBar {...rest}>
<Box className="logo">
<StyledLogoIcon size="medium" color={textColor} />
</Box>
{showIcon && (
<Box className="logo">
<StyledLogoIcon size="medium" color={textColor} />
</Box>
)}
<Box className="text-container">
<Heading
size="xsmall"
@ -60,12 +63,14 @@ SnackBar.propTypes = {
backgroundImg: PropType.string,
backgroundColor: PropType.string,
textColor: PropType.string,
showIcon: PropType.bool,
onAction: PropType.func,
};
SnackBar.defaultProps = {
backgroundColor: "#f8f7bf",
textColor: "#000",
showIcon: true,
};
export default SnackBar;

View File

@ -18,6 +18,7 @@ export default {
},
textColor: { control: "color" },
backgroundColor: { control: "color" },
showIcon: { control: "boolean" },
},
};
@ -42,4 +43,5 @@ base.args = {
headerText: "Attention",
text:
"We apologize for any short-term technical issues in service functioning, that may appear on 22.06.2021 during the update of Onlyoffice Personal.",
showIcon: true,
};