feat: add skeleton on Domain Finder page

This commit is contained in:
Maël Gangloff
2024-07-27 17:02:21 +02:00
parent 68392dd8ec
commit eaab8ce1b2
2 changed files with 135 additions and 107 deletions

View File

@@ -1,7 +1,25 @@
import React from "react";
import React, {useEffect, useState} from "react";
import {Card, Flex, Skeleton, Typography} from "antd";
import {getUser, User} from "../../utils/api";
export default function UserPage() {
return <p>
My Account Page
</p>
const [user, setUser] = useState<User | null>(null)
useEffect(() => {
getUser().then(setUser)
}, [])
return <Skeleton loading={user === null} active>
<Flex gap="middle" align="center" justify="center" vertical>
<Card title="My Account">
<Typography.Paragraph>
Username : {user?.email}
</Typography.Paragraph>
<Typography.Paragraph>
Roles : {user?.roles.join(',')}
</Typography.Paragraph>
</Card>
</Flex>
</Skeleton>
}