mirror of
https://github.com/sergeyyarkov/todo-app.git
synced 2026-10-11 18:39:09 +03:00
added some components
This commit is contained in:
parent
0e688ddb3a
commit
2e2d312160
17
client/src/components/Categories/Categories.js
Normal file
17
client/src/components/Categories/Categories.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { Link } from 'react-router-dom'
|
||||||
|
import { ListItem, ListItemText } from '@material-ui/core'
|
||||||
|
|
||||||
|
const Categories = ({ data, history, classes }) => {
|
||||||
|
return data.map((e, i) => {
|
||||||
|
return (
|
||||||
|
<Link className={classes.link} key={i} to={`/category/${i}`}>
|
||||||
|
<ListItem selected={history.location.pathname === `/category/${i}`} button className={classes.nested}>
|
||||||
|
<ListItemText primary={"Категория " + i} />
|
||||||
|
</ListItem>
|
||||||
|
</Link>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Categories
|
||||||
@ -1,4 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import Categories from '../../Categories/Categories'
|
||||||
import { Link } from 'react-router-dom'
|
import { Link } from 'react-router-dom'
|
||||||
import MuiLink from '@material-ui/core/Link';
|
import MuiLink from '@material-ui/core/Link';
|
||||||
import { Divider, List, ListItemIcon, ListItemText, Collapse, ListItem, IconButton, Typography, makeStyles } from '@material-ui/core'
|
import { Divider, List, ListItemIcon, ListItemText, Collapse, ListItem, IconButton, Typography, makeStyles } from '@material-ui/core'
|
||||||
@ -86,15 +87,7 @@ const NavContent = ({ history }) => {
|
|||||||
</ListItem>
|
</ListItem>
|
||||||
<Collapse in={isListOpen.current} timeout="auto" unmountOnExit>
|
<Collapse in={isListOpen.current} timeout="auto" unmountOnExit>
|
||||||
<List component="div" disablePadding>
|
<List component="div" disablePadding>
|
||||||
{[1,2,3].map((e, i) => {
|
<Categories data={[1,2,3]} history={history} classes={classes} />
|
||||||
return (
|
|
||||||
<Link className={classes.link} key={i} to={`/category/${i}`}>
|
|
||||||
<ListItem selected={history.location.pathname === `/category/${i}`} button className={classes.nested}>
|
|
||||||
<ListItemText primary={"Категория " + i} />
|
|
||||||
</ListItem>
|
|
||||||
</Link>
|
|
||||||
)
|
|
||||||
})}
|
|
||||||
<ListItem className={classes.addCategoryItem}>
|
<ListItem className={classes.addCategoryItem}>
|
||||||
<IconButton aria-label="add">
|
<IconButton aria-label="add">
|
||||||
<AddIcon />
|
<AddIcon />
|
||||||
|
|||||||
@ -12,7 +12,7 @@ const Category = () => {
|
|||||||
<Fab size='large' ariaLabel='add' typeIcon='edit'/>
|
<Fab size='large' ariaLabel='add' typeIcon='edit'/>
|
||||||
<Grid item xs={12}>
|
<Grid item xs={12}>
|
||||||
<Typography>
|
<Typography>
|
||||||
Сортируйте свои повседневные задачи используя категории
|
Сортируйте свои повседневные задачи используя категории.
|
||||||
</Typography>
|
</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Cards data={[1,2,3]} />
|
<Cards data={[1,2,3]} />
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user