From eef4656f8782b996353d51ccddcf6e76c02ab9c8 Mon Sep 17 00:00:00 2001 From: kyuuseiryuu Date: Tue, 17 Mar 2026 11:02:35 +0900 Subject: [PATCH] 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. --- src/page/FavPlayersPage.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/page/FavPlayersPage.tsx b/src/page/FavPlayersPage.tsx index 00737f6..47a9deb 100644 --- a/src/page/FavPlayersPage.tsx +++ b/src/page/FavPlayersPage.tsx @@ -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 { useNavigate } from "react-router"; import { useCallback, useEffect, useMemo, useState } from "react"; -import { useLogto, type IdTokenClaims } from "@logto/react"; -import { DeleteOutlined, LoginOutlined, ShopTwoTone, StarFilled, SyncOutlined, UploadOutlined } from "@ant-design/icons"; +import { useLogto } from "@logto/react"; +import { DeleteOutlined, LoginOutlined, SyncOutlined, UploadOutlined } from "@ant-design/icons"; import { useRequest } from "ahooks"; import type { XCXProfile } from "../types"; import useAutoLogin from "../hooks/useAutoLogin"; @@ -120,7 +120,7 @@ export function FavePlayersPage() { {!favListRequest.loading && list.length === 0 ? ( <> 暂无收藏的球员 - {showType === ShowType.LOCAL && ( + {showType === ShowType.LOCAL && !isAuthenticated && ( )}