From aad99fd935727e38188e46ac39011084f0191c13 Mon Sep 17 00:00:00 2001 From: Haileyesus Date: Mon, 2 Mar 2026 18:38:17 +0300 Subject: [PATCH] refactor(AppContent): update MobileNav import path and add MobileNav component --- src/components/app/AppContent.tsx | 2 +- .../{MobileNav.jsx => app/MobileNav.tsx} | 28 +++++++++++-------- 2 files changed, 17 insertions(+), 13 deletions(-) rename src/components/{MobileNav.jsx => app/MobileNav.tsx} (78%) diff --git a/src/components/app/AppContent.tsx b/src/components/app/AppContent.tsx index 1168919a..8142b223 100644 --- a/src/components/app/AppContent.tsx +++ b/src/components/app/AppContent.tsx @@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next'; import Sidebar from '../sidebar/view/Sidebar'; import MainContent from '../main-content/view/MainContent'; -import MobileNav from '../MobileNav'; +import MobileNav from './MobileNav'; import { useWebSocket } from '../../contexts/WebSocketContext'; import { useDeviceSettings } from '../../hooks/useDeviceSettings'; diff --git a/src/components/MobileNav.jsx b/src/components/app/MobileNav.tsx similarity index 78% rename from src/components/MobileNav.jsx rename to src/components/app/MobileNav.tsx index 922b3642..c6f08156 100644 --- a/src/components/MobileNav.jsx +++ b/src/components/app/MobileNav.tsx @@ -1,7 +1,15 @@ import { MessageSquare, Folder, Terminal, GitBranch, ClipboardCheck } from 'lucide-react'; -import { useTasksSettings } from '../contexts/TasksSettingsContext'; +import { useTasksSettings } from '../../contexts/TasksSettingsContext'; +import { Dispatch, SetStateAction } from 'react'; +import { AppTab } from '../../types/app'; -function MobileNav({ activeTab, setActiveTab, isInputFocused }) { +type MobileNavProps = { + activeTab: AppTab; + setActiveTab: Dispatch>; + isInputFocused: boolean; +}; + +export default function MobileNav({ activeTab, setActiveTab, isInputFocused }: MobileNavProps) { const { tasksEnabled, isTaskMasterInstalled } = useTasksSettings(); const shouldShowTasksTab = Boolean(tasksEnabled && isTaskMasterInstalled); @@ -40,9 +48,8 @@ function MobileNav({ activeTab, setActiveTab, isInputFocused }) { return (
@@ -58,11 +65,10 @@ function MobileNav({ activeTab, setActiveTab, isInputFocused }) { e.preventDefault(); item.onClick(); }} - className={`flex flex-col items-center justify-center gap-0.5 px-3 py-2 rounded-xl flex-1 relative touch-manipulation transition-all duration-200 active:scale-95 ${ - isActive - ? 'text-primary' - : 'text-muted-foreground hover:text-foreground' - }`} + className={`flex flex-col items-center justify-center gap-0.5 px-3 py-2 rounded-xl flex-1 relative touch-manipulation transition-all duration-200 active:scale-95 ${isActive + ? 'text-primary' + : 'text-muted-foreground hover:text-foreground' + }`} aria-label={item.label} aria-current={isActive ? 'page' : undefined} > @@ -84,5 +90,3 @@ function MobileNav({ activeTab, setActiveTab, isInputFocused }) {
); } - -export default MobileNav;