feat: remove Learning module
This commit is contained in:
@@ -1,37 +0,0 @@
|
||||
import { FolderKanban } from 'lucide-react';
|
||||
import { useLocation, useNavigate } from 'react-router-dom';
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
type LearningSidebarProps = {
|
||||
sidebarCollapsed: boolean;
|
||||
};
|
||||
|
||||
export function LearningSidebar({ sidebarCollapsed }: LearningSidebarProps) {
|
||||
const navigate = useNavigate();
|
||||
const location = useLocation();
|
||||
const active = location.pathname === '/learning' || location.pathname.startsWith('/learning/project/');
|
||||
|
||||
return (
|
||||
<nav data-testid="sidebar-learning-navigation" aria-label="AI 学习导航" className="px-1 py-1">
|
||||
<button
|
||||
type="button"
|
||||
aria-label="学习项目"
|
||||
aria-current={active ? 'page' : undefined}
|
||||
onClick={() => navigate('/learning')}
|
||||
className={cn(
|
||||
'motion-press flex min-h-10 w-full items-center gap-2 rounded-lg px-2 py-2 text-left text-sm font-semibold transition-colors duration-100',
|
||||
active ? 'bg-brand-soft text-foreground' : 'text-foreground hover:bg-surface-subtle',
|
||||
sidebarCollapsed && 'justify-center px-0',
|
||||
)}
|
||||
>
|
||||
<FolderKanban className="h-4 w-4 shrink-0 text-brand" />
|
||||
{!sidebarCollapsed ? <span>学习项目</span> : null}
|
||||
</button>
|
||||
{!sidebarCollapsed ? (
|
||||
<p className="px-2 pt-3 text-xs leading-5 text-muted-foreground">
|
||||
阅读项目说明并下载到电脑实践。
|
||||
</p>
|
||||
) : null}
|
||||
</nav>
|
||||
);
|
||||
}
|
||||
@@ -40,7 +40,6 @@ import { useCurrentUserProfile } from '@/hooks/use-current-user-profile';
|
||||
import type { SidebarPeekSource } from './sidebar-peek';
|
||||
import { ModuleSwitcher } from './ModuleSwitcher';
|
||||
import { ImageWorkspaceSidebar } from './ImageWorkspaceSidebar';
|
||||
import { LearningSidebar } from './LearningSidebar';
|
||||
import { SidebarUpdateButton } from './SidebarUpdateButton';
|
||||
import { UserAvatar } from '@/components/profile/UserAvatar';
|
||||
import { getAccountInitial } from '@/components/profile/user-avatar-utils';
|
||||
@@ -185,7 +184,6 @@ export function Sidebar({ workspaceLayout = false, sidebarPeekOpen = false, onSi
|
||||
const activeModule = getAiModuleForPath(location.pathname);
|
||||
const isProgrammingModule = activeModule === 'programming';
|
||||
const isPaintingModule = activeModule === 'painting';
|
||||
const isLearningModule = activeModule === 'learning';
|
||||
const isRobotModule = activeModule === 'robot';
|
||||
const isPromptMuseum = location.pathname === '/image-prompts' || location.pathname.startsWith('/image-prompts/');
|
||||
const projectConfigPath = '/project-config';
|
||||
@@ -672,8 +670,6 @@ export function Sidebar({ workspaceLayout = false, sidebarPeekOpen = false, onSi
|
||||
) : null}
|
||||
</div>
|
||||
</>
|
||||
) : isLearningModule ? (
|
||||
<LearningSidebar sidebarCollapsed={sidebarCollapsed} />
|
||||
) : (
|
||||
<div data-testid="sidebar-robot-navigation" className="px-2 py-3">
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user