Better lobby system
This commit is contained in:
@@ -1,7 +1,27 @@
|
||||
const Lobby = () => {
|
||||
import {FunctionComponent} from "react";
|
||||
import {GHButton} from "./Button";
|
||||
|
||||
interface Props {
|
||||
winner: string | undefined;
|
||||
handleLobbyAction: (action: string) => void;
|
||||
}
|
||||
|
||||
const Lobby: FunctionComponent<Props> = ({winner, handleLobbyAction}) => {
|
||||
|
||||
const onStartClick = () => {
|
||||
console.log('Start Game');
|
||||
handleLobbyAction("START");
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
return (
|
||||
<div>
|
||||
<h1>Lobby</h1>
|
||||
{
|
||||
winner &&
|
||||
<h2>{winner} has won the game!</h2>
|
||||
}
|
||||
<GHButton onClick={onStartClick}>Start Game</GHButton>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user