diff --git a/src/app/page.tsx b/src/app/page.tsx index 0b2200d..e593261 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -75,15 +75,7 @@ export default function Home() { - - - + ); diff --git a/src/components/Game.tsx b/src/components/Game.tsx index 244e21d..4ef4ac0 100644 --- a/src/components/Game.tsx +++ b/src/components/Game.tsx @@ -27,6 +27,7 @@ import { COLUMNS } from "@/lib/constants"; import { useSocket } from "@/hooks/useSocket"; import { GameType } from "@/lib/gameType"; import { usePathname } from "next/navigation"; +import InstructionsModal from "./InstructionsModal"; interface GameProps { clientId: string; @@ -64,6 +65,11 @@ export default function Game({ clientId }: GameProps): JSX.Element { onClose: closeGuessCharacterModal, } = useDisclosure(); + const { + isOpen: isInstructionsModalOpen, + onClose: closeInstructionsModal, + } = useDisclosure({ defaultIsOpen: true }); + const { socketConnection, yourCharacter, @@ -302,6 +308,10 @@ export default function Game({ clientId }: GameProps): JSX.Element { playerCount={playerCount} /> )} + - - How it works - - - - - - - Goal - - { - "Guess your opponent's secret character before they guess who you are." - } - - - - - Start Up - - {"Copy the invite link in the game room and send it to a friend."} - - - - - Playing - - { - "You and your opponent take turns asking and answering questions." - } - - - - - Your Turn - - { - "Answer your opponent's question, then ask your opponent a question about their secret character." - } - - - - - Tip - - {"If you can't think of a question, click the "} - - - Ask AI ✨ - - {" button for some inspiration!"} - - - - Their Turn - - { - "Eliminate characters on your board while your opponent thinks of their next question." - } - - - - - Winning - - {"Guess your opponent's secret character correctly!"} - - - - - Theme - - { - "Toggle dark and light mode by clicking the button in the top left." - } - - - - - Donate - - {"Support this project by sponsoring me on GitHub"} - - - - - - - - - - - - - - - - + + + + How it works + + + + + + + Goal + + { + "Guess your opponent's secret character before they guess who you are." + } + + + + + Start Up + + { + "Copy the invite link in the game room and send it to a friend." + } + + + + + Playing + + { + "You and your opponent take turns asking and answering questions." + } + + + + + Your Turn + + { + "Answer your opponent's question, then ask your opponent a question about their secret character." + } + + + + + Tip + + {"If you can't think of a question, click the "} + + + Ask AI ✨ + + {" button for some inspiration!"} + + + + Their Turn + + { + "Eliminate characters on your board while your opponent thinks of their next question." + } + + + + + Winning + + {"Guess your opponent's secret character correctly!"} + + + + + Theme + + { + "Toggle dark and light mode by clicking the button in the top left." + } + + + + + Donate + + {"Support this project by sponsoring me on GitHub"} + + + + + + + + + + + + + + + + + ); } diff --git a/src/components/InstructionsModal.tsx b/src/components/InstructionsModal.tsx new file mode 100644 index 0000000..96bb5b4 --- /dev/null +++ b/src/components/InstructionsModal.tsx @@ -0,0 +1,33 @@ +import { + Checkbox, + HStack, + Modal, + ModalBody, + ModalCloseButton, + ModalContent, + ModalOverlay, + Text, +} from "@chakra-ui/react"; +import Instructions from "./Instructions"; + +interface InstructionsModalProps { + isOpen: boolean; + onClose: () => void; +} + +export default function InstructionsModal({ + isOpen, + onClose, +}: InstructionsModalProps): JSX.Element { + return ( + + + + + + + + + + ); +} diff --git a/src/components/QuestionModal.tsx b/src/components/QuestionModal.tsx index 1fc4bfc..4a32c56 100644 --- a/src/components/QuestionModal.tsx +++ b/src/components/QuestionModal.tsx @@ -106,7 +106,7 @@ export default function QuestionModal({ -