Skip to content

Commit 08933d2

Browse files
authored
tweak(styles): add gradient and truncation to mobile bottom menu
1 parent ca8c1e1 commit 08933d2

File tree

2 files changed

+51
-25
lines changed

2 files changed

+51
-25
lines changed

src/components/nav_bar_button/index.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,17 @@ const NavBarButton = (props: NavBarButtonProps) => {
3232
startIcon={props.icon}
3333
disabled={disabled}
3434
>
35-
{props.text}
35+
<Box
36+
component="span"
37+
sx={{
38+
whiteSpace: 'nowrap',
39+
overflow: 'hidden',
40+
textOverflow: 'ellipsis',
41+
maxWidth: '100%',
42+
}}
43+
>
44+
{props.text}
45+
</Box>
3646
</Button>
3747
) : (
3848
!disabled && (

src/layouts/bottom_menu/index.tsx

Lines changed: 40 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,46 @@ import { useAppTranslation } from '@hooks/index';
55
const BottomMenu = (props: BottomMenuProps) => {
66
const { t } = useAppTranslation();
77
return (
8-
<Box
9-
component={'nav'}
10-
aria-label={t('tr_bottomActionsMenu')}
11-
sx={{
12-
position: 'fixed',
13-
backgroundColor: 'var(--accent-150)',
14-
border: '1px solid var(--accent-200)',
15-
borderRadius: 'var(--radius-xl)',
16-
overflow: 'hidden',
17-
bottom: '16px',
18-
width: 'fit-content',
19-
left: '50%',
20-
transform: 'translate(-50%)',
21-
zIndex: (theme) => theme.zIndex.drawer + 1,
22-
boxShadow: 'var(--message-glow)',
23-
padding: '6px',
24-
display: 'flex',
25-
flexDirection: 'row',
26-
justifyContent: 'center',
27-
gap: '4px',
28-
}}
29-
>
30-
{props.buttons}
31-
</Box>
8+
<>
9+
<Box
10+
sx={{
11+
position: 'fixed',
12+
bottom: 0,
13+
left: 0,
14+
right: 0,
15+
height: '120px',
16+
background:
17+
'linear-gradient(180deg, rgba(var(--accent-100-base), 0) 0%, rgba(var(--accent-100-base), 0.85) 100%)',
18+
zIndex: (theme) => theme.zIndex.drawer,
19+
pointerEvents: 'none',
20+
}}
21+
/>
22+
<Box
23+
component={'nav'}
24+
aria-label={t('tr_bottomActionsMenu')}
25+
sx={{
26+
position: 'fixed',
27+
backgroundColor: 'var(--accent-150)',
28+
border: '1px solid var(--accent-200)',
29+
borderRadius: 'var(--radius-xl)',
30+
overflow: 'hidden',
31+
bottom: '16px',
32+
width: 'fit-content',
33+
maxWidth: 'calc(100% - 32px)',
34+
left: '50%',
35+
transform: 'translate(-50%)',
36+
zIndex: (theme) => theme.zIndex.drawer + 1,
37+
boxShadow: 'var(--message-glow)',
38+
padding: '6px',
39+
display: 'flex',
40+
flexDirection: 'row',
41+
justifyContent: 'center',
42+
gap: '4px',
43+
}}
44+
>
45+
{props.buttons}
46+
</Box>
47+
</>
3248
);
3349
};
3450

0 commit comments

Comments
 (0)