diff --git a/src/app/page.tsx b/src/app/page.tsx index 56eb325..806e2e2 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,6 +1,7 @@ import Box from "@mui/material/Box"; import { eq } from "drizzle-orm"; +import { Popup } from "@/components/ui/Button/Popup"; import db from "@/db"; import { eventAttendees } from "@/db/schema"; import WelcomeCard from "@/features/home/components/WelcomeCard"; @@ -59,6 +60,8 @@ export default async function HomePage(): Promise { + + ); } diff --git a/src/components/ui/Button/Popup.tsx b/src/components/ui/Button/Popup.tsx new file mode 100644 index 0000000..3faec99 --- /dev/null +++ b/src/components/ui/Button/Popup.tsx @@ -0,0 +1,87 @@ +"use client"; + +import { Box, Button, Typography } from "@mui/material"; +import React, { useState } from "react"; + +type Props = { + buttonLabel: string; + title?: string; + message?: string; +}; + +export function Popup({ + buttonLabel, + title = "Popup", + message = "Popup goes here.", +}: Props): React.ReactElement { + const [isOpen, setIsOpen] = useState(false); + + const openPopup = (): void => setIsOpen(true); + const closePopup = (): void => setIsOpen(false); + + return ( + <> + + + + + {isOpen && ( + + e.stopPropagation()} + sx={{ + bgcolor: "white", + borderRadius: 2, + p: 3, + minWidth: 300, + position: "relative", + boxShadow: 24, + }} + > + + + + {title} + + + {message} + + + )} + + ); +}