From 4d9de4db3a7975d3791bf70e3e02cc4afcd06ae4 Mon Sep 17 00:00:00 2001 From: Justin Schreiner Date: Mon, 25 Nov 2024 12:06:01 -0700 Subject: [PATCH 01/22] add are you sure modal to delete poll flow --- src/components/buttons/deletePollButton.tsx | 5 +- src/pages/polls/[pollId]/index.tsx | 52 ++++++++++++++++++++- 2 files changed, 53 insertions(+), 4 deletions(-) diff --git a/src/components/buttons/deletePollButton.tsx b/src/components/buttons/deletePollButton.tsx index 3b9f6fc..d055f11 100644 --- a/src/components/buttons/deletePollButton.tsx +++ b/src/components/buttons/deletePollButton.tsx @@ -1,6 +1,5 @@ import { useState } from 'react'; import { useRouter } from 'next/router'; -import { DeleteRounded } from '@mui/icons-material'; import Button from '@mui/material/Button'; import { useSession } from 'next-auth/react'; import toast from 'react-hot-toast'; @@ -45,12 +44,12 @@ export function DeletePollButton(props: Props): JSX.Element { return ( ); } else { diff --git a/src/pages/polls/[pollId]/index.tsx b/src/pages/polls/[pollId]/index.tsx index e931e64..86e7618 100644 --- a/src/pages/polls/[pollId]/index.tsx +++ b/src/pages/polls/[pollId]/index.tsx @@ -5,6 +5,7 @@ import Head from 'next/head'; import { useRouter } from 'next/router'; import { pollPhases } from '@/constants/pollPhases'; import { authOptions } from '@/pages/api/auth/[...nextauth]'; +import { DeleteRounded } from '@mui/icons-material'; import LaunchRounded from '@mui/icons-material/LaunchRounded'; import { Button, CircularProgress, Modal, useTheme } from '@mui/material'; import Box from '@mui/material/Box'; @@ -74,6 +75,7 @@ export default function ViewPoll(props: Props): JSX.Element { const [pollResults, setPollResults] = useState(pollResultsSSR); const [isTxUploading, setIsTxUploading] = useState(false); const [modalOpen, setModalOpen] = useState(false); + const [deleteModalOpen, setDeleteModalOpen] = useState(false); useCheckAddressChange(); const session = useSession(); @@ -143,6 +145,14 @@ export default function ViewPoll(props: Props): JSX.Element { setModalOpen(true); } + function handleOpenDeleteModal(): void { + setDeleteModalOpen(true); + } + + function handleCloseDeleteModal(): void { + setDeleteModalOpen(false); + } + return ( <> @@ -263,7 +273,9 @@ export default function ViewPoll(props: Props): JSX.Element { setIsTxUploading={updateIsTxUploading} /> )} - + )} @@ -361,6 +373,44 @@ export default function ViewPoll(props: Props): JSX.Element { + + + + Are you sure you want to delete this Poll? + + + + + + + ); From 7297137f0ffeb234932810010a81ce5414d9327e Mon Sep 17 00:00:00 2001 From: Justin Schreiner Date: Mon, 25 Nov 2024 13:38:19 -0700 Subject: [PATCH 02/22] add clarity logo & github link in footer --- src/components/layout/footer.tsx | 47 +++++++++++++++++++++++++++++++ src/components/layout/layout.tsx | 3 ++ src/components/layout/navbar.tsx | 2 +- src/img/Clarity.png | Bin 0 -> 21205 bytes 4 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 src/components/layout/footer.tsx create mode 100644 src/img/Clarity.png diff --git a/src/components/layout/footer.tsx b/src/components/layout/footer.tsx new file mode 100644 index 0000000..4525e60 --- /dev/null +++ b/src/components/layout/footer.tsx @@ -0,0 +1,47 @@ +import Image from 'next/image'; +import Link from 'next/link'; +import { GitHub } from '@mui/icons-material'; +import { Box, Button } from '@mui/material'; + +import clarity from '../../img/Clarity.png'; + +/** + * Footer with Clarity logo & link to repo + * @returns Footer + */ +export function Footer(): JSX.Element { + return ( + + + Powered by Clarity + + + + ); +} diff --git a/src/components/layout/layout.tsx b/src/components/layout/layout.tsx index 3c7ab06..a969b50 100644 --- a/src/components/layout/layout.tsx +++ b/src/components/layout/layout.tsx @@ -4,6 +4,8 @@ import { Toaster } from 'react-hot-toast'; import { Navbar } from '@/components/layout/navbar'; +import { Footer } from './footer'; + interface Props { children: React.ReactNode; } @@ -61,6 +63,7 @@ export function Layout(props: Props): JSX.Element { > {children} +