|
@@ -1,37 +1,12 @@
|
|
import React from 'react';
|
|
import React from 'react';
|
|
-import styled from "styled-components";
|
|
|
|
-import Loading from '../../util/Loading';
|
|
|
|
-import { useGameCoords, usePlayers, useLinkedGame } from '../../../hooks/useGameInfo';
|
|
|
|
|
|
+import { useGameId } from '../../../domain/gameStore';
|
|
|
|
+import { useGameCoords, useLinkedGame, usePlayers } from '../../../hooks/useGameInfo';
|
|
import ClickToCopy from '../../util/ClickToCopy';
|
|
import ClickToCopy from '../../util/ClickToCopy';
|
|
-import SummaryMap from './SummaryMap';
|
|
|
|
|
|
+import Loading from '../../util/Loading';
|
|
import LinkedGame from './LinkedGame';
|
|
import LinkedGame from './LinkedGame';
|
|
|
|
+import styles from './PlayerScores.module.css';
|
|
import ScoreBoard from './ScoreBoard';
|
|
import ScoreBoard from './ScoreBoard';
|
|
-import { useGameId } from '../../../domain/gameStore';
|
|
|
|
-
|
|
|
|
-const Container = styled.div`
|
|
|
|
- display: flex;
|
|
|
|
- flex-flow: column nowrap;
|
|
|
|
- justify-content: space-between;
|
|
|
|
- align-items: center;
|
|
|
|
- height: 100%;
|
|
|
|
-`
|
|
|
|
-
|
|
|
|
-const TopRow = styled.div`
|
|
|
|
- display: flex;
|
|
|
|
- flex-flow: column nowrap;
|
|
|
|
- width: 100%;
|
|
|
|
- justify-content: space-around;
|
|
|
|
- align-items: center;
|
|
|
|
-
|
|
|
|
- @media only screen and (min-width: 600px) and (min-height: 600px) {
|
|
|
|
- flex-flow: row nowrap;
|
|
|
|
- }
|
|
|
|
-`
|
|
|
|
-
|
|
|
|
-const Label = styled.span`
|
|
|
|
- padding: 0.2em;
|
|
|
|
- margin-bottom: 0.5em;
|
|
|
|
-`
|
|
|
|
|
|
+import SummaryMap from './SummaryMap';
|
|
|
|
|
|
export default () => {
|
|
export default () => {
|
|
// poll the game state
|
|
// poll the game state
|
|
@@ -42,20 +17,22 @@ export default () => {
|
|
|
|
|
|
// set up the summary URL
|
|
// set up the summary URL
|
|
const summaryURL = new URL(window.location.href);
|
|
const summaryURL = new URL(window.location.href);
|
|
- summaryURL.searchParams.append("summary", gameId);
|
|
|
|
|
|
+ summaryURL.searchParams.append('summary', gameId);
|
|
|
|
|
|
if (!players || !coords) {
|
|
if (!players || !coords) {
|
|
- return <Loading/>
|
|
|
|
|
|
+ return <Loading />;
|
|
}
|
|
}
|
|
|
|
|
|
return (
|
|
return (
|
|
- <Container>
|
|
|
|
- <TopRow>
|
|
|
|
- <SummaryMap {...{ players, coords }}/>
|
|
|
|
|
|
+ <div className={styles.page}>
|
|
|
|
+ <div className={styles.top}>
|
|
|
|
+ <SummaryMap {...{ players, coords }} />
|
|
<LinkedGame {...{ linkedGame, gameId }} />
|
|
<LinkedGame {...{ linkedGame, gameId }} />
|
|
- </TopRow>
|
|
|
|
|
|
+ </div>
|
|
<ScoreBoard {...{ players }} />
|
|
<ScoreBoard {...{ players }} />
|
|
- <Label><ClickToCopy text={summaryURL.href}>Click here to copy a link to this summary!</ClickToCopy></Label>
|
|
|
|
- </Container>
|
|
|
|
|
|
+ <span className={styles.label}>
|
|
|
|
+ <ClickToCopy text={summaryURL.href}>Click here to copy a link to this summary!</ClickToCopy>
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
);
|
|
);
|
|
-}
|
|
|
|
|
|
+};
|