aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-10-08 20:21:10 +0300
committereug-vs <eug-vs@keemail.me>2020-10-08 20:21:10 +0300
commit40cc9f63feb15e1bb14c5360b4437d3379df96e2 (patch)
tree47ae895798a6f69061224567d04995d40b291ba4 /src/components
parent33b3066b04f7560455c113a18fe39d33933daaf1 (diff)
downloadwhich-ui-40cc9f63feb15e1bb14c5360b4437d3379df96e2.tar.gz
feat: add noMargin prop to Message
Diffstat (limited to 'src/components')
-rw-r--r--src/components/Message/Message.tsx9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/components/Message/Message.tsx b/src/components/Message/Message.tsx
index f568552..e5191ed 100644
--- a/src/components/Message/Message.tsx
+++ b/src/components/Message/Message.tsx
@@ -6,6 +6,7 @@ import { makeStyles } from '@material-ui/core/styles';
interface PropTypes {
tagline?: string;
message?: string;
+ noMargin?: boolean;
}
const useStyles = makeStyles(theme => ({
@@ -13,7 +14,9 @@ const useStyles = makeStyles(theme => ({
display: 'flex',
flexDirection: 'column',
justifyContent: 'center',
- alignItems: 'center',
+ alignItems: 'center'
+ },
+ margin: {
marginTop: theme.spacing(6)
},
content: {
@@ -21,11 +24,11 @@ const useStyles = makeStyles(theme => ({
}
}));
-const Message: React.FC<PropTypes> = React.memo(({ tagline, message, children }) => {
+const Message: React.FC<PropTypes> = React.memo(({ tagline, message, noMargin, children }) => {
const classes = useStyles();
return (
- <div className={classes.root}>
+ <div className={`${classes.root} ${!noMargin && classes.margin}`}>
<div className={classes.content}>
{children}
</div>