Skip to content

Commit

Permalink
Merge pull request #30 from mavka-org/main
Browse files Browse the repository at this point in the history
Components fixes
  • Loading branch information
arlaptiev authored May 19, 2021
2 parents c9c8dbf + 21c2ccb commit 2eaa091
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 23 deletions.
5 changes: 2 additions & 3 deletions src/components/content/ContentBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,17 @@ const useStyles = props => makeStyles(theme => ({
width: "100%",
paddingTop: theme.spacing(2),
paddingBottom: theme.spacing(2),
backgroundColor: get(theme.palette, props.color),
},
title: {
paddingBottom: theme.spacing(2)
paddingBottom: theme.spacing(1)
}
}));

export function ContentBlock({ children, ...props }) {
const classes = useStyles(props)();
return (
<Grid className={classes.root} direction='column' container>
<Grid item container className={classes.title}><Typography variant="body1"><strong>{props.title}</strong></Typography></Grid>
{props.title ? <Grid item container className={classes.title}><Typography variant="body1"><strong>{props.title}</strong></Typography></Grid> : null}
<Grid item container><Typography variant="body1">{children}</Typography></Grid>
</Grid>
);
Expand Down
4 changes: 2 additions & 2 deletions src/components/layout/PageContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ const useStyles = props => makeStyles( theme => ({
}
}));

export function PageContainer({ children, ...props }){
export function PageContainer({ children, style, ...props }){
const classes = useStyles(props)();
const classNames = `${classes.root} ${props.className}`;
return (
<Container maxWidth="sm" className={classNames}>
<Container style={style} maxWidth="sm" className={classNames}>
{children}
</Container>
);
Expand Down
4 changes: 2 additions & 2 deletions src/components/layout/Surface.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ const useStyles = props => makeStyles( theme => ({
}
}));

export function Surface({ children, ...props }){
export function Surface({ children, style, ...props }){
const classes = useStyles(props)();
const classNames = `${classes.root} ${props.className}`;
return (
<Box className={classNames}>
<Box style={style} className={classNames}>
{children}
</Box>
);
Expand Down
32 changes: 18 additions & 14 deletions src/components/navigation/TestTopNavBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,24 @@ export function TestTopNavBar({ children, ...props }){

</div>

<Slide in={!props.collapsed} timeout={100} unmountOnExit mountOnEnter>
<div>
<Grow in={!props.collapsed} timeout={50}>
<div>
<Fade in={!props.collapsed} timeout={50}>
<div>
<div className={classes.standardBottomPadding}>{children}</div>
<div className={classes.fullWidth}><IconButton className={classes.collapseButton} onClick={() => {props.setCollapsed(true)}}><ExpandLessIcon/></IconButton></div>
</div>
</Fade>
</div>
</Grow>
</div>
</Slide>
{
children ?
<Slide in={!props.collapsed} timeout={100} unmountOnExit mountOnEnter>
<div>
<Grow in={!props.collapsed} timeout={50}>
<div>
<Fade in={!props.collapsed} timeout={50}>
<div>
<div className={classes.standardBottomPadding}>{children}</div>
<div className={classes.fullWidth}><IconButton className={classes.collapseButton} onClick={() => {props.setCollapsed(true)}}><ExpandLessIcon/></IconButton></div>
</div>
</Fade>
</div>
</Grow>
</div>
</Slide>
: null
}

</PageContainer>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/userInput/TestInputTextSection.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function TestInputTextSection({ children, ...props }) {
const theme = useTheme();

return (
<Grid container direction="row" spacing={2}>
<Grid container direction="row" spacing={2} style={{justifyContent: "center"}}>
{props.testInputsList.map((elem) => {
return (

Expand Down
4 changes: 3 additions & 1 deletion src/stories/content/ContentBlock.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ export default {
component: ContentBlock
};

export const Default = () => <ContentBlock color="alternative.redLight">This is content info block's children</ContentBlock>;
export const Default = () => <ContentBlock title="This is title">This is content block's children</ContentBlock>;

export const NoTitle = () => <ContentBlock>This is content block's children. No title here</ContentBlock>;

0 comments on commit 2eaa091

Please sign in to comment.