File tree 3 files changed +14
-42
lines changed
3 files changed +14
-42
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react'
2
2
3
- export default class Form extends React . Component {
3
+ const Form = ( props ) => {
4
4
5
- constructor ( props ) {
6
- super ( ) ;
7
- this . state = {
8
- days : 10 ,
9
- symbol : '' ,
10
- algo : '' ,
11
- } ;
12
- }
13
-
14
- callDays ( event ) {
15
- this . setState ( {
16
- days : event . target . value
17
- } ) ;
18
-
19
- this . props . changeDays ( event . target . value ) ;
20
- }
21
-
22
- render ( ) {
5
+ const callDays = ( event ) => {
6
+ props . changeDays ( event . target . value ) ;
7
+ }
23
8
24
9
const callSymbol = ( symbol ) => {
25
- this . setState ( {
26
- symbol : symbol ,
27
- } ) ;
28
-
29
- this . props . changeSymbol ( symbol ) ;
10
+ props . changeSymbol ( symbol ) ;
30
11
}
31
12
32
13
const callAlgo = ( algo ) => {
33
- this . setState ( {
34
- algo : algo ,
35
- } ) ;
36
-
37
- this . props . changeAlgo ( algo ) ;
14
+ props . changeAlgo ( algo ) ;
38
15
}
39
16
40
17
return (
@@ -69,7 +46,7 @@ export default class Form extends React.Component {
69
46
</ div >
70
47
< div className = "days" id = "days" >
71
48
Days:
72
- < select name = "time_window" defaultValue = { '10' } onChange = { ( event ) => this . callDays ( event ) } >
49
+ < select name = "time_window" defaultValue = { '10' } onChange = { ( event ) => callDays ( event ) } >
73
50
< option value = "5" > 5</ option >
74
51
< option value = "10" > 10</ option >
75
52
< option value = "15" > 15</ option >
@@ -80,7 +57,6 @@ export default class Form extends React.Component {
80
57
</ div >
81
58
</ div >
82
59
)
83
- }
84
-
85
60
}
86
61
62
+ export default Form ;
Original file line number Diff line number Diff line change @@ -3,10 +3,10 @@ import api from "../services/api";
3
3
4
4
const Table = ( props ) => {
5
5
6
- const [ dates , setDates ] = useState ( [ ] ) ;
7
- const [ social_media , setSocialMedia ] = useState ( '' ) ;
8
- const [ social_type , setSocialType ] = useState ( '' ) ;
9
- const [ social_logo , setSocialLogo ] = useState ( '' ) ;
6
+ const [ dates , setDates ] = useState ( [ ] ) ;
7
+ const [ social_media , setSocialMedia ] = useState ( '' ) ;
8
+ const [ social_type , setSocialType ] = useState ( '' ) ;
9
+ const [ social_logo , setSocialLogo ] = useState ( '' ) ;
10
10
11
11
useEffect ( ( ) => {
12
12
You can’t perform that action at this time.
0 commit comments