diff options
Diffstat (limited to 'frontend/app')
| -rw-r--r-- | frontend/app/components/GolfPlayApp.client.tsx (renamed from frontend/app/components/GolfPlayApp.tsx) | 0 | ||||
| -rw-r--r-- | frontend/app/components/GolfWatchApp.client.tsx (renamed from frontend/app/components/GolfWatchApp.tsx) | 0 | ||||
| -rw-r--r-- | frontend/app/routes/golf.$gameId.play.tsx | 12 | ||||
| -rw-r--r-- | frontend/app/routes/golf.$gameId.watch.tsx | 12 |
4 files changed, 18 insertions, 6 deletions
diff --git a/frontend/app/components/GolfPlayApp.tsx b/frontend/app/components/GolfPlayApp.client.tsx index 3cb512a..3cb512a 100644 --- a/frontend/app/components/GolfPlayApp.tsx +++ b/frontend/app/components/GolfPlayApp.client.tsx diff --git a/frontend/app/components/GolfWatchApp.tsx b/frontend/app/components/GolfWatchApp.client.tsx index 00ad005..00ad005 100644 --- a/frontend/app/components/GolfWatchApp.tsx +++ b/frontend/app/components/GolfWatchApp.client.tsx diff --git a/frontend/app/routes/golf.$gameId.play.tsx b/frontend/app/routes/golf.$gameId.play.tsx index 5868640..3932b4b 100644 --- a/frontend/app/routes/golf.$gameId.play.tsx +++ b/frontend/app/routes/golf.$gameId.play.tsx @@ -1,8 +1,10 @@ import type { LoaderFunctionArgs, MetaFunction } from "@remix-run/node"; +import { useLoaderData } from "@remix-run/react"; +import { ClientOnly } from "remix-utils/client-only"; import { isAuthenticated } from "../.server/auth"; import { apiClient } from "../.server/api/client"; -import { useLoaderData } from "@remix-run/react"; -import GolfPlayApp from "../components/GolfPlayApp"; +import GolfPlayApp from "../components/GolfPlayApp.client"; +import GolfPlayAppConnecting from "../components/GolfPlayApps/GolfPlayAppConnecting"; export const meta: MetaFunction<typeof loader> = ({ data }) => { return [ @@ -60,5 +62,9 @@ export async function loader({ params, request }: LoaderFunctionArgs) { export default function GolfPlay() { const { game, sockToken } = useLoaderData<typeof loader>(); - return <GolfPlayApp game={game} sockToken={sockToken} />; + return ( + <ClientOnly fallback={<GolfPlayAppConnecting />}> + {() => <GolfPlayApp game={game} sockToken={sockToken} />} + </ClientOnly> + ); } diff --git a/frontend/app/routes/golf.$gameId.watch.tsx b/frontend/app/routes/golf.$gameId.watch.tsx index 4093295..eeb6fb9 100644 --- a/frontend/app/routes/golf.$gameId.watch.tsx +++ b/frontend/app/routes/golf.$gameId.watch.tsx @@ -1,8 +1,10 @@ import type { LoaderFunctionArgs, MetaFunction } from "@remix-run/node"; +import { useLoaderData } from "@remix-run/react"; +import { ClientOnly } from "remix-utils/client-only"; import { isAuthenticated } from "../.server/auth"; import { apiClient } from "../.server/api/client"; -import { useLoaderData } from "@remix-run/react"; -import GolfWatchApp from "../components/GolfWatchApp"; +import GolfWatchApp from "../components/GolfWatchApp.client"; +import GolfWatchAppConnecting from "../components/GolfWatchApps/GolfWatchAppConnecting"; export const meta: MetaFunction<typeof loader> = ({ data }) => { return [ @@ -60,5 +62,9 @@ export async function loader({ params, request }: LoaderFunctionArgs) { export default function GolfWatch() { const { game, sockToken } = useLoaderData<typeof loader>(); - return <GolfWatchApp game={game} sockToken={sockToken} />; + return ( + <ClientOnly fallback={<GolfWatchAppConnecting />}> + {() => <GolfWatchApp game={game} sockToken={sockToken} />} + </ClientOnly> + ); } |
