|
@@ -1,4 +1,4 @@
|
|
|
-import React, { useState, useEffect, useRef } from 'react';
|
|
|
+import { useState, useEffect, useRef, forwardRef } from 'react';
|
|
|
import { dispatch } from '../../../domain/gameStore';
|
|
|
import { hasSavedGameInfo } from '../../../domain/localStorageMethods';
|
|
|
import DelayedButton from '../../util/DelayedButton';
|
|
@@ -6,7 +6,7 @@ import GameCreationForm from '../../util/GameCreationForm';
|
|
|
import styles from './HomePage.module.css';
|
|
|
import { CSSTransition } from 'react-transition-group';
|
|
|
|
|
|
-const Rejoin = React.forwardRef((_, ref) => (
|
|
|
+const Rejoin = forwardRef((_, ref) => (
|
|
|
<div className={styles.rejoinSection} ref={ref}>
|
|
|
<span className={styles.rejoinLabel}>Looks like you were in a game before that you didn't finish!</span>
|
|
|
<DelayedButton onEnd={() => dispatch.rejoinGame()} countDownFormatter={(rem) => `Rejoining in ${rem}s...`}>
|
|
@@ -15,7 +15,7 @@ const Rejoin = React.forwardRef((_, ref) => (
|
|
|
</div>
|
|
|
));
|
|
|
|
|
|
-export default () => {
|
|
|
+const HomePage = () => {
|
|
|
const [hasSavedInfo, setHasSavedInfo] = useState(false);
|
|
|
useEffect(() => {
|
|
|
hasSavedGameInfo().then(setHasSavedInfo)
|
|
@@ -30,4 +30,6 @@ export default () => {
|
|
|
<GameCreationForm afterCreate={(gameId) => dispatch.goToLobby(gameId)} />
|
|
|
</div>
|
|
|
);
|
|
|
-}
|
|
|
+};
|
|
|
+
|
|
|
+export default HomePage;
|