Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/mavka-org/mavka-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
ToniaZakorchemna committed May 19, 2021
2 parents 446232d + 3b9a1cb commit 0d32bea
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 7 deletions.
8 changes: 6 additions & 2 deletions src/components/content/ContentBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,20 @@ import get from 'get-value';
const useStyles = props => makeStyles(theme => ({
root: {
width: "100%",
padding: theme.spacing(2),
paddingTop: theme.spacing(2),
paddingBottom: theme.spacing(2),
backgroundColor: get(theme.palette, props.color),
},
title: {
paddingBottom: theme.spacing(2)
}
}));

export function ContentBlock({ children, ...props }) {
const classes = useStyles(props)();
return (
<Grid className={classes.root} direction='column' container>
<Grid item container><Typography variant="body1"><strong>{props.title}</strong></Typography></Grid>
<Grid item container className={classes.title}><Typography variant="body1"><strong>{props.title}</strong></Typography></Grid>
<Grid item container><Typography variant="body1">{children}</Typography></Grid>
</Grid>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/content/ModeCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const useStyles = props => makeStyles(theme => ({
root: {
backgroundColor: get(theme.palette, props.color),
borderRadius: theme.shape.borderRadius,
padding: `${theme.spacing(2)} ${theme.spacing(4)}`,
padding: theme.spacing(2),
flexFlow:'nowrap'
},
}));
Expand Down
21 changes: 21 additions & 0 deletions src/components/layout/NavigationContainer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Container from '@material-ui/core/Container';

const useStyles = props => makeStyles( theme => ({
root: {
padding: theme.spacing(2)
}
}));

export function PageContainer({ children, ...props }){
const classes = useStyles(props)();
const classNames = `${classes.root} ${props.className}`;
return (
<Container maxWidth="sm" className={classNames}>
{children}
</Container>
);
}

export default PageContainer;
18 changes: 18 additions & 0 deletions src/stories/layout/NavigationContainer.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react';

import NavigationContainer from '../../components/layout/NavigationContainer';
import { makeStyles } from '@material-ui/core/styles';

export default {
title: 'Layout/NavigationContainer',
component: NavigationContainer
};

const useStyles = makeStyles( theme => ({
root: {
background: '#000',
color: '#fff'
}
}));

export const Default = () => <NavigationContainer className={useStyles().root}>This is a Default NavigationContainer used to pad all the navigation.</NavigationContainer>
6 changes: 3 additions & 3 deletions src/stories/navigation/BottomNavBar.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ export const WithControls = () => <BottomNavBar
<ControlsButtonGroup
collapsedButton={<Button onClick={() => {alert('Collapsed clicked')}} color='secondary' fullWidth>Завершити тест</Button>}
expendedButtons={[
<NavigateButton onClick={() => {alert('Going back!')}} before/>,
<Button onClick={() => {alert('Clicked')}} fullWidth>Перевірити</Button>,
<NavigateButton onClick={() => {alert('Going forward!')}}/>
<NavigateButton size='large' onClick={() => {alert('Going back!')}} before/>,
<Button size='large' onClick={() => {alert('Clicked')}} fullWidth>Перевірити</Button>,
<NavigateButton size='large' onClick={() => {alert('Going forward!')}}/>
]}
/>
}
Expand Down
1 change: 0 additions & 1 deletion src/stories/navigation/TestTopNavBar.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export default {
export const Default = () => {
const [collapsed, setCollapsed] = useState(false);
const theme = useTheme();
console.log("🚀 ~ file: TestTopNavBar.stories.js ~ line 17 ~ Default ~ theme", theme)

useEffect(() => {
if (collapsed) {
Expand Down

0 comments on commit 0d32bea

Please sign in to comment.