adds back original padding when masonry disabled

This commit is contained in:
Travis Kohlbeck 2019-12-22 16:05:24 -05:00
parent 6ef1daaec9
commit 313ff79116
2 changed files with 21 additions and 15 deletions

View File

@ -158,9 +158,13 @@ class HomePage extends Component<any, IHomePageState> {
render() {
const { classes } = this.props;
const containerClasses = `${classes.pageLayoutMaxConstraints}${
this.state.isMasonryLayout
? ' ' + classes.pageLayoutMasonry
: ''
}`;
return (
<div className={classes.pageLayoutMaxConstraints}>
<div className={containerClasses}>
{this.state.backlogPosts ? (
<div className={classes.pageTopChipContainer}>
<div className={classes.pageTopChips}>
@ -216,13 +220,11 @@ class HomePage extends Component<any, IHomePageState> {
<div>
{this.state.posts.map((post: Status) => {
return (
<div className={classes.masonryGrid_item}>
<Post
key={post.id}
post={post}
client={this.client}
/>
</div>
<Post
key={post.id}
post={post}
client={this.client}
/>
);
})}
</div>

View File

@ -33,22 +33,22 @@ export const styles = (theme: Theme) =>
marginLeft: 250,
marginTop: 88,
padding: theme.spacing.unit * 3,
paddingLeft: theme.spacing.unit * 3,
paddingRight: theme.spacing.unit * 3
paddingLeft: theme.spacing.unit * 16,
paddingRight: theme.spacing.unit * 16,
},
[theme.breakpoints.up("lg")]: {
marginLeft: 250,
marginTop: 88,
padding: theme.spacing.unit * 3,
paddingLeft: theme.spacing.unit * 3,
paddingRight: theme.spacing.unit * 3
paddingLeft: theme.spacing.unit * 32,
paddingRight: theme.spacing.unit * 32,
},
[theme.breakpoints.up("xl")]: {
marginLeft: 250,
marginTop: 88,
padding: theme.spacing.unit * 3,
paddingLeft: theme.spacing.unit * 3,
paddingRight: theme.spacing.unit * 3
paddingLeft: theme.spacing.unit * 40,
paddingRight: theme.spacing.unit * 40,
},
backgroundColor: theme.palette.background.default,
minHeight: isDarwinApp() ? "100vh" : "auto"
@ -324,6 +324,10 @@ export const styles = (theme: Theme) =>
},
backgroundColor: theme.palette.primary.main
},
pageLayoutMasonry: {
paddingLeft: theme.spacing.unit * 3,
paddingRight: theme.spacing.unit * 3,
},
masonryGrid: {
display: 'flex',
width: 'auto',