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:
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,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>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user