From 5276456ac2cc2f282e1f70859d5b580f069112c6 Mon Sep 17 00:00:00 2001 From: yudejp Date: Sun, 26 Sep 2021 13:24:10 +0900 Subject: [PATCH] Fix title during page loading --- pages/minecraft/players/[uuid].js | 41 +++++++++++++++---------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/pages/minecraft/players/[uuid].js b/pages/minecraft/players/[uuid].js index 281b554..c0ad62a 100644 --- a/pages/minecraft/players/[uuid].js +++ b/pages/minecraft/players/[uuid].js @@ -1,4 +1,4 @@ -// Base layout + // Base layout import Layout from "../../components/Layout" // React @@ -15,10 +15,9 @@ export default function UUID() { const router = useRouter() const { uuid } = router.query const { data, error } = useSwr( - router.query.id ? `/api/user/${router.query.id}` : null, + uuid ? `/api/PlayerName/${uuid}` : null, fetcher ) - if (error) { return ( <> @@ -27,23 +26,23 @@ export default function UUID() { ) + } else { + if (!data) { + return ( + <> + + + + + ) + } else { + return ( + <> + + + + + ) + } } - - if (!data) { - return ( - <> - - - - - ) - } - - return ( - <> - + " - " + "プレイヤー情報"}> - - - - ) }