|
@@ -1,8 +1,8 @@
|
|
import React from "react";
|
|
import React from "react";
|
|
import styled from "styled-components";
|
|
import styled from "styled-components";
|
|
import ClickToCopy from "../../util/ClickToCopy";
|
|
import ClickToCopy from "../../util/ClickToCopy";
|
|
-import Button from "../../util/Button";
|
|
|
|
import usePlayerScores from "../../../hooks/usePlayerScores";
|
|
import usePlayerScores from "../../../hooks/usePlayerScores";
|
|
|
|
+import DelayedButton from "../../util/DelayedButton";
|
|
|
|
|
|
const useTopScorer = (gameId, roundNum) => {
|
|
const useTopScorer = (gameId, roundNum) => {
|
|
const scores = usePlayerScores(gameId);
|
|
const scores = usePlayerScores(gameId);
|
|
@@ -41,7 +41,7 @@ const TimedOut = styled.span`
|
|
color: red;
|
|
color: red;
|
|
`
|
|
`
|
|
|
|
|
|
-const NextButton = styled(Button)`
|
|
|
|
|
|
+const NextButton = styled(DelayedButton)`
|
|
margin-top: 5px;
|
|
margin-top: 5px;
|
|
padding: 1em;
|
|
padding: 1em;
|
|
`
|
|
`
|
|
@@ -69,7 +69,12 @@ export default ({
|
|
<span>Score For Round {roundNum}: {score}</span>
|
|
<span>Score For Round {roundNum}: {score}</span>
|
|
<span>Running Total Score: {totalScore}</span>
|
|
<span>Running Total Score: {totalScore}</span>
|
|
{topPlayer ? <span className="round-summary__top-score">Current best is {topPlayer} with {topScore}</span> : null}
|
|
{topPlayer ? <span className="round-summary__top-score">Current best is {topPlayer} with {topScore}</span> : null}
|
|
- <NextButton onClick={onNext}>{roundNum === "5" ? "View Summary" : "Next Round"}</NextButton>
|
|
|
|
|
|
+ <NextButton
|
|
|
|
+ onEnd={onNext}
|
|
|
|
+ countDownFormatter={rem => `Click to cancel, ${rem}s...`}
|
|
|
|
+ >
|
|
|
|
+ {roundNum === "5" ? "View Summary" : "Next Round"}
|
|
|
|
+ </NextButton>
|
|
</Container>
|
|
</Container>
|
|
);
|
|
);
|
|
}
|
|
}
|