-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
190 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
108 changes: 108 additions & 0 deletions
108
ui/summit-2024/src/pages/Categories/components/NomineeCard.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
import React from "react"; | ||
import { Grid, Paper, Typography, Button, Box } from "@mui/material"; | ||
import { NomineeFixture } from "../../../__fixtures__/categories"; | ||
import HoverCircle from "../../../components/common/HoverCircle/HoverCircle"; | ||
import theme from "../../../common/styles/theme"; | ||
import nomineeBg from "../../../assets/bg/nomineeCard.svg"; | ||
|
||
interface NomineeCardProps { | ||
nominee: NomineeFixture; | ||
selectedNominee: number | undefined; | ||
handleSelectNominee: (id: number) => void; | ||
handleLearnMoreClick: ( | ||
event: React.MouseEvent<HTMLButtonElement, MouseEvent>, | ||
name: string, | ||
) => void; | ||
} | ||
|
||
const NomineeCard: React.FC<NomineeCardProps> = ({ | ||
nominee, | ||
selectedNominee, | ||
handleSelectNominee, | ||
handleLearnMoreClick, | ||
}) => { | ||
return ( | ||
<Grid item xs={12} sm={6} md={4} sx={{ width: "100px !important" }}> | ||
<Paper | ||
onClick={() => handleSelectNominee(nominee.id)} | ||
elevation={3} | ||
sx={{ | ||
width: "100%", | ||
maxWidth: "340px", | ||
height: "202px", | ||
flexShrink: 0, | ||
borderRadius: "24px", | ||
border: `1px solid ${ | ||
selectedNominee === nominee.id | ||
? theme.palette.secondary.main | ||
: theme.palette.background.default | ||
}`, | ||
backdropFilter: "blur(5px)", | ||
position: "relative", | ||
display: "flex", | ||
flexDirection: "column", | ||
justifyContent: "space-between", | ||
cursor: "pointer", | ||
backgroundImage: `url(${nomineeBg})`, | ||
backgroundSize: "150% 150%", | ||
backgroundPosition: 'center', | ||
}} | ||
> | ||
<Box | ||
sx={{ | ||
p: { xs: 1, sm: 2 }, | ||
}} | ||
> | ||
<Box sx={{ position: "absolute", right: 8, top: 8 }}> | ||
<HoverCircle selected={selectedNominee === nominee.id} /> | ||
</Box> | ||
<Typography | ||
variant="h6" | ||
sx={{ | ||
color: theme.palette.text.neutralLightest, | ||
textShadow: "0px 0px 12px rgba(18, 18, 18, 0.20)", | ||
fontFamily: "Dosis", | ||
fontSize: "28px", | ||
fontStyle: "normal", | ||
fontWeight: 700, | ||
lineHeight: "32px", | ||
mt: 3, | ||
ml: 1, | ||
}} | ||
> | ||
{nominee.name} | ||
</Typography> | ||
</Box> | ||
|
||
<Box | ||
sx={{ | ||
width: "100%", | ||
borderTop: `1px solid ${theme.palette.background.disabled}`, | ||
height: "48px", | ||
display: "flex", | ||
alignItems: "center", | ||
justifyContent: "center", | ||
}} | ||
> | ||
<Typography | ||
onClick={(event) => { | ||
event.stopPropagation(); | ||
handleLearnMoreClick(event, nominee.name); | ||
}} | ||
sx={{ | ||
color: theme.palette.text.neutralLight, | ||
fontSize: "16px", | ||
fontStyle: "normal", | ||
fontWeight: 500, | ||
lineHeight: "24px", | ||
}} | ||
> | ||
Learn More | ||
</Typography> | ||
</Box> | ||
</Paper> | ||
</Grid> | ||
); | ||
}; | ||
|
||
export { NomineeCard }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,39 @@ | ||
import React from 'react'; | ||
import { Box, Typography, Grid, Container } from '@mui/material'; | ||
import React from "react"; | ||
import { Box, Typography, Grid, Container } from "@mui/material"; | ||
import theme from "../../common/styles/theme"; | ||
|
||
const Leaderboard: React.FC = () => { | ||
return ( | ||
<Container maxWidth="lg"> | ||
<Box sx={{ my: 4 }}> | ||
<Typography sx={{ | ||
color: theme.palette.text.neutralLightest, | ||
fontFamily: "Dosis", | ||
fontSize: "32px", | ||
fontStyle: "normal", | ||
fontWeight: 700, | ||
lineHeight: "36px", | ||
marginBottom: "32px" | ||
}}> | ||
Leaderboard | ||
</Typography> | ||
<Grid container spacing={2}> | ||
<Grid item xs={12} md={6}> | ||
<Box sx={{ p: 2, border: '1px solid #ccc', borderRadius: '4px' }}> | ||
<Typography> | ||
Left Column Content | ||
</Typography> | ||
</Box> | ||
</Grid> | ||
<Grid item xs={12} md={6}> | ||
<Box sx={{ p: 2, border: '1px solid #ccc', borderRadius: '4px' }}> | ||
<Typography> | ||
Right Column Content | ||
</Typography> | ||
</Box> | ||
</Grid> | ||
</Grid> | ||
return ( | ||
<Container maxWidth="lg"> | ||
<Box sx={{ my: 4 }}> | ||
<Typography | ||
sx={{ | ||
color: theme.palette.text.neutralLightest, | ||
fontFamily: "Dosis", | ||
fontSize: "32px", | ||
fontStyle: "normal", | ||
fontWeight: 700, | ||
lineHeight: "36px", | ||
marginBottom: "32px", | ||
}} | ||
> | ||
Leaderboard | ||
</Typography> | ||
<Grid container spacing={2}> | ||
<Grid item xs={12} md={6}> | ||
<Box sx={{ p: 2, border: "1px solid #ccc", borderRadius: "4px" }}> | ||
<Typography>Left Column Content</Typography> | ||
</Box> | ||
</Container> | ||
); | ||
</Grid> | ||
<Grid item xs={12} md={6}> | ||
<Box sx={{ p: 2, border: "1px solid #ccc", borderRadius: "4px" }}> | ||
<Typography>Right Column Content</Typography> | ||
</Box> | ||
</Grid> | ||
</Grid> | ||
</Box> | ||
</Container> | ||
); | ||
}; | ||
|
||
|
||
export { Leaderboard }; |