-
-
Save paour/d49e64b7d3992f42f1e7214fcf8f14be to your computer and use it in GitHub Desktop.
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
import React from 'react'; | |
import { Button, Typography, withStyles } from 'material-ui-next'; | |
const styles = theme => ({ | |
container: { | |
display: 'flex', | |
alignItems: 'center', | |
flexDirection: 'row', | |
justifyContent: 'space-between', | |
backgroundColor: theme.palette.grey[300], | |
paddingLeft: 16, | |
paddingRight: 16, | |
height: 40, | |
}, | |
inline: { | |
display: 'inline', | |
}, | |
inher: { | |
display: 'inherit', | |
alignItems: 'inherit', | |
}, | |
hilite: { | |
color: theme.palette.secondary[400], | |
}, | |
}); | |
function GalleryHeader(props) { | |
const { versionInfo, classes, onPublish } = props; | |
const versionName = versionInfo.versionName || 'Unknown version'; | |
const published = 'published' in versionInfo ? versionInfo.published : true; | |
return ( | |
<div className={classes.container}> | |
<Typography type={'subheading'} className={classes.inline}> | |
{versionName} | |
</Typography> | |
{published && <Typography>published</Typography>} | |
{!published && ( | |
<div className={classes.inher}> | |
<Typography className={classes.hilite}>new version</Typography> | |
<Button onClick={onPublish}>Publish</Button> | |
</div> | |
)} | |
</div> | |
); | |
} | |
export default withStyles(styles)(GalleryHeader); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment