Skip to content

Commit

Permalink
feat: add share icon in bio modal
Browse files Browse the repository at this point in the history
  • Loading branch information
jimcase committed Sep 24, 2024
1 parent 00d3e31 commit 0c407c7
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 12 deletions.
18 changes: 9 additions & 9 deletions ui/summit-2024/src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -309,13 +309,13 @@ const Header = () => {
<Typography
sx={{
color: "inherit",
padding:" 16px 24px",
padding: " 16px 24px",
textDecoration: "none",
borderRadius: "12px",
cursor: "pointer",
"&:hover": {
backgroundColor: "#282828",
}
},
}}
onClick={() => handleClickMenu(ROUTES.CATEGORIES)}
>
Expand All @@ -324,13 +324,13 @@ const Header = () => {
<Typography
sx={{
color: "inherit",
padding:" 16px 24px",
padding: " 16px 24px",
textDecoration: "none",
borderRadius: "12px",
cursor: "pointer",
"&:hover": {
backgroundColor: "#282828",
}
},
}}
onClick={() => handleClickMenu(ROUTES.LEADERBOARD)}
>
Expand All @@ -339,13 +339,13 @@ const Header = () => {
<Typography
sx={{
color: "inherit",
padding:" 16px 24px",
padding: " 16px 24px",
textDecoration: "none",
borderRadius: "12px",
cursor: "pointer",
"&:hover": {
backgroundColor: "#282828",
}
},
}}
onClick={() => handleClickMenu(ROUTES.USER_GUIDE)}
>
Expand Down Expand Up @@ -376,9 +376,9 @@ const Header = () => {
background:
"linear-gradient(258deg, #EE9766 0%, #40407D 187.58%, #0C7BC5 249.97%)",
color: theme.palette.background.default,
'&:hover': {
color: theme.palette.text.neutralLight
}
"&:hover": {
color: theme.palette.text.neutralLight,
},
}}
>
<MenuOutlinedIcon />
Expand Down
1 change: 1 addition & 0 deletions ui/summit-2024/src/pages/Categories/Categories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@ const Categories: React.FC<CategoriesProps> = ({ embedded }) => {
onClose={() => setOpenVotingModal(false)}
/>
<BioModal
categoryId={categoryToRender.id}
nominee={bioModalContent}
isOpen={openLearMoreCategory}
title={bioModalContent?.name}
Expand Down
34 changes: 33 additions & 1 deletion ui/summit-2024/src/pages/Categories/components/BioModal.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,37 @@
import React from "react";
import Modal from "../../../components/common/Modal/Modal";
import { Box, useMediaQuery } from "@mui/material";
import { Box, IconButton, useMediaQuery } from "@mui/material";
import XIcon from "../../../assets/x.svg";
import LinkedinIcon from "../../../assets/linkedin.svg";
import theme from "../../../common/styles/theme";
import { CustomButton } from "../../../components/common/CustomButton/CustomButton";
import { copyToClipboard } from "../../../utils/utils";
import { eventBus, EventName } from "../../../utils/EventBus";
import ShareOutlinedIcon from "@mui/icons-material/ShareOutlined";

interface BioModalProps {
categoryId: string;
nominee: any;
isOpen: boolean;
title: string | null | undefined;
onClose: () => void;
}

const BioModal: React.FC<BioModalProps> = ({
categoryId,
nominee,
isOpen,
title,
onClose,
}) => {
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
const baseUrl = `${window.location.protocol}//${window.location.host}`;
const urlToCopy = `${baseUrl}/categories?category=${categoryId}&nominee=${nominee?.id}`;

const handleCopyToClipBoard = () => {
copyToClipboard(urlToCopy);
eventBus.publish(EventName.ShowToast, "Copied to clipboard");
};

return (
<>
Expand Down Expand Up @@ -75,6 +87,26 @@ const BioModal: React.FC<BioModalProps> = ({
</Box>
) : null}
</Box>
<Box
component="div"
sx={{
width: "53px",

borderRadius: "12px",
cursor: "pointer",
}}
onClick={() => handleCopyToClipBoard()}
>
<IconButton>
<ShareOutlinedIcon
sx={{
width: "32px",
height: "32px",
color: theme.palette.text.neutralLight,
}}
/>
</IconButton>
</Box>
{nominee?.url ? (
<CustomButton
colorVariant="secondary"
Expand Down
4 changes: 2 additions & 2 deletions ui/summit-2024/src/pages/Home/components/ExploreSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ const ExploreSection = () => {
backgroundImage: `url(${guideBg})`,
backgroundSize: "180% 160%",
backgroundPosition: "center",
cursor: "pointer"
cursor: "pointer",
}}
>
<CardContent
Expand Down Expand Up @@ -289,7 +289,7 @@ const ExploreSection = () => {
backgroundImage: `url(${guideBg})`,
backgroundSize: "180% 160%",
backgroundPosition: "center",
cursor: "pointer"
cursor: "pointer",
}}
>
<CardContent sx={{ position: "relative", zIndex: 2 }}>
Expand Down
2 changes: 2 additions & 0 deletions ui/summit-2024/src/pages/Home/components/TicketsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const TicketsSection = () => {
>
<Grid item xs={12}>
<Card
onClick={handleButtonClick}
sx={{
position: "relative",
overflow: "hidden",
Expand All @@ -57,6 +58,7 @@ const TicketsSection = () => {
xs: "16px",
sm: "60px",
},
cursor: "pointer",
}}
>
<Box
Expand Down

0 comments on commit 0c407c7

Please sign in to comment.