This repository was archived by the owner on Dec 24, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change 1
1
import React , { Component } from 'react' ;
2
- import { Link } from 'react-router-dom' ;
2
+ // import { Link } from 'react-router-dom';
3
3
4
4
export default class ErrorBoundary extends Component {
5
5
constructor ( props ) {
@@ -26,7 +26,7 @@ export default class ErrorBoundary extends Component {
26
26
< h1 className = "center p-20 warn gr-bc" >
27
27
Sorry something went wrong.
28
28
</ h1 >
29
- < Link to = "/logout" > Logout</ Link >
29
+ { /* <Link to="/logout">Logout</Link> */ }
30
30
</ div >
31
31
) ;
32
32
}
Original file line number Diff line number Diff line change @@ -7,24 +7,22 @@ import { editTodo } from '../../store/actions/api.actions';
7
7
8
8
export default function DrawerForm ( ) {
9
9
const [ visible , setVisible ] = useState ( false ) ;
10
- const [ formData , setFormData ] = useState ( { } ) ;
11
10
const dispatch = useDispatch ( ) ;
12
11
const { editTodoData } = useSelector ( ( state ) => state . api ) ;
13
12
14
13
useEffect ( ( ) => {
15
14
if ( ! isEmpty ( editTodoData ) ) {
16
15
setVisible ( true ) ;
17
- setFormData ( editTodoData ) ;
18
16
}
19
17
} , [ editTodoData ] ) ;
20
18
21
19
const showForm = ( ) => {
22
20
dispatch ( editTodo ( ) ) ;
23
21
setVisible ( true ) ;
24
- setFormData ( { } ) ;
25
22
} ;
26
23
27
24
const onClose = ( ) => {
25
+ dispatch ( editTodo ( ) ) ;
28
26
setVisible ( false ) ;
29
27
} ;
30
28
@@ -41,11 +39,7 @@ export default function DrawerForm() {
41
39
onClose = { onClose }
42
40
visible = { visible }
43
41
>
44
- < TodoForm
45
- onClose = { onClose }
46
- editMode = { ! isEmpty ( formData ) }
47
- editableTodoData = { formData }
48
- />
42
+ < TodoForm onClose = { onClose } />
49
43
</ Drawer >
50
44
</ div >
51
45
) ;
You can’t perform that action at this time.
0 commit comments