diff options
author | eug-vs <eug-vs@keemail.me> | 2020-08-15 03:48:53 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-08-15 03:49:41 +0300 |
commit | bf47681e325e18edb3b5bfa4c655095189697e8b (patch) | |
tree | a224f51dcb68b27925d0ed1b89bf6bb2809486ca /src/components/Loading/Loading.tsx | |
parent | 237d16c273a47e68254f9fa76d3190d28a257ca6 (diff) | |
download | which-ui-bf47681e325e18edb3b5bfa4c655095189697e8b.tar.gz |
refactor: separate Message component
Diffstat (limited to 'src/components/Loading/Loading.tsx')
-rw-r--r-- | src/components/Loading/Loading.tsx | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/src/components/Loading/Loading.tsx b/src/components/Loading/Loading.tsx index 34d436b..fac0049 100644 --- a/src/components/Loading/Loading.tsx +++ b/src/components/Loading/Loading.tsx @@ -1,22 +1,17 @@ import React from 'react'; import CircularProgress from '@material-ui/core/CircularProgress'; -import { makeStyles } from '@material-ui/core'; +import Message from '../Message/Message'; -const useStyles = makeStyles(theme => ({ - loader: { - width: '100%', - textAlign: 'center', - marginTop: theme.spacing(10) - } -})); - -const Loading: React.FC = React.memo(() => { - const classes = useStyles(); +interface PropTypes { + tagline?: string; + message?: string; +} +const Loading: React.FC<PropTypes> = React.memo(({ tagline, message }) => { return ( - <div className={classes.loader}> - <CircularProgress color="primary" style={{ margin: '0 auto' }} /> - </div> + <Message tagline={tagline} message={message}> + <CircularProgress color="primary" /> + </Message> ); }); |