|
@@ -2,16 +2,24 @@ import React from "react";
|
|
|
import { linkGame } from "../../../domain/apiMethods";
|
|
|
import { dispatch } from "../../../domain/gameStore";
|
|
|
import GameCreationForm from "../../util/GameCreationForm";
|
|
|
+import { useGameConfig } from "../../../hooks/useGameInfo";
|
|
|
import styles from "./GameSummary.module.css";
|
|
|
|
|
|
-export default React.memo(({ linkedGame, gameId }) => (
|
|
|
- <div className={styles.linked}>
|
|
|
- {linkedGame ? (
|
|
|
- <button onClick={() => dispatch.goToLobby(linkedGame)} type="button">
|
|
|
- Continue to Linked Game Lobby
|
|
|
- </button>
|
|
|
- ) : (
|
|
|
- <GameCreationForm afterCreate={linkId => linkGame(gameId, linkId)} />
|
|
|
- )}
|
|
|
- </div>
|
|
|
-));
|
|
|
+export default React.memo(({ linkedGame, gameId }) => {
|
|
|
+ const lastSettings = useGameConfig();
|
|
|
+
|
|
|
+ return (
|
|
|
+ <div className={styles.linked}>
|
|
|
+ {linkedGame ? (
|
|
|
+ <button onClick={() => dispatch.goToLobby(linkedGame)} type="button">
|
|
|
+ Continue to Linked Game Lobby
|
|
|
+ </button>
|
|
|
+ ) : (
|
|
|
+ <GameCreationForm
|
|
|
+ afterCreate={linkId => linkGame(gameId, linkId)}
|
|
|
+ lastSettings={lastSettings}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+});
|