0
0
mirror of https://github.com/yude-jp/yude.jp synced 2024-12-22 20:20:09 +09:00

Fix title during page loading

This commit is contained in:
yude 2021-09-26 13:24:10 +09:00
parent 2b6ca4354d
commit 5276456ac2
Signed by: yude
GPG Key ID: EB0FE5D925C4A968

View File

@ -15,10 +15,9 @@ export default function UUID() {
const router = useRouter() const router = useRouter()
const { uuid } = router.query const { uuid } = router.query
const { data, error } = useSwr( const { data, error } = useSwr(
router.query.id ? `/api/user/${router.query.id}` : null, uuid ? `/api/PlayerName/${uuid}` : null,
fetcher fetcher
) )
if (error) { if (error) {
return ( return (
<> <>
@ -27,8 +26,7 @@ export default function UUID() {
</Layout> </Layout>
</> </>
) )
} } else {
if (!data) { if (!data) {
return ( return (
<> <>
@ -37,13 +35,14 @@ export default function UUID() {
</Layout> </Layout>
</> </>
) )
} } else {
return ( return (
<> <>
<Layout title={<PlayerName uuid={uuid.uuid} /> + " - " + "プレイヤー情報"}> <Layout title={data.username + " - " + "プレイヤー情報"}>
<Players uuid={uuid} /> <Players uuid={uuid} />
</Layout> </Layout>
</> </>
) )
} }
}
}