Skip to content

Commit ce37c7a

Browse files
authored
chore: Profile page UI updates
1 parent 41554ad commit ce37c7a

23 files changed

+474
-229
lines changed

src/components/Button/Button.style.ts

+9
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,12 @@ export const SuperfestButton = styled(ButtonBase)<MuiButtonProps>(
9191
},
9292
}),
9393
);
94+
95+
export const LevelButton = styled(ButtonSecondary)<MuiButtonProps>(() => ({
96+
display: 'flex',
97+
justifyContent: 'center',
98+
alignItems: 'center',
99+
pointerEvents: 'none',
100+
paddingLeft: '12px',
101+
height: '32px',
102+
}));

src/components/ProfilePage/AddressBox/AddressBox.style.ts

+3
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@ export const AddressBoxContainer = styled(Box, {
1818
position: 'relative',
1919
paddingBottom: theme.spacing(1),
2020
width: '100%',
21+
minHeight: 200,
22+
boxShadow: theme.palette.shadow.main,
2123

2224
...(!imgUrl && {
2325
background: `linear-gradient(to bottom, ${theme.palette.mode === 'light' ? theme.palette.primary.main : theme.palette.accent1Alt.main} 50%, ${theme.palette.mode === 'light' ? theme.palette.grey[100] : 'transparent'} 50%)`,
2426
}),
2527

2628
[theme.breakpoints.up('sm')]: {
29+
minHeight: 256,
2730
paddingTop: 0,
2831
paddingBottom: 0,
2932
},
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { styled } from '@mui/material/styles';
2+
import InfoIcon from '@mui/icons-material/Info';
3+
4+
export const StyledInfoIcon = styled(InfoIcon)({
5+
width: 16,
6+
height: 16,
7+
top: '3px',
8+
left: '8px',
9+
position: 'relative',
10+
opacity: '0.5',
11+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { Tooltip } from '@mui/material';
2+
import { useTranslation } from 'react-i18next';
3+
import { NoSelectTypography } from '../ProfilePage.style';
4+
import { StyledInfoIcon } from './CustonInfoIcon';
5+
6+
interface IconHeaderProps {
7+
tooltipKey: string;
8+
title: string;
9+
}
10+
11+
export const IconHeader = ({ tooltipKey, title }: IconHeaderProps) => {
12+
const { t } = useTranslation();
13+
14+
return (
15+
<NoSelectTypography fontSize="14px" lineHeight="18px" fontWeight={700}>
16+
{title}
17+
<Tooltip
18+
title={t(tooltipKey as any)}
19+
placement="top"
20+
enterTouchDelay={0}
21+
arrow
22+
>
23+
<StyledInfoIcon />
24+
</Tooltip>
25+
</NoSelectTypography>
26+
);
27+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import { Box, Button } from '@mui/material';
2+
import {
3+
FirstPage,
4+
LastPage,
5+
ChevronLeft,
6+
ChevronRight,
7+
} from '@mui/icons-material';
8+
import { NoSelectTypography } from '../ProfilePage.style';
9+
10+
interface PaginationProps {
11+
currentPage: number;
12+
totalPages: number;
13+
onFirstPage: () => void;
14+
onPreviousPage: () => void;
15+
onNextPage: () => void;
16+
onLastPage: () => void;
17+
}
18+
19+
export const Pagination = ({
20+
currentPage,
21+
totalPages,
22+
onFirstPage,
23+
onPreviousPage,
24+
onNextPage,
25+
onLastPage,
26+
}: PaginationProps) => {
27+
return (
28+
<Button
29+
aria-label="Page Navigation"
30+
size="medium"
31+
sx={{
32+
alignItems: 'center',
33+
width: '100%',
34+
display: 'flex',
35+
justifyContent: 'space-between',
36+
pointerEvents: 'none',
37+
}}
38+
>
39+
<Box sx={{ display: 'flex', alignItems: 'center' }}>
40+
<FirstPage
41+
onClick={onFirstPage}
42+
sx={{ cursor: 'pointer', pointerEvents: 'auto' }}
43+
/>
44+
<ChevronLeft
45+
onClick={onPreviousPage}
46+
sx={{ cursor: 'pointer', pointerEvents: 'auto' }}
47+
/>
48+
</Box>
49+
<NoSelectTypography fontSize="16px" lineHeight="18px" fontWeight={600}>
50+
{currentPage}/{totalPages}
51+
</NoSelectTypography>
52+
<Box sx={{ display: 'flex', alignItems: 'center' }}>
53+
<ChevronRight
54+
onClick={onNextPage}
55+
sx={{ cursor: 'pointer', pointerEvents: 'auto' }}
56+
/>
57+
<LastPage
58+
onClick={onLastPage}
59+
sx={{ cursor: 'pointer', pointerEvents: 'auto' }}
60+
/>
61+
</Box>
62+
</Button>
63+
);
64+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import React from 'react';
2+
import type { SxProps, Theme } from '@mui/material';
3+
import { Box } from '@mui/material';
4+
import { FirstPage, ChevronLeft } from '@mui/icons-material';
5+
6+
interface PaginationControlProps {
7+
onClick: () => void;
8+
disabled?: boolean;
9+
children: React.ReactNode;
10+
}
11+
12+
interface PaginationControlsProps {
13+
onFirstPage: () => void;
14+
onPreviousPage: () => void;
15+
disabled?: boolean;
16+
sx?: SxProps<Theme>;
17+
}
18+
19+
const PaginationControl = ({
20+
onClick,
21+
disabled = false,
22+
children,
23+
}: PaginationControlProps) => (
24+
<Box
25+
component="span"
26+
onClick={disabled ? undefined : onClick}
27+
sx={{
28+
cursor: disabled ? 'default' : 'pointer',
29+
pointerEvents: 'auto',
30+
opacity: disabled ? 0.5 : 1,
31+
'&:hover': { opacity: disabled ? 0.5 : 0.7 },
32+
}}
33+
>
34+
{children}
35+
</Box>
36+
);
37+
38+
export const PaginationControls = ({
39+
onFirstPage,
40+
onPreviousPage,
41+
disabled = false,
42+
sx = {},
43+
}: PaginationControlsProps) => {
44+
return (
45+
<Box sx={{ display: 'flex', alignItems: 'center', ...sx }}>
46+
<PaginationControl onClick={onFirstPage} disabled={disabled}>
47+
<FirstPage />
48+
</PaginationControl>
49+
<PaginationControl onClick={onPreviousPage} disabled={disabled}>
50+
<ChevronLeft />
51+
</PaginationControl>
52+
</Box>
53+
);
54+
};

src/components/ProfilePage/Leaderboard/Leaderboard.style.ts

+24-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Box, styled } from '@mui/material';
1+
import { alpha, Box, styled } from '@mui/material';
22

33
export const LeaderboardContainer = styled(Box)(({ theme }) => ({
44
backgroundColor: theme.palette.bgSecondary.main,
@@ -8,3 +8,26 @@ export const LeaderboardContainer = styled(Box)(({ theme }) => ({
88
margin: theme.spacing(4, 0, 0),
99
boxShadow: theme.palette.shadow.main,
1010
}));
11+
12+
export const StyledLeaderboardEntry = styled(Box, {
13+
shouldForwardProp: (prop) => prop !== 'isUserPosition',
14+
})<{ isUserPosition: boolean }>(({ theme, isUserPosition }) => ({
15+
display: 'flex',
16+
justifyContent: 'space-between',
17+
alignItems: 'center',
18+
width: '100%',
19+
margin: '10px 0',
20+
position: 'relative',
21+
...(isUserPosition && {
22+
'&:before': {
23+
position: 'absolute',
24+
top: '-6px',
25+
left: '-12px',
26+
content: '""',
27+
height: '36px',
28+
width: '312px',
29+
borderRadius: '6px',
30+
backgroundColor: alpha(theme.palette.black.main, 0.04),
31+
},
32+
}),
33+
}));

0 commit comments

Comments
 (0)