Skip to content

Commit

Permalink
add task solution
Browse files Browse the repository at this point in the history
  • Loading branch information
AvramenkoMarina committed Oct 19, 2024
1 parent 87c8011 commit c01bdff
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
18 changes: 10 additions & 8 deletions src/app/store.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { combineSlices, configureStore } from '@reduxjs/toolkit';
import { todosSlice } from '../features/todos';
import { filterSlice } from '../features/filter';
import { currentTodoSlice } from '../features/currentTodo';

const rootReducer = combineSlices(todosSlice, filterSlice, currentTodoSlice);
import { configureStore } from '@reduxjs/toolkit';
import todosReducer from '../features/todos';
import currentTodoReducer from '../features/currentTodo';
import filterReducer from '../features/filter';

export const store = configureStore({
reducer: rootReducer,
reducer: {
todos: todosReducer,
currentTodo: currentTodoReducer,
filter: filterReducer,
},
});

export type RootState = ReturnType<typeof rootReducer>;
export type RootState = ReturnType<typeof store.getState>;
export type AppDispatch = typeof store.dispatch;
2 changes: 1 addition & 1 deletion src/components/TodoList/TodoList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const TodoList: React.FC = () => {

return (
<>
{todos ? (
{todos.length > 0 ? (
<table className="table is-narrow is-fullwidth">
<thead>
<tr>
Expand Down
2 changes: 1 addition & 1 deletion src/components/TodoModal/TodoModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const TodoModal: React.FC = () => {
<strong className="has-text-danger">Planned</strong>
)}
{' by '}
<a href={`mailto:${user?.email}}`}>{user?.name}</a>
<a href={`mailto:${user?.email}`}>{user?.name}</a>
</p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/features/filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type Filter = {

const initialState: Filter = {
query: '',
status: 'all',
status: Status.all,
};

export const filterSlice = createSlice({
Expand Down

0 comments on commit c01bdff

Please sign in to comment.