|
@@ -23,7 +23,7 @@ const needsHeaderFooter = {
|
|
const Header = ({ show }) => (
|
|
const Header = ({ show }) => (
|
|
<CSSTransition
|
|
<CSSTransition
|
|
in={show}
|
|
in={show}
|
|
- timeout={1000}
|
|
|
|
|
|
+ timeout={500}
|
|
mountOnEnter
|
|
mountOnEnter
|
|
unmountOnExit
|
|
unmountOnExit
|
|
classNames="state"
|
|
classNames="state"
|
|
@@ -37,7 +37,7 @@ const Header = ({ show }) => (
|
|
const Footer = ({ show }) => (
|
|
const Footer = ({ show }) => (
|
|
<CSSTransition
|
|
<CSSTransition
|
|
in={show}
|
|
in={show}
|
|
- timeout={1000}
|
|
|
|
|
|
+ timeout={500}
|
|
mountOnEnter
|
|
mountOnEnter
|
|
unmountOnExit
|
|
unmountOnExit
|
|
classNames="state"
|
|
classNames="state"
|
|
@@ -51,7 +51,7 @@ const Footer = ({ show }) => (
|
|
const State = ({ show, children, setTransitioning }) => (
|
|
const State = ({ show, children, setTransitioning }) => (
|
|
<CSSTransition
|
|
<CSSTransition
|
|
in={show}
|
|
in={show}
|
|
- timeout={1000}
|
|
|
|
|
|
+ timeout={500}
|
|
mountOnEnter
|
|
mountOnEnter
|
|
unmountOnExit
|
|
unmountOnExit
|
|
classNames="state"
|
|
classNames="state"
|
|
@@ -65,7 +65,7 @@ const State = ({ show, children, setTransitioning }) => (
|
|
)
|
|
)
|
|
|
|
|
|
export default () => {
|
|
export default () => {
|
|
- const [st, setSt] = useState(true);
|
|
|
|
|
|
+ const [transitioning, setTransitioning] = useState(true);
|
|
const gameState = useGameState();
|
|
const gameState = useGameState();
|
|
useDirectGameLinks();
|
|
useDirectGameLinks();
|
|
const needsHF = needsHeaderFooter[gameState];
|
|
const needsHF = needsHeaderFooter[gameState];
|
|
@@ -74,17 +74,17 @@ export default () => {
|
|
<React.StrictMode>
|
|
<React.StrictMode>
|
|
<div className={styles.page}>
|
|
<div className={styles.page}>
|
|
<Header show={needsHF} />
|
|
<Header show={needsHF} />
|
|
- <State show={gameState === PRE_GAME} setTransitioning={setSt}>
|
|
|
|
|
|
+ <State show={gameState === PRE_GAME} setTransitioning={setTransitioning}>
|
|
<HomePage />
|
|
<HomePage />
|
|
</State>
|
|
</State>
|
|
- <State show={gameState === PRE_ROUND} setTransitioning={setSt}>
|
|
|
|
|
|
+ <State show={gameState === PRE_ROUND} setTransitioning={setTransitioning}>
|
|
<Lobby />
|
|
<Lobby />
|
|
</State>
|
|
</State>
|
|
- {!st && gameState === IN_ROUND && <GamePanel />}
|
|
|
|
- <State show={gameState === POST_ROUND} setTransitioning={setSt}>
|
|
|
|
|
|
+ {!transitioning && gameState === IN_ROUND && <GamePanel />}
|
|
|
|
+ <State show={gameState === POST_ROUND} setTransitioning={setTransitioning}>
|
|
<RoundSummary />
|
|
<RoundSummary />
|
|
</State>
|
|
</State>
|
|
- <State show={gameState === POST_GAME} setTransitioning={setSt}>
|
|
|
|
|
|
+ <State show={gameState === POST_GAME} setTransitioning={setTransitioning}>
|
|
<PlayerScores />
|
|
<PlayerScores />
|
|
</State>
|
|
</State>
|
|
<State show={gameState === ERROR}>
|
|
<State show={gameState === ERROR}>
|