Skip to content

Commit 5c95947

Browse files
committed
feat(v3-uplift): flatten swap & bridge network-selector triggers
Swap NetworkSelector: strip the themed Select-pill (bg fill + surface-shadow ring) so the trigger reads as a flat text button; option logo 16->24px and subheader2->h5 fg-1; zero the trigger's left padding and left-anchor the dropdown with a -4px nudge. Bridge NetworkSelect: flatten the inner trigger the same way (remove the outlined pill's bg + ring) while keeping the labeled container; drop a stray color:'red' debug rule; option row unchanged (18px logo + h3).
1 parent 5b7ac36 commit 5c95947

2 files changed

Lines changed: 25 additions & 30 deletions

File tree

src/components/transactions/NetworkSelect.tsx

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -58,32 +58,20 @@ export const NetworkSelect = ({
5858
onChange={handleChange}
5959
variant="outlined"
6060
sx={{
61-
'.MuiSelect-select': {
61+
// Flatten the trigger: strip the theme's Select-pill (bg fill + surface-shadow ring)
62+
// in all states so only the outer container remains. `&&` matches the theme's specificity.
63+
'&&, &&:hover, &&:has(.MuiSelect-select[aria-expanded="true"])': {
6264
backgroundColor: 'transparent',
65+
boxShadow: 'none',
6366
},
64-
'& .MuiOutlinedInput-root': {
65-
background: 'transparent',
66-
'&:hover': {
67-
'.MuiOutlinedInput-notchedOutline': {
68-
borderColor: 'currentColor',
69-
},
70-
},
71-
'&.Mui-focused': {
72-
'.MuiOutlinedInput-notchedOutline': {
73-
borderColor: 'primary.main',
74-
},
75-
},
76-
},
77-
'& .MuiOutlinedInput-notchedOutline': {
78-
border: 'none',
67+
'& .MuiOutlinedInput-notchedOutline': { border: 'none' },
68+
'& .MuiSelect-select': {
69+
backgroundColor: 'transparent',
7970
},
8071
'& .MuiSelect-icon': {
8172
marginRight: '12px',
8273
display: disabled ? 'none' : 'inline-block',
8374
},
84-
'& input.Mui-disabled': {
85-
color: 'red',
86-
},
8775
'& .MuiOutlinedInput-input.Mui-disabled': {
8876
backgroundColor: 'transparent',
8977
opacity: 1,

src/components/transactions/Swap/inputs/shared/NetworkSelector.tsx

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,31 +23,38 @@ export const NetworkSelector = ({
2323
native={false}
2424
value={String(selectedNetwork)}
2525
onChange={handleChange}
26+
MenuProps={{
27+
anchorOrigin: { vertical: 'bottom', horizontal: 'left' },
28+
transformOrigin: { vertical: 'top', horizontal: 'left' },
29+
sx: { '& .MuiPaper-root': { marginLeft: '-4px' } },
30+
}}
2631
sx={{
27-
'&.MuiInputBase-root': {
28-
border: 0,
29-
'.MuiSelect-select': {
30-
display: 'flex',
31-
backgroundColor: 'transparent',
32-
border: 0,
33-
},
32+
// Flatten the trigger to a plain text button: override the theme's Select-pill
33+
// (bg fill + surface-shadow ring) in all states. `&&` matches the theme's specificity.
34+
'&&, &&:hover, &&:has(.MuiSelect-select[aria-expanded="true"])': {
35+
backgroundColor: 'transparent',
36+
boxShadow: 'none',
3437
},
35-
'& .MuiOutlinedInput-notchedOutline': {
36-
border: 'none',
38+
'& .MuiOutlinedInput-notchedOutline': { border: 'none' },
39+
'& .MuiSelect-select': {
40+
display: 'flex',
41+
alignItems: 'center',
42+
backgroundColor: 'transparent',
43+
paddingLeft: 0,
3744
},
3845
}}
3946
>
4047
{networks.map((network) => (
4148
<MenuItem value={network.chainId} key={`${network.name}`}>
4249
<Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
4350
<MarketLogo
44-
size={16}
51+
size={24}
4552
logo={network.networkLogoPath}
4653
sx={{
4754
mr: 1,
4855
}}
4956
/>
50-
<Typography variant="subheader2" color="fg-2">
57+
<Typography variant="h5" color="fg-1">
5158
{network.displayName || network.name}
5259
</Typography>
5360
</Box>

0 commit comments

Comments
 (0)