From 737344a72d23dc97b0d0e73cc4ab7fdffd0fbf49 Mon Sep 17 00:00:00 2001 From: Brendan F Date: Sun, 14 May 2023 23:12:27 -0700 Subject: Merge in react app code From sluchajfun and youtube-heardle-template --- src/components/Game/index.tsx | 65 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 src/components/Game/index.tsx (limited to 'src/components/Game/index.tsx') diff --git a/src/components/Game/index.tsx b/src/components/Game/index.tsx new file mode 100644 index 0000000..84ca282 --- /dev/null +++ b/src/components/Game/index.tsx @@ -0,0 +1,65 @@ +import React from "react"; + +import { GuessType } from "../../types/guess"; +import { Song } from "../../types/song"; +import { playTimes } from "../../constants"; + +import { Button, Guess, Player, Search, Result } from "../"; + +import * as Styled from "./index.styled"; + +interface Props { + guesses: GuessType[]; + todaysSolution: any; + currentTry: number; + didGuess: boolean; + setSelectedSong: React.Dispatch>; + skip: () => void; + guess: () => void; +} + +export function Game({ + guesses, + todaysSolution, + currentTry, + didGuess, + setSelectedSong, + skip, + guess, +}: Props) { + if (didGuess || currentTry === 6) { + return ( + + ); + } + return ( + <> + {guesses.map((guess: GuessType, index) => ( + + ))} + + + + + + + + + ); +} -- cgit v1.2.3