Skip to content

Commit

Permalink
fix: update nominee card
Browse files Browse the repository at this point in the history
  • Loading branch information
jimcase committed May 29, 2024
1 parent 48e7f5c commit 8ab53f6
Show file tree
Hide file tree
Showing 6 changed files with 190 additions and 129 deletions.
4 changes: 2 additions & 2 deletions ui/summit-2024/src/__fixtures__/categories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const nomineesData: NomineeArrayFixture[] = [
},
{
id: 3,
name: "John Loo",
name: "John Loo Luu Long Lee",
description:
"John has been instrumental in advocating for blockchain technology across global platforms.",
twitterLink: "https://twitter.com/johndoe",
Expand All @@ -54,7 +54,7 @@ const nomineesData: NomineeArrayFixture[] = [
},
{
id: 5,
name: "John See",
name: "John See WorldWorldWorld SeeSee SeeSee See",
description:
"John has been instrumental in advocating for blockchain technology across global platforms.",
twitterLink: "https://twitter.com/johndoe",
Expand Down
36 changes: 36 additions & 0 deletions ui/summit-2024/src/assets/bg/nomineeCard.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion ui/summit-2024/src/components/common/Modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const Modal = (props: ModalProps) => {
id={id}
sx={{
display: "flex",
justifyContent: "center",
justifyContent: props.leftTitle ? "left" : "center",
alignItems: "center",
backgroundColor: "background.default",
position: "relative",
Expand Down Expand Up @@ -92,6 +92,7 @@ const Modal = (props: ModalProps) => {
component="div"
sx={{
flex: 1,
maxWidth: "320px",
textAlign: props.leftTitle ? "left" : "center",
fontFamily: "Dosis",
weight: 700,
Expand Down
101 changes: 10 additions & 91 deletions ui/summit-2024/src/pages/Categories/Categories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { BioModal } from "./components/BioModal";
import { VoteNowModal } from "./components/VoteNowModal";
import { useIsPortrait } from "../../common/hooks/useIsPortrait";
import { is } from "@react-three/fiber/dist/declarations/src/core/utils";
import { NomineeCard } from "./components/NomineeCard";

const Categories: React.FC = () => {
const categoriesData = nomineesData;
Expand Down Expand Up @@ -293,97 +294,15 @@ const Categories: React.FC = () => {
justifyContent="center"
alignItems="flex-start"
>
{categoryToRender.nominees?.map(
(nominee: NomineeFixture, index) => (
<Grid
item
xs={12}
sm={6}
md={4}
key={index}
sx={{
width: "100px !important",
}}
>
<Paper
onClick={() => handleSelectNominee(nominee.id)}
elevation={3}
sx={{
width: "100%",
maxWidth: "340px",
height: "240px",
flexShrink: 0,
borderRadius: "24px",
border: `1px solid ${
selectedNominee === nominee.id
? theme.palette.secondary.main
: theme.palette.background.default
}`,
backdropFilter: "blur(5px)",
p: { xs: 1, sm: 2 },
position: "relative",
display: "flex",
flexDirection: "column",
justifyContent: "space-between",
cursor: "pointer",
}}
>
<Box sx={{ position: "absolute", right: 8, top: 8 }}>
<HoverCircle
selected={selectedNominee === nominee.id}
/>
</Box>
<Typography
variant="h6"
sx={{
color: "var(--neutralLightest, #FAF9F6)",
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>
<Button
onClick={(event) => {
event.stopPropagation();
handleLearnMoreClick(event, nominee.name);
}}
sx={{
display: "flex",
width: "90%",
padding: "16px 24px",
justifyContent: "center",
alignItems: "center",
gap: 1,
borderRadius: "12px",
border: "1px solid var(--neutralLightest, #FAF9F6)",
color: "var(--neutralLightest, #FAF9F6)",
fontSize: "16px",
fontStyle: "normal",
fontWeight: 500,
lineHeight: "24px",
mt: "auto",
mx: "auto",
marginBottom: "40px",
textTransform: "none",
"&:hover": {
border: "1px solid var(--neutralLightest, #FAF9F6)",
color: "var(--neutralLightest, #FAF9F6)",
},
}}
>
Learn More
</Button>
</Paper>
</Grid>
),
)}
{categoryToRender.nominees?.map((nominee, index) => (
<NomineeCard
key={index}
nominee={nominee}
selectedNominee={selectedNominee}
handleSelectNominee={handleSelectNominee}
handleLearnMoreClick={handleLearnMoreClick}
/>
))}
</Grid>
</Fade>
</Grid>
Expand Down
108 changes: 108 additions & 0 deletions ui/summit-2024/src/pages/Categories/components/NomineeCard.tsx
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 };
67 changes: 32 additions & 35 deletions ui/summit-2024/src/pages/Leaderboard/Leaderboard.tsx
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 };

0 comments on commit 8ab53f6

Please sign in to comment.