Skip to content

Commit b71ced6

Browse files
authored
fix: mobile layouts (#2570)
1 parent 4201226 commit b71ced6

File tree

6 files changed

+58
-33
lines changed

6 files changed

+58
-33
lines changed

pages/safety-module.page.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,6 @@ export default function Staking() {
159159
<Trans>Stake AAVE</Trans>
160160
</Typography>
161161
</StyledToggleButton>
162-
<StyledToggleButton value="gho" disabled={mode === 'gho'}>
163-
<Typography variant="subheader1">
164-
<Trans>sGHO</Trans>
165-
</Typography>
166-
</StyledToggleButton>
167162
<StyledToggleButton value="bpt" disabled={mode === 'bpt'}>
168163
<Typography variant="subheader1">
169164
<Trans>Stake ABPT</Trans>

src/layouts/AppHeader.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export function AppHeader() {
9494
const sm = useMediaQuery(breakpoints.down('sm'));
9595
const smd = useMediaQuery('(max-width:1120px)');
9696

97-
const [visitedSwitch, setVisitedSwitch] = useState(() => {
97+
const [, setVisitedSwitch] = useState(() => {
9898
if (typeof window === 'undefined') return true;
9999
return Boolean(localStorage.getItem(SWITCH_VISITED_KEY));
100100
});
@@ -276,8 +276,8 @@ export function AppHeader() {
276276

277277
<NoSsr>
278278
<StyledBadge
279-
invisible={visitedSwitch}
280-
variant="dot"
279+
invisible={true}
280+
// variant="dot"
281281
badgeContent=""
282282
color="secondary"
283283
sx={{ mr: 2 }}

src/layouts/MobileMenu.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,7 @@ export const MobileMenu = ({ open, setOpen, headerHeight }: MobileMenuProps) =>
9494
<Trans>Watch wallet</Trans>
9595
</ListItemText>
9696
</ListItem>
97-
<ListItem
98-
sx={{ color: '#F1F1F3' }}
99-
component={Link}
100-
href={'/staking'}
101-
onClick={() => setOpen(false)}
102-
>
103-
<ListItemText>
104-
<Trans>Safety Module</Trans>
105-
</ListItemText>
106-
</ListItem>
97+
10798
<ListItem
10899
sx={{ color: '#F1F1F3' }}
109100
component={Link}

src/layouts/components/NavItems.tsx

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,56 @@ export const NavItems = ({ setOpen }: NavItemsProps) => {
9595
</ListItem>
9696
))}
9797

98+
<ListItem
99+
sx={{
100+
width: { xs: '100%', md: 'unset' },
101+
mr: { xs: 0, md: 2 },
102+
}}
103+
disablePadding
104+
>
105+
{md ? (
106+
<Typography
107+
component={Link}
108+
href={ROUTES.sGHO}
109+
variant="h2"
110+
color="#F1F1F3"
111+
sx={{ width: '100%', p: 4 }}
112+
onClick={() => handleClick('sGHO', true)}
113+
>
114+
<Trans>sGHO</Trans>
115+
</Typography>
116+
) : (
117+
<Button
118+
component={Link}
119+
onClick={() => handleClick('sGHO', false)}
120+
href={ROUTES.sGHO}
121+
sx={(theme) => ({
122+
color: '#F1F1F3',
123+
p: '6px 8px',
124+
position: 'relative',
125+
'.active&:after, &:hover&:after': {
126+
transform: 'scaleX(1)',
127+
transformOrigin: 'bottom left',
128+
},
129+
'&:after': {
130+
content: "''",
131+
position: 'absolute',
132+
width: '100%',
133+
transform: 'scaleX(0)',
134+
height: '2px',
135+
bottom: '-6px',
136+
left: '0',
137+
background: theme.palette.gradients.aaveGradient,
138+
transformOrigin: 'bottom right',
139+
transition: 'transform 0.25s ease-out',
140+
},
141+
})}
142+
>
143+
<Trans>sGHO</Trans>
144+
</Button>
145+
)}
146+
</ListItem>
147+
98148
<ListItem
99149
sx={{
100150
width: { xs: '100%', md: 'unset' },
@@ -112,7 +162,7 @@ export const NavItems = ({ setOpen }: NavItemsProps) => {
112162
sx={{ width: '100%', p: 4 }}
113163
onClick={() => handleClick('Staking', true)}
114164
>
115-
<Trans>Umbrella</Trans>
165+
<Trans>Staking</Trans>
116166
</Typography>
117167
</>
118168
) : (

src/layouts/components/StakingMenu.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,6 @@ export function StakingMenu({ isMobile = false, onClose }: StakingMenuProps) {
143143
<Trans>Safety Module</Trans>
144144
</Typography>
145145
</MenuItem>
146-
<MenuItem
147-
component={Link}
148-
href={ROUTES.sGHO}
149-
onClick={() => handleMenuItemClick('sGHO')}
150-
sx={{ minWidth: '140px' }}
151-
>
152-
<Typography variant="subheader1">
153-
<Trans>Savings GHO</Trans>
154-
</Typography>
155-
</MenuItem>
156146
</Menu>
157147
</>
158148
);

src/locales/en/messages.po

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,8 @@ msgstr "Unstake window"
10951095
msgid "Reload"
10961096
msgstr "Reload"
10971097

1098-
#: pages/safety-module.page.tsx
1098+
#: src/layouts/components/NavItems.tsx
1099+
#: src/layouts/components/NavItems.tsx
10991100
#: src/modules/reserve-overview/Gho/SavingsGho.tsx
11001101
#: src/modules/reserve-overview/Gho/SavingsGho.tsx
11011102
#: src/modules/sGho/SGhoDepositPanel.tsx
@@ -1312,6 +1313,7 @@ msgid "Merkl rewards are claimed through the"
13121313
msgstr "Merkl rewards are claimed through the"
13131314

13141315
#: src/components/transactions/Stake/StakeActions.tsx
1316+
#: src/layouts/components/NavItems.tsx
13151317
#: src/layouts/components/StakingMenu.tsx
13161318
#: src/modules/umbrella/UmbrellaActions.tsx
13171319
#: src/modules/umbrella/UmbrellaHeader.tsx
@@ -2001,7 +2003,6 @@ msgstr "Amount to Bridge"
20012003
msgid "Please always be aware of your <0>Health Factor (HF)</0> when partially migrating a position and that your rates will be updated to V3 rates."
20022004
msgstr "Please always be aware of your <0>Health Factor (HF)</0> when partially migrating a position and that your rates will be updated to V3 rates."
20032005

2004-
#: src/layouts/components/NavItems.tsx
20052006
#: src/layouts/components/StakingMenu.tsx
20062007
#: src/layouts/components/StakingMenu.tsx
20072008
msgid "Umbrella"
@@ -2641,7 +2642,6 @@ msgstr "Borrowable"
26412642
#: src/layouts/components/NavItems.tsx
26422643
#: src/layouts/components/StakingMenu.tsx
26432644
#: src/layouts/components/StakingMenu.tsx
2644-
#: src/layouts/MobileMenu.tsx
26452645
#: src/modules/staking/StakingHeader.tsx
26462646
msgid "Safety Module"
26472647
msgstr "Safety Module"
@@ -3503,7 +3503,6 @@ msgstr "Stablecoin"
35033503
msgid "Stable debt supply is not zero"
35043504
msgstr "Stable debt supply is not zero"
35053505

3506-
#: src/layouts/components/StakingMenu.tsx
35073506
#: src/modules/sGho/SGhoHeader.tsx
35083507
msgid "Savings GHO"
35093508
msgstr "Savings GHO"

0 commit comments

Comments
 (0)