-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: show users when they are previewing a space
closes #96
- Loading branch information
1 parent
2859b14
commit be10b87
Showing
6 changed files
with
313 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import React from 'react'; | ||
import Grid from '@material-ui/core/Grid'; | ||
import Paper from '@material-ui/core/Paper'; | ||
import Avatar from '@material-ui/core/Avatar'; | ||
import Divider from '@material-ui/core/Divider'; | ||
import CssBaseline from '@material-ui/core/CssBaseline'; | ||
import WarningIcon from '@material-ui/icons/Warning'; | ||
import Typography from '@material-ui/core/Typography'; | ||
import Button from '@material-ui/core/Button'; | ||
import Box from '@material-ui/core/Box'; | ||
import { withStyles } from '@material-ui/core'; | ||
import PropTypes from 'prop-types'; | ||
|
||
const styles = theme => ({ | ||
banner: { | ||
marginBottom: theme.spacing(2), | ||
}, | ||
}); | ||
|
||
const renderButton = buttonText => ( | ||
<Grid container justify="flex-end" spacing={8}> | ||
<Grid item> | ||
<Button color="primary">{buttonText}</Button> | ||
</Grid> | ||
</Grid> | ||
); | ||
|
||
const Banner = ({ text, buttonText, classes }) => { | ||
return ( | ||
<div className={classes.banner}> | ||
<CssBaseline /> | ||
<Paper elevation={0}> | ||
<Box pt={2} pr={1} pb={1} pl={2}> | ||
<Grid container spacing={6} alignItems="center" wrap="nowrap"> | ||
<Grid item> | ||
<Box bgcolor="primary.main" clone> | ||
<Avatar> | ||
<WarningIcon /> | ||
</Avatar> | ||
</Box> | ||
</Grid> | ||
<Grid item> | ||
<Typography>{text}</Typography> | ||
</Grid> | ||
</Grid> | ||
{buttonText ? renderButton() : null} | ||
</Box> | ||
</Paper> | ||
<Divider /> | ||
</div> | ||
); | ||
}; | ||
|
||
Banner.propTypes = { | ||
text: PropTypes.string, | ||
buttonText: PropTypes.string, | ||
classes: PropTypes.shape({ banner: PropTypes.string.isRequired }).isRequired, | ||
}; | ||
|
||
Banner.defaultProps = { | ||
text: null, | ||
buttonText: null, | ||
}; | ||
|
||
export default withStyles(styles)(Banner); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.