File tree 3 files changed +44
-6
lines changed
3 files changed +44
-6
lines changed Original file line number Diff line number Diff line change 23
23
24
24
.modal-width {
25
25
width : 70% ;
26
+ }
27
+
28
+ .small-btn {
29
+ height : 25px ;
30
+ width : 25px ;
31
+ position : absolute;
32
+ top : 183px ;
33
+ left : 11px ;
34
+ opacity : .3 ;
35
+ }
36
+
37
+ .small-btn i {
38
+ position : relative;
39
+ bottom : 7px ;
40
+ font-size : 18px ;
41
+ }
42
+
43
+ pre {
44
+ width : 100% ;
45
+ margin-left : 2px ;
46
+ }
47
+
48
+ .results-div {
49
+ display : flex;
50
+ width : 340px ;
51
+ margin-left : -20px ;
26
52
}
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ class FuncCard extends Component {
21
21
this . handleToggleCode = this . handleToggleCode . bind ( this ) ;
22
22
this . handleParamsChange = this . handleParamsChange . bind ( this ) ;
23
23
this . handleRunCode = this . handleRunCode . bind ( this ) ;
24
+ this . handleClearParams = this . handleClearParams . bind ( this ) ;
24
25
}
25
26
26
27
componentDidMount ( ) {
@@ -54,6 +55,10 @@ class FuncCard extends Component {
54
55
this . setState ( prevState => ( { showCode : ! prevState . showCode } ) ) ;
55
56
}
56
57
58
+ handleClearParams ( ) {
59
+ this . setState ( { params : [ ] , result : "" , error : "" } )
60
+ }
61
+
57
62
render ( ) {
58
63
const {
59
64
funcName,
@@ -91,9 +96,17 @@ class FuncCard extends Component {
91
96
onParamsChange = { this . handleParamsChange }
92
97
onSubmit = { this . handleParamSubmit }
93
98
/>
94
-
95
- < Highlight lang = "js" value = { callCode } />
96
-
99
+ < div className = "results-div" >
100
+ < Button
101
+ floating
102
+ disabled = { params . length === 0 && ! result }
103
+ className = 'grey darken-3 small-btn'
104
+ waves = 'light'
105
+ icon = 'clear'
106
+ onClick = { this . handleClearParams }
107
+ />
108
+ < Highlight lang = "js" value = { callCode } />
109
+ </ div >
97
110
< Button onClick = { this . handleRunCode } > Run</ Button >
98
111
< Modal
99
112
className = "modal-width"
Original file line number Diff line number Diff line change @@ -56,9 +56,8 @@ class CardList extends Component {
56
56
data = { data }
57
57
handleDropdownChange = { ( e , value ) => this . handleDropdownChange ( value ) }
58
58
/>
59
- < Carousel >
60
- { funcCards }
61
- </ Carousel >
59
+ < Carousel children = { funcCards } />
60
+
62
61
</ div >
63
62
) ;
64
63
}
You can’t perform that action at this time.
0 commit comments