diff --git a/spa-react/src/App.js b/spa-react/src/App.js index 36a1fed..9673cf3 100644 --- a/spa-react/src/App.js +++ b/spa-react/src/App.js @@ -7,6 +7,7 @@ import ScreenSingUp from "./screens/screen-sign-up"; import ScreenAddTask from "./screens/screen-add-task"; import ScreenTask from "./screens/screen-task"; import ScreenTasks from "./screens/screen-tasks"; +import ScreenDesignatedTasks from "./screens/designated-tasks"; import Footer from './components/footer/footer'; import {getCookie, getTask} from "./helpers/helpers"; import {getTasks} from "./data/data"; @@ -38,7 +39,7 @@ class App extends PureComponent { this._changeActiveScreen = this._changeActiveScreen.bind(this); this._getDataForApp = this._getDataForApp.bind(this); this._handleClickMore = this._handleClickMore.bind(this); - this._handleAddTaskClick = this._handleAddTaskClick.bind(this); + this._handleClickUserOtherLinks = this._handleClickUserOtherLinks.bind(this); this._handleClickExit = this._handleClickExit.bind(this); this._handleClickChangePagePagination = this._handleClickChangePagePagination.bind(this); } @@ -48,7 +49,7 @@ class App extends PureComponent { } render() { - const screen = this._getPage(this.state); + const screen = this._getScreen(this.state); return ( @@ -108,9 +109,9 @@ class App extends PureComponent { })) } - _handleAddTaskClick(evt) { + _handleClickUserOtherLinks(evt) { evt.preventDefault(); - this._changeActiveScreen("screen-add-task"); + this._changeActiveScreen(evt.target.dataset.screen); } _handleClickExit(evt) { @@ -123,7 +124,7 @@ class App extends PureComponent { } } - _getPage(state) { + _getScreen(state) { const { activeScreen, tasks, @@ -141,9 +142,13 @@ class App extends PureComponent { getData={this._getDataForApp} />; case "screen-sing-up": - return ; + return ; case "screen-add-task": - return ; + return ; case "screen-tasks": return ; + case "designated-tasks": + return ; case "screen-task": return { const { name, surname, - patronymic + patronymic, } = props.user; return (