-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Single player game play implementation
- Loading branch information
Showing
7 changed files
with
137 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,20 @@ | ||
export const GameQuestion = () => { | ||
import { useState } from "react" | ||
import { Question } from "../../utils/types" | ||
|
||
type GameQuestionPorps = { | ||
question: Question | ||
sendAnswer: (answer: string) => void | ||
} | ||
|
||
export const GameQuestion = (props: GameQuestionPorps) => { | ||
const [answer, setAnswer] = useState("") | ||
|
||
return ( | ||
<div> | ||
<h2>Partie!</h2> | ||
<div>{JSON.stringify(props.question)}</div> | ||
<input placeholder="Réponse" onChange={(e) => setAnswer(e.target.value)} /> | ||
<button onClick={() => props.sendAnswer(answer)}>Repondre</button> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Game } from "../../utils/types" | ||
|
||
type GameReviewProps = { | ||
game: Game | ||
} | ||
|
||
export const GameReview = (props: GameReviewProps) => { | ||
return ( | ||
<div> | ||
<h2>Question Review</h2> | ||
<div>{JSON.stringify(props.game.users)}</div> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters