diff --git a/client/src/app/correspondence/[code]/page.tsx b/client/src/app/correspondence/[code]/page.tsx index 2cf3389..e398990 100644 --- a/client/src/app/correspondence/[code]/page.tsx +++ b/client/src/app/correspondence/[code]/page.tsx @@ -14,6 +14,7 @@ import { useCallback, useEffect, useState } from "react"; import { Chessboard } from "react-chessboard"; import type { Square } from "chess.js"; import { APP_URL } from "@/config"; +import InviteFriendsModal from "@/components/InviteFriendsModal"; export default function CorrespondenceGamePage() { const { user } = useSession(); @@ -194,6 +195,7 @@ export default function CorrespondenceGamePage() { > {copied ? "Kopiert!" : `${APP_URL.replace(/^https?:\/\//, "")}/correspondence/${code}`} + {!isPlayer && user?.id && ( + + {open && ( + +
+ +

{label}

+ {loading ? ( +
+ +
+ ) : friends.length === 0 ? ( +

+ Keine Freunde gefunden. Füge zuerst Freunde hinzu. +

+ ) : ( +
+ {friends.map((f) => ( +
+ {f.friend_name} + +
+ ))} +
+ )} +
+
setOpen(false)} /> +
+ )} + + ); +} diff --git a/client/src/components/game/GamePage.tsx b/client/src/components/game/GamePage.tsx index f794a76..5439261 100644 --- a/client/src/components/game/GamePage.tsx +++ b/client/src/components/game/GamePage.tsx @@ -23,6 +23,7 @@ import type { ClearPremoves } from "react-chessboard"; import { Chessboard } from "react-chessboard"; import { API_URL, APP_URL } from "@/config"; +import InviteFriendsModal from "@/components/InviteFriendsModal"; import { io } from "socket.io-client"; import { lobbyReducer, squareReducer } from "./reducers"; @@ -654,6 +655,11 @@ export default function GamePage({ initialLobby }: { initialLobby: Game }) { + {!lobby.endReason && ( +
+ +
+ )}
{getMoveListHtml()}