Fix limit reached alert position (#3297)
* fix: limit reached alert * fix: icon background
This commit is contained in:
parent
75a6edd864
commit
c7eb4f0622
2 changed files with 22 additions and 15 deletions
|
@ -1,22 +1,25 @@
|
||||||
import { Alert, AlertProps, makeStyles } from "@saleor/macaw-ui";
|
import { Alert, AlertProps } from "@saleor/macaw-ui";
|
||||||
|
import { sprinkles } from "@saleor/macaw-ui/next";
|
||||||
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
const useStyles = makeStyles(
|
|
||||||
theme => ({
|
|
||||||
root: {
|
|
||||||
marginBottom: theme.spacing(3),
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
{ name: "LimitReachedAlert" },
|
|
||||||
);
|
|
||||||
|
|
||||||
export type LimitReachedAlertProps = Omit<AlertProps, "variant" | "close">;
|
export type LimitReachedAlertProps = Omit<AlertProps, "variant" | "close">;
|
||||||
|
|
||||||
const LimitReachedAlert: React.FC<LimitReachedAlertProps> = props => {
|
const LimitReachedAlert: React.FC<LimitReachedAlertProps> = props => (
|
||||||
const classes = useStyles();
|
// TODO: migrate to new macaw-ui alert
|
||||||
|
<Alert
|
||||||
return <Alert variant="warning" close className={classes.root} {...props} />;
|
variant="warning"
|
||||||
};
|
close
|
||||||
|
className={clsx(
|
||||||
|
sprinkles({
|
||||||
|
gridColumn: "8",
|
||||||
|
marginBottom: 5,
|
||||||
|
}),
|
||||||
|
"remove-icon-background",
|
||||||
|
)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
|
||||||
LimitReachedAlert.displayName = "LimitReachedAlert";
|
LimitReachedAlert.displayName = "LimitReachedAlert";
|
||||||
export default LimitReachedAlert;
|
export default LimitReachedAlert;
|
||||||
|
|
|
@ -36,3 +36,7 @@ body {
|
||||||
animation: pulse 0.2s;
|
animation: pulse 0.2s;
|
||||||
transition: all 0.2s;
|
transition: all 0.2s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.remove-icon-background svg {
|
||||||
|
background: none !important;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue