mirror of
https://github.com/yude-jp/yude.jp
synced 2024-12-22 12:10:11 +09:00
Fix title during page loading
This commit is contained in:
parent
2b6ca4354d
commit
5276456ac2
@ -1,4 +1,4 @@
|
|||||||
// Base layout
|
// Base layout
|
||||||
import Layout from "../../components/Layout"
|
import Layout from "../../components/Layout"
|
||||||
|
|
||||||
// React
|
// React
|
||||||
@ -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,23 +26,23 @@ export default function UUID() {
|
|||||||
</Layout>
|
</Layout>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
} else {
|
||||||
|
if (!data) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Layout title="読み込み中... - プレイヤー情報">
|
||||||
|
<Players uuid={uuid} />
|
||||||
|
</Layout>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Layout title={data.username + " - " + "プレイヤー情報"}>
|
||||||
|
<Players uuid={uuid} />
|
||||||
|
</Layout>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!data) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Layout title="読み込み中... - プレイヤー情報">
|
|
||||||
<Players uuid={uuid} />
|
|
||||||
</Layout>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Layout title={<PlayerName uuid={uuid.uuid} /> + " - " + "プレイヤー情報"}>
|
|
||||||
<Players uuid={uuid} />
|
|
||||||
</Layout>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user