|
@@ -5,7 +5,6 @@ import Button from "../../util/Button";
|
|
import PlayerScoreTile from "./PlayerScoreTile";
|
|
import PlayerScoreTile from "./PlayerScoreTile";
|
|
import useGameInfo from '../../../hooks/useGameInfo';
|
|
import useGameInfo from '../../../hooks/useGameInfo';
|
|
import ClickToCopy from '../../util/ClickToCopy';
|
|
import ClickToCopy from '../../util/ClickToCopy';
|
|
-import HeaderAndFooter from '../../util/HeaderAndFooter';
|
|
|
|
import { useGameId, dispatch } from '../../../domain/gameStore';
|
|
import { useGameId, dispatch } from '../../../domain/gameStore';
|
|
import { linkGame } from '../../../domain/apiMethods';
|
|
import { linkGame } from '../../../domain/apiMethods';
|
|
import GameCreationForm from '../../util/GameCreationForm';
|
|
import GameCreationForm from '../../util/GameCreationForm';
|
|
@@ -61,27 +60,25 @@ export default () => {
|
|
}
|
|
}
|
|
|
|
|
|
return (
|
|
return (
|
|
- <HeaderAndFooter>
|
|
|
|
- <Container>
|
|
|
|
- <ScoreBoard>
|
|
|
|
- {
|
|
|
|
- players
|
|
|
|
- .filter(({ currentRound }) => currentRound === null)
|
|
|
|
- .sort((p1, p2) => p1.totalScore > p2.totalScore ? -1 : (p1.totalScore < p2.totalScore ? 1 : 0))
|
|
|
|
- .map((data) => <PlayerScoreTile key={data.name} {...data} />)
|
|
|
|
- }
|
|
|
|
- </ScoreBoard>
|
|
|
|
- <LinkedGameContainer>
|
|
|
|
- {
|
|
|
|
- linkedGame
|
|
|
|
- ? <StyledButton onClick={() => dispatch.goToLobby(linkedGame)}>
|
|
|
|
- Continue to Linked Game Lobby
|
|
|
|
- </StyledButton>
|
|
|
|
- : <GameCreationForm afterCreate={linkId => linkGame(gameId, linkId)}/>
|
|
|
|
- }
|
|
|
|
- </LinkedGameContainer>
|
|
|
|
- <Label><ClickToCopy text={getUrl(gameId)}>Click here to copy a link to this summary!</ClickToCopy></Label>
|
|
|
|
- </Container>
|
|
|
|
- </HeaderAndFooter>
|
|
|
|
|
|
+ <Container>
|
|
|
|
+ <ScoreBoard>
|
|
|
|
+ {
|
|
|
|
+ players
|
|
|
|
+ .filter(({ currentRound }) => currentRound === null)
|
|
|
|
+ .sort((p1, p2) => p1.totalScore > p2.totalScore ? -1 : (p1.totalScore < p2.totalScore ? 1 : 0))
|
|
|
|
+ .map((data) => <PlayerScoreTile key={data.name} {...data} />)
|
|
|
|
+ }
|
|
|
|
+ </ScoreBoard>
|
|
|
|
+ <LinkedGameContainer>
|
|
|
|
+ {
|
|
|
|
+ linkedGame
|
|
|
|
+ ? <StyledButton onClick={() => dispatch.goToLobby(linkedGame)}>
|
|
|
|
+ Continue to Linked Game Lobby
|
|
|
|
+ </StyledButton>
|
|
|
|
+ : <GameCreationForm afterCreate={linkId => linkGame(gameId, linkId)}/>
|
|
|
|
+ }
|
|
|
|
+ </LinkedGameContainer>
|
|
|
|
+ <Label><ClickToCopy text={getUrl(gameId)}>Click here to copy a link to this summary!</ClickToCopy></Label>
|
|
|
|
+ </Container>
|
|
);
|
|
);
|
|
}
|
|
}
|