@@ -17,18 +17,13 @@ import type { WalletData } from 'store/wallet';
17
17
import SearchableList from 'views/v2/Bridge/AssetPicker/SearchableList' ;
18
18
19
19
import { Chain } from '@wormhole-foundation/sdk' ;
20
- import { useMediaQuery , useTheme } from '@mui/material' ;
21
20
22
21
const useStyles = makeStyles ( ) ( ( theme : any ) => ( {
23
22
card : {
24
23
background : theme . palette . input . background ,
25
24
width : '420px' ,
26
25
[ theme . breakpoints . down ( 'sm' ) ] : {
27
- maxWidth : '420px' ,
28
- width : '360px' ,
29
- } ,
30
- '@media (max-width: 366px)' : {
31
- width : '330px' ,
26
+ width : '100vw' ,
32
27
} ,
33
28
} ,
34
29
cardContent : {
@@ -46,6 +41,9 @@ const useStyles = makeStyles()((theme: any) => ({
46
41
} ,
47
42
chainSearch : {
48
43
maxHeight : '400px' ,
44
+ [ theme . breakpoints . down ( 'sm' ) ] : {
45
+ maxHeight : '600px' ,
46
+ } ,
49
47
} ,
50
48
chainButton : {
51
49
display : 'flex' ,
@@ -76,12 +74,9 @@ type Props = {
76
74
} ;
77
75
78
76
const SHORT_LIST_SIZE = 5 ;
79
- const SHORT_LIST_SIZE_MOBILE = 4 ;
80
77
81
78
const ChainList = ( props : Props ) => {
82
79
const { classes } = useStyles ( ) ;
83
- const theme = useTheme ( ) ;
84
- const mobile = useMediaQuery ( theme . breakpoints . down ( 'sm' ) ) ;
85
80
const {
86
81
chainList,
87
82
selectedChainConfig,
@@ -98,25 +93,24 @@ const ChainList = (props: Props) => {
98
93
const selectedChainIndex = allChains . findIndex ( ( chain ) => {
99
94
return chain . key === selectedChain ?. key ;
100
95
} ) ;
101
- const shortListSize = mobile ? SHORT_LIST_SIZE_MOBILE : SHORT_LIST_SIZE ;
102
96
// If the selected chain is outside the top list, we add it to the top;
103
97
// otherwise we do not change its index in the top list
104
98
if (
105
99
selectedChain &&
106
100
selectedChainIndex &&
107
- selectedChainIndex >= shortListSize
101
+ selectedChainIndex >= SHORT_LIST_SIZE
108
102
) {
109
103
return [
110
- [ selectedChain , ...allChains . slice ( 0 , shortListSize - 1 ) ] ,
111
- allChains . length > shortListSize ,
104
+ [ selectedChain , ...allChains . slice ( 0 , SHORT_LIST_SIZE - 1 ) ] ,
105
+ allChains . length > SHORT_LIST_SIZE ,
112
106
] ;
113
107
}
114
108
115
109
return [
116
- allChains . slice ( 0 , shortListSize ) ,
117
- allChains . length > shortListSize ,
110
+ allChains . slice ( 0 , SHORT_LIST_SIZE ) ,
111
+ allChains . length > SHORT_LIST_SIZE ,
118
112
] ;
119
- } , [ mobile , chainList , selectedChainConfig ] ) ;
113
+ } , [ chainList , selectedChainConfig ] ) ;
120
114
121
115
const shortList = useMemo ( ( ) => {
122
116
return (
@@ -166,6 +160,7 @@ const ChainList = (props: Props) => {
166
160
onChainSelect ,
167
161
selectedChainConfig ?. key ,
168
162
setShowSearch ,
163
+ showMoreButton ,
169
164
topChains ,
170
165
] ) ;
171
166
0 commit comments