diff --git a/src/App.tsx b/src/App.tsx index 0826eff..fc48006 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,13 +1,12 @@ import React, { FC } from 'react'; import Router from './Router'; -import { Header } from './components/Header'; +import { Layout } from './components/layout'; const App: FC = () => ( - <> -
+ - + ); export default App; diff --git a/src/components/layout.tsx b/src/components/layout.tsx new file mode 100644 index 0000000..05b1d44 --- /dev/null +++ b/src/components/layout.tsx @@ -0,0 +1,11 @@ +import React from 'react'; +import { FC } from 'react'; + +import { Header } from './Header'; + +export const Layout: FC = ({ children }) => ( +
+
+ {children} +
+); diff --git a/src/containers/home/TodoList.tsx b/src/containers/home/TodoList.tsx index eebb1e8..68b90d0 100644 --- a/src/containers/home/TodoList.tsx +++ b/src/containers/home/TodoList.tsx @@ -1,11 +1,12 @@ -import React, { FC } from 'react'; +import React, { FC, memo } from 'react'; + import Todo from '../../core/models/todo'; interface Props { todos: Todo[]; } -export const TodoList: FC = ({ todos }) => ( +const TodoList: FC = ({ todos }) => (
    {todos.map((todo) => ( @@ -16,3 +17,5 @@ export const TodoList: FC = ({ todos }) => (
); + +export default memo(TodoList); diff --git a/src/containers/home/index.tsx b/src/containers/home/index.tsx index babe2a4..1d368cb 100644 --- a/src/containers/home/index.tsx +++ b/src/containers/home/index.tsx @@ -1,28 +1,26 @@ import React, { FC } from 'react'; -import { TodoList } from './TodoList'; +import TodoList from './TodoList'; import { Button } from '../../components/button'; +import { Container } from '../../components/container'; import Todo from '../../core/models/todo'; import { listTodos } from '../../core/services/todo'; -import { Container } from '../../components/container'; export const Home: FC = () => { const todos: Todo[] = listTodos(); return ( -
+

Your tasks

Hi there!

- - - - -
+ + + ); }; diff --git a/src/core/store/index.ts b/src/core/store/index.ts new file mode 100644 index 0000000..c579700 --- /dev/null +++ b/src/core/store/index.ts @@ -0,0 +1 @@ +// init redux here diff --git a/src/core/store/todo/actions.ts b/src/core/store/todo/actions.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/core/store/todo/reducers.ts b/src/core/store/todo/reducers.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/core/store/todo/selectors.ts b/src/core/store/todo/selectors.ts new file mode 100644 index 0000000..e69de29