diff --git a/client/src/App.js b/client/src/App.js index 38c8c40..c5da74d 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -1,10 +1,10 @@ import React from 'react' import { Route, Switch, Redirect, withRouter } from "react-router-dom" import Layout from './components/Layout/Layout' -import Todos from './containers/Todos/Todos' -import Category from './containers/Category/Category' -import Trash from './containers/Trash/Trash' -import NotFound from './containers/NotFound/NotFound' +import TodosContainer from './containers/TodosContainer/TodosContainer' +import CategoryContainer from './containers/CategoryContainer/CategoryContainer' +import TrashContainer from './containers/TrashContainer/TrashContainer' +import NotFoundContainer from './containers/NotFoundContainer/NotFoundContainer' import CssBaseLine from '@material-ui/core/CssBaseline' const App = ({ history }) => { @@ -13,10 +13,10 @@ const App = ({ history }) => { - - - - + + + + diff --git a/client/src/components/Fab/Fab.js b/client/src/components/Fab/Fab.js index 99aabb9..36bf999 100644 --- a/client/src/components/Fab/Fab.js +++ b/client/src/components/Fab/Fab.js @@ -23,10 +23,10 @@ const renderIcon = (typeIcon) => { } } -const FabComponent = ({ typeIcon, color, secondary, size, ariaLabel }) => { +const FabComponent = ({ typeIcon, color, secondary, size, ariaLabel, handleOpenModal }) => { const classes = useStyles() return ( - + {renderIcon(typeIcon)} ) diff --git a/client/src/components/Todos/TodoModal/TodosModal.js b/client/src/components/Todos/TodoModal/TodosModal.js new file mode 100644 index 0000000..fd86919 --- /dev/null +++ b/client/src/components/Todos/TodoModal/TodosModal.js @@ -0,0 +1,123 @@ +import React from 'react'; +import Fab from '../../../components/Fab/Fab' +import { Dialog, DialogContent, DialogTitle, DialogActions, Button, TextField, Select, MenuItem, InputLabel, FormControl, makeStyles } from '@material-ui/core' + +const useStyles = makeStyles(() => ({ + dialog: { + width: 500 + }, + form: { + display: 'flex', + flexDirection: 'column' + }, + textField: { + margin: '10px 0px' + }, + selectField: { + margin: '10px 0px' + } +})) + +const TodosModal = () => { + const classes = useStyles() + const [isModalOpen, setIsModalOpen] = React.useState(false) + const [selectedCategory, setSelectedCategory] = React.useState(''); + + const handleSelectChange = e => { + setSelectedCategory(e.target.value); + }; + + const handleFormSubmit = e => { + e.preventDefault() + const elements = e.target.elements + const data = { + title: elements.title.value, + description: elements.description.value, + category: elements.category.value, + deadline: elements.deadline.value + } + handleCloseModal() + console.log(data) + } + + const handleOpenModal = () => { + setIsModalOpen(true) + } + + const handleCloseModal = () => { + setIsModalOpen(false) + } + + return ( +
+ + + + Добавить новую запись + + +
+ + + + Категория + + + + + + + + +
+
+
+ ) +} + +export default TodosModal \ No newline at end of file diff --git a/client/src/components/Cards/Cards.js b/client/src/components/Todos/Todos.js similarity index 100% rename from client/src/components/Cards/Cards.js rename to client/src/components/Todos/Todos.js diff --git a/client/src/containers/Category/Category.js b/client/src/containers/CategoryContainer/CategoryContainer.js similarity index 79% rename from client/src/containers/Category/Category.js rename to client/src/containers/CategoryContainer/CategoryContainer.js index 0bdafc4..d514abd 100644 --- a/client/src/containers/Category/Category.js +++ b/client/src/containers/CategoryContainer/CategoryContainer.js @@ -1,5 +1,5 @@ import React from 'react'; -import Cards from '../../components/Cards/Cards' +import Todos from '../../components/Todos/Todos' import Fab from '../../components/Fab/Fab' import { Grid, Typography } from '@material-ui/core' @@ -12,10 +12,10 @@ const Category = () => { - Сортируйте свои повседневные задачи используя категории. + Сортируйте свои повседневные дела используя категории. - + ) } diff --git a/client/src/containers/NotFound/NotFound.js b/client/src/containers/NotFoundContainer/NotFoundContainer.js similarity index 83% rename from client/src/containers/NotFound/NotFound.js rename to client/src/containers/NotFoundContainer/NotFoundContainer.js index 7ecefa8..8ac6872 100644 --- a/client/src/containers/NotFound/NotFound.js +++ b/client/src/containers/NotFoundContainer/NotFoundContainer.js @@ -6,7 +6,7 @@ const Trash = () => { - ❌ Ошибка! Такого маршрута не существует. + ❌ Ошибка! Такой страницы не существует. diff --git a/client/src/containers/Todos/Todos.js b/client/src/containers/Todos/Todos.js deleted file mode 100644 index d69ed22..0000000 --- a/client/src/containers/Todos/Todos.js +++ /dev/null @@ -1,20 +0,0 @@ -import React from 'react'; -import Cards from '../../components/Cards/Cards' -import Fab from '../../components/Fab/Fab' -import { Typography, Grid } from '@material-ui/core' - -const Todos = () => { - return ( - - - - - Создавайте, редактируйте или удаляйте ваши повседневные дела. - - - - - ) -} - -export default Todos \ No newline at end of file diff --git a/client/src/containers/TodosContainer/TodosContainer.js b/client/src/containers/TodosContainer/TodosContainer.js new file mode 100644 index 0000000..30a25a4 --- /dev/null +++ b/client/src/containers/TodosContainer/TodosContainer.js @@ -0,0 +1,22 @@ +import React from 'react'; +import Todos from '../../components/Todos/Todos' +import TodosModal from '../../components/Todos/TodoModal/TodosModal' +import { Typography, Grid } from '@material-ui/core' + +const TodosContainer = () => { + return ( + <> + + + + + Создавайте, редактируйте или удаляйте ваши повседневные дела. + + + + + + ) +} + +export default TodosContainer \ No newline at end of file diff --git a/client/src/containers/Trash/Trash.js b/client/src/containers/TrashContainer/TrashContainer.js similarity index 84% rename from client/src/containers/Trash/Trash.js rename to client/src/containers/TrashContainer/TrashContainer.js index 5593d58..761a05b 100644 --- a/client/src/containers/Trash/Trash.js +++ b/client/src/containers/TrashContainer/TrashContainer.js @@ -1,5 +1,5 @@ import React from 'react'; -import Cards from '../../components/Cards/Cards' +import Todos from '../../components/Todos/Todos' import { Grid, Typography } from '@material-ui/core' const Trash = () => { @@ -10,7 +10,7 @@ const Trash = () => { Здесь находятся ваши недавно удаленные записи, вы можете их легко восстановить. - + ) } diff --git a/client/src/theme.js b/client/src/theme.js index a885267..55430e1 100644 --- a/client/src/theme.js +++ b/client/src/theme.js @@ -5,7 +5,7 @@ const theme = createMuiTheme({ palette: { type: 'dark', primary: { - main: '#0d47a1' + main: '#0091ea' }, secondary: red, error: red