feat(components): add navigation to profile on UID click
- Modified `BindKaiqiuAccount` to wrap the UID text in a clickable `Flex` component.
- Added an `ExportOutlined` icon to indicate the actionable link.
- Implemented navigation to `/profile/{uid}` when the UID section is clicked, utilizing the `useNavigate` hook.
- Imported the new icon and navigation hook to support this interaction.
This commit is contained in:
parent
c70aeda412
commit
1793c10b45
@ -1,8 +1,9 @@
|
|||||||
import { useRequest } from "ahooks";
|
import { useRequest } from "ahooks";
|
||||||
import { useAuthHeaders } from "../hooks/useAuthHeaders";
|
import { useAuthHeaders } from "../hooks/useAuthHeaders";
|
||||||
import { Alert, App, Button, Drawer, Flex, Form, Input, Spin, Typography } from "antd";
|
import { Alert, App, Button, Drawer, Flex, Form, Input, Spin, Typography } from "antd";
|
||||||
import { LinkOutlined } from "@ant-design/icons";
|
import { ExportOutlined, LinkOutlined } from "@ant-design/icons";
|
||||||
import { useCallback, useState } from "react";
|
import { useCallback, useState } from "react";
|
||||||
|
import { useNavigate } from "react-router";
|
||||||
|
|
||||||
export const BindKaiqiuAccount = () => {
|
export const BindKaiqiuAccount = () => {
|
||||||
const headers = useAuthHeaders();
|
const headers = useAuthHeaders();
|
||||||
@ -44,10 +45,14 @@ export const BindKaiqiuAccount = () => {
|
|||||||
),
|
),
|
||||||
});
|
});
|
||||||
}, [modal]);
|
}, [modal]);
|
||||||
|
const navigate = useNavigate();
|
||||||
if (isBindReq.data?.isBinded === undefined) return null;
|
if (isBindReq.data?.isBinded === undefined) return null;
|
||||||
if (isBindReq.data?.isBinded) {
|
if (isBindReq.data?.isBinded) {
|
||||||
return (
|
return (
|
||||||
|
<Flex gap={8} onClick={() => navigate(`/profile/${isBindReq.data?.uid}`)}>
|
||||||
<Typography.Text type="secondary">UID: {isBindReq.data?.uid ?? '-'}</Typography.Text>
|
<Typography.Text type="secondary">UID: {isBindReq.data?.uid ?? '-'}</Typography.Text>
|
||||||
|
<ExportOutlined />
|
||||||
|
</Flex>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user