fix(page): remove unused Antd imports and protect "log in to view cloud collection" button

- Removed unused imports from Ant Design (`message as AntdMessage`, `StarFilled`, `ShopTwoTone`, `DeleteOutlined`, `UploadOutlined`) and `@ant-design/icons`.
- Removed unused `type IdTokenClaims` import from `@logto/react`.
- Updated the logic in the empty list state: the "Log in to view cloud collection" button now only displays when the user is NOT authenticated (`!isAuthenticated`). Previously, it showed even when logged in, which was misleading.

This cleans up the codebase and improves the user experience on the Favorite Players page.
This commit is contained in:
kyuuseiryuu 2026-03-17 11:02:35 +09:00
parent f7cd596084
commit eef4656f87

View File

@ -1,9 +1,9 @@
import { Avatar, Button, Card, Divider, Flex, Image, message as AntdMessage, Popconfirm, Radio, Segmented, Spin, Typography, App } from "antd"; import { Avatar, Button, Card, Divider, Flex, Image, Popconfirm, Radio, Segmented, Spin, Typography, App } from "antd";
import { useFavPlayerStore, type FavPlayer } from "../store/useFavPlayerStore"; import { useFavPlayerStore, type FavPlayer } from "../store/useFavPlayerStore";
import { useNavigate } from "react-router"; import { useNavigate } from "react-router";
import { useCallback, useEffect, useMemo, useState } from "react"; import { useCallback, useEffect, useMemo, useState } from "react";
import { useLogto, type IdTokenClaims } from "@logto/react"; import { useLogto } from "@logto/react";
import { DeleteOutlined, LoginOutlined, ShopTwoTone, StarFilled, SyncOutlined, UploadOutlined } from "@ant-design/icons"; import { DeleteOutlined, LoginOutlined, SyncOutlined, UploadOutlined } from "@ant-design/icons";
import { useRequest } from "ahooks"; import { useRequest } from "ahooks";
import type { XCXProfile } from "../types"; import type { XCXProfile } from "../types";
import useAutoLogin from "../hooks/useAutoLogin"; import useAutoLogin from "../hooks/useAutoLogin";
@ -120,7 +120,7 @@ export function FavePlayersPage() {
{!favListRequest.loading && list.length === 0 ? ( {!favListRequest.loading && list.length === 0 ? (
<> <>
<Divider></Divider> <Divider></Divider>
{showType === ShowType.LOCAL && ( {showType === ShowType.LOCAL && !isAuthenticated && (
<Button type='link' onClick={() => autoSignIn()}></Button> <Button type='link' onClick={() => autoSignIn()}></Button>
)} )}
</> </>