移除首页的收藏夹切换卡,改成从用户菜单进入
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
Rss,
|
||||
Settings,
|
||||
Shield,
|
||||
Star,
|
||||
User,
|
||||
X,
|
||||
} from 'lucide-react';
|
||||
@@ -30,6 +31,7 @@ import { useVersionCheck } from './VersionCheckProvider';
|
||||
import { VersionPanel } from './VersionPanel';
|
||||
import { OfflineDownloadPanel } from './OfflineDownloadPanel';
|
||||
import { NotificationPanel } from './NotificationPanel';
|
||||
import { FavoritesPanel } from './FavoritesPanel';
|
||||
|
||||
interface AuthInfo {
|
||||
username?: string;
|
||||
@@ -46,6 +48,7 @@ export const UserMenu: React.FC = () => {
|
||||
const [isVersionPanelOpen, setIsVersionPanelOpen] = useState(false);
|
||||
const [isOfflineDownloadPanelOpen, setIsOfflineDownloadPanelOpen] = useState(false);
|
||||
const [isNotificationPanelOpen, setIsNotificationPanelOpen] = useState(false);
|
||||
const [isFavoritesPanelOpen, setIsFavoritesPanelOpen] = useState(false);
|
||||
const [authInfo, setAuthInfo] = useState<AuthInfo | null>(null);
|
||||
const [storageType, setStorageType] = useState<string>('localstorage');
|
||||
const [mounted, setMounted] = useState(false);
|
||||
@@ -700,6 +703,18 @@ export const UserMenu: React.FC = () => {
|
||||
)}
|
||||
</button>
|
||||
|
||||
{/* 我的收藏按钮 */}
|
||||
<button
|
||||
onClick={() => {
|
||||
setIsOpen(false);
|
||||
setIsFavoritesPanelOpen(true);
|
||||
}}
|
||||
className='w-full px-3 py-2 text-left flex items-center gap-2.5 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors text-sm relative'
|
||||
>
|
||||
<Star className='w-4 h-4 text-gray-500 dark:text-gray-400' />
|
||||
<span className='font-medium'>我的收藏</span>
|
||||
</button>
|
||||
|
||||
{/* 设置按钮 */}
|
||||
<button
|
||||
onClick={handleSettings}
|
||||
@@ -1533,6 +1548,17 @@ export const UserMenu: React.FC = () => {
|
||||
/>,
|
||||
document.body
|
||||
)}
|
||||
|
||||
{/* 使用 Portal 将收藏面板渲染到 document.body */}
|
||||
{isFavoritesPanelOpen &&
|
||||
mounted &&
|
||||
createPortal(
|
||||
<FavoritesPanel
|
||||
isOpen={isFavoritesPanelOpen}
|
||||
onClose={() => setIsFavoritesPanelOpen(false)}
|
||||
/>,
|
||||
document.body
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user