@@ -4,8 +4,6 @@ import { makeStyles } from 'tss-react/mui';
4
4
import { useDebounce } from 'use-debounce' ;
5
5
6
6
import { useTheme } from '@mui/material' ;
7
- import Card from '@mui/material/Card' ;
8
- import CardContent from '@mui/material/CardContent' ;
9
7
import Collapse from '@mui/material/Collapse' ;
10
8
import Slider from '@mui/material/Slider' ;
11
9
import Stack from '@mui/material/Stack' ;
@@ -21,18 +19,12 @@ import { setToNativeToken } from 'store/relay';
21
19
import { useTokens } from 'contexts/TokensContext' ;
22
20
23
21
const useStyles = makeStyles ( ) ( ( ) => ( {
24
- card : {
22
+ content : {
25
23
width : '100%' ,
26
24
cursor : 'pointer' ,
27
25
maxWidth : '420px' ,
28
26
overflow : 'visible' ,
29
- padding : '0 4px' ,
30
- } ,
31
- cardContent : {
32
- paddingTop : '8px' ,
33
- ':last-child' : {
34
- padding : '16px 20px' ,
35
- } ,
27
+ padding : '16px 20px' ,
36
28
} ,
37
29
container : {
38
30
display : 'flex' ,
@@ -153,62 +145,56 @@ const GasSlider = (props: {
153
145
}
154
146
155
147
return (
156
- < Card className = { classes . card } variant = "elevation" >
157
- < CardContent className = { classes . cardContent } >
158
- < Stack
159
- direction = "row"
160
- alignItems = "center"
161
- justifyContent = "space-between"
162
- >
163
- < Typography > { `Need more gas on ${ destChain } ?` } </ Typography >
164
- < StyledSwitch
165
- checked = { isGasSliderOpen }
166
- disabled = { props . disabled }
167
- onClick = { ( e : any ) => {
168
- const { checked } = e . target ;
169
-
170
- setIsGasSliderOpen ( checked ) ;
171
-
172
- if ( ! checked ) {
173
- setPercentage ( 0 ) ;
174
- dispatch ( setToNativeToken ( 0 ) ) ;
175
- }
176
- } }
177
- />
178
- </ Stack >
179
- < Collapse in = { isGasSliderOpen } unmountOnExit >
180
- < div className = { classes . container } >
181
- < Typography color = { theme . palette . text . secondary } fontSize = { 14 } >
182
- { `Use the slider to buy extra ${ nativeGasToken . symbol } for future transactions.` }
183
- </ Typography >
184
- < div >
185
- < StyledSlider
186
- aria-label = "Native gas conversion amount"
187
- defaultValue = { 0 }
188
- disabled = { props . disabled }
189
- value = { percentage }
190
- baseColor = { theme . palette . primary . main }
191
- railColor = { theme . palette . secondary . main }
192
- step = { 1 }
193
- min = { 0 }
194
- max = { 100 }
195
- valueLabelFormat = { ( ) => `${ percentage } %` }
196
- valueLabelDisplay = "auto"
197
- onChange = { ( e : any ) => setPercentage ( e . target . value ) }
198
- />
199
- < div className = { classes . amounts } >
200
- < Typography color = { theme . palette . text . secondary } fontSize = { 14 } >
201
- Additional gas
202
- </ Typography >
203
- < Typography color = { theme . palette . text . secondary } fontSize = { 14 } >
204
- { nativeGasPrice }
205
- </ Typography >
206
- </ div >
148
+ < div className = { classes . content } >
149
+ < Stack direction = "row" alignItems = "center" justifyContent = "space-between" >
150
+ < Typography > { `Need more gas on ${ destChain } ?` } </ Typography >
151
+ < StyledSwitch
152
+ checked = { isGasSliderOpen }
153
+ disabled = { props . disabled }
154
+ onClick = { ( e : any ) => {
155
+ const { checked } = e . target ;
156
+
157
+ setIsGasSliderOpen ( checked ) ;
158
+
159
+ if ( ! checked ) {
160
+ setPercentage ( 0 ) ;
161
+ dispatch ( setToNativeToken ( 0 ) ) ;
162
+ }
163
+ } }
164
+ />
165
+ </ Stack >
166
+ < Collapse in = { isGasSliderOpen } unmountOnExit >
167
+ < div className = { classes . container } >
168
+ < Typography color = { theme . palette . text . secondary } fontSize = { 14 } >
169
+ { `Use the slider to buy extra ${ nativeGasToken . symbol } for future transactions.` }
170
+ </ Typography >
171
+ < div >
172
+ < StyledSlider
173
+ aria-label = "Native gas conversion amount"
174
+ defaultValue = { 0 }
175
+ disabled = { props . disabled }
176
+ value = { percentage }
177
+ baseColor = { theme . palette . primary . main }
178
+ railColor = { theme . palette . secondary . main }
179
+ step = { 1 }
180
+ min = { 0 }
181
+ max = { 100 }
182
+ valueLabelFormat = { ( ) => `${ percentage } %` }
183
+ valueLabelDisplay = "auto"
184
+ onChange = { ( e : any ) => setPercentage ( e . target . value ) }
185
+ />
186
+ < div className = { classes . amounts } >
187
+ < Typography color = { theme . palette . text . secondary } fontSize = { 14 } >
188
+ Additional gas
189
+ </ Typography >
190
+ < Typography color = { theme . palette . text . secondary } fontSize = { 14 } >
191
+ { nativeGasPrice }
192
+ </ Typography >
207
193
</ div >
208
194
</ div >
209
- </ Collapse >
210
- </ CardContent >
211
- </ Card >
195
+ </ div >
196
+ </ Collapse >
197
+ </ div >
212
198
) ;
213
199
} ;
214
200
0 commit comments