refactor(profile): replace Descriptions with Flex layout and show rank

- remove unused antd imports (Space, Descriptions)
- refactor equipment section to Flex-based rows
- refactor profile meta fields to structured Flex rows
- add rank display next to name and score
This commit is contained in:
kyuuseiryuu 2026-02-18 00:45:12 +09:00
parent a4fc0d0031
commit c26bb93ffa
2 changed files with 31 additions and 16 deletions

View File

@ -1,4 +1,4 @@
import { Avatar, Card, Divider, Flex, Image, Segmented, Space, Typography } from "antd"; import { Avatar, Card, Divider, Flex, Image, Segmented, Typography } from "antd";
import { useFavPlayerStore } from "../store/useFavPlayerStore"; import { useFavPlayerStore } from "../store/useFavPlayerStore";
import { useNavigate } from "react-router"; import { useNavigate } from "react-router";
import { useMemo, useState } from "react"; import { useMemo, useState } from "react";

View File

@ -1,6 +1,6 @@
import React, { useEffect, useMemo } from "react"; import React, { useEffect, useMemo } from "react";
import { Link, useLoaderData, useNavigate } from "react-router"; import { Link, useLoaderData, useNavigate } from "react-router";
import { Avatar, Descriptions, Divider, Flex, FloatButton, Image, Typography } from "antd"; import { Avatar, Divider, Flex, FloatButton, Image, Typography } from "antd";
import { HomeOutlined } from "@ant-design/icons"; import { HomeOutlined } from "@ant-design/icons";
import { useTitle } from "ahooks"; import { useTitle } from "ahooks";
import type { XCXProfile } from "../types/profile"; import type { XCXProfile } from "../types/profile";
@ -49,20 +49,23 @@ function Raket(props: { profile?: XCXProfile | null }) {
return ( return (
<> <>
<Divider></Divider> <Divider></Divider>
<Descriptions> <Flex vertical gap={8}>
<Descriptions.Item label="底板"> <Flex gap={4} align="center">
{qiupaitype} <Typography.Text type="secondary"></Typography.Text>
<Typography.Text>{qiupaitype}</Typography.Text>
<Typography.Text type="secondary" style={{ marginLeft: 4 }}>({qiupai})</Typography.Text> <Typography.Text type="secondary" style={{ marginLeft: 4 }}>({qiupai})</Typography.Text>
</Descriptions.Item> </Flex>
<Descriptions.Item label="正手"> <Flex gap={4} align="center">
{zhengshoutype} <Typography.Text type="secondary"></Typography.Text>
<Typography.Text>{zhengshoutype}</Typography.Text>
<Typography.Text type="secondary" style={{ marginLeft: 4 }}>({zhengshou})</Typography.Text> <Typography.Text type="secondary" style={{ marginLeft: 4 }}>({zhengshou})</Typography.Text>
</Descriptions.Item> </Flex>
<Descriptions.Item label="反手"> <Flex gap={4} align="center">
{fanshoutype} <Typography.Text type="secondary"></Typography.Text>
<Typography.Text>{fanshoutype}</Typography.Text>
<Typography.Text type="secondary" style={{ marginLeft: 4 }}>({fanshou})</Typography.Text> <Typography.Text type="secondary" style={{ marginLeft: 4 }}>({fanshou})</Typography.Text>
</Descriptions.Item> </Flex>
</Descriptions> </Flex>
</> </>
); );
} }
@ -122,9 +125,21 @@ export default function ProfilePage() {
/> />
</Flex> </Flex>
</Typography.Title> </Typography.Title>
<Typography.Text>{profile?.realname}</Typography.Text> <Flex vertical gap={4}>
<Typography.Text>{profile?.score}</Typography.Text> <Flex gap={4}>
<Typography.Text style={{ textAlign: 'center' }}> <Typography.Text></Typography.Text>
<Typography.Text>{profile?.realname}</Typography.Text>
</Flex>
<Flex gap={4}>
<Typography.Text></Typography.Text>
<Typography.Text>{profile?.score}</Typography.Text>
</Flex>
<Flex gap={4}>
<Typography.Text></Typography.Text>
<Typography.Text>{profile?.rank}</Typography.Text>
</Flex>
</Flex>
<Typography.Text style={{ textAlign: 'center', marginTop: 4 }}>
{(tags.length > 0 && tags.reduce((a, b) => (<>{a}<Divider orientation="vertical" />{b}</>)))} {(tags.length > 0 && tags.reduce((a, b) => (<>{a}<Divider orientation="vertical" />{b}</>)))}
</Typography.Text> </Typography.Text>
<Divider></Divider> <Divider></Divider>