mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-02-14 20:57:32 +00:00
Refactor component spacing, typography, and layout to better support mobile devices while maintaining desktop experience. Changes include: - Reduce bottom margins and padding on mobile (mb-3 vs mb-6, px-2.5 vs px-4) - Use responsive text sizes (text-xs sm:text-sm, text-base sm:text-xl) - Add truncation and min-w-0 to prevent text overflow on small screens - Hide non-essential info on mobile (token counts, keyboard shortcuts) - Adjust gap spacing for tighter mobile layouts (gap-1.5 vs gap-3) - Improve button touch targets with refined padding - Update background colors for better contrast (gray-800 vs gray-900) - Add border styling for enhanced component definition Affects ClaudeStatus, CodeEditor, GitPanel, MainContent, MobileNav, QuickSettingsPanel components and global styles. Ensures consistent mobile-first design across the application.
74 lines
2.2 KiB
JavaScript
74 lines
2.2 KiB
JavaScript
import React from 'react';
|
|
import { MessageSquare, Folder, Terminal, GitBranch, Globe, CheckSquare } from 'lucide-react';
|
|
import { useTasksSettings } from '../contexts/TasksSettingsContext';
|
|
|
|
function MobileNav({ activeTab, setActiveTab, isInputFocused }) {
|
|
const { tasksEnabled } = useTasksSettings();
|
|
const navItems = [
|
|
{
|
|
id: 'chat',
|
|
icon: MessageSquare,
|
|
onClick: () => setActiveTab('chat')
|
|
},
|
|
{
|
|
id: 'shell',
|
|
icon: Terminal,
|
|
onClick: () => setActiveTab('shell')
|
|
},
|
|
{
|
|
id: 'files',
|
|
icon: Folder,
|
|
onClick: () => setActiveTab('files')
|
|
},
|
|
{
|
|
id: 'git',
|
|
icon: GitBranch,
|
|
onClick: () => setActiveTab('git')
|
|
},
|
|
// Conditionally add tasks tab if enabled
|
|
...(tasksEnabled ? [{
|
|
id: 'tasks',
|
|
icon: CheckSquare,
|
|
onClick: () => setActiveTab('tasks')
|
|
}] : [])
|
|
];
|
|
|
|
return (
|
|
<div
|
|
className={`fixed bottom-0 left-0 right-0 bg-background border-t border-border z-50 ios-bottom-safe transform transition-transform duration-300 ease-in-out shadow-lg ${
|
|
isInputFocused ? 'translate-y-full' : 'translate-y-0'
|
|
}`}
|
|
>
|
|
<div className="flex items-center justify-around py-1">
|
|
{navItems.map((item) => {
|
|
const Icon = item.icon;
|
|
const isActive = activeTab === item.id;
|
|
|
|
return (
|
|
<button
|
|
key={item.id}
|
|
onClick={item.onClick}
|
|
onTouchStart={(e) => {
|
|
e.preventDefault();
|
|
item.onClick();
|
|
}}
|
|
className={`flex items-center justify-center p-2 rounded-lg min-h-[40px] min-w-[40px] relative touch-manipulation ${
|
|
isActive
|
|
? 'text-blue-600 dark:text-blue-400'
|
|
: 'text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white'
|
|
}`}
|
|
aria-label={item.id}
|
|
>
|
|
<Icon className="w-5 h-5" />
|
|
{isActive && (
|
|
<div className="absolute top-0 left-1/2 transform -translate-x-1/2 w-6 h-0.5 bg-blue-600 dark:bg-blue-400 rounded-full" />
|
|
)}
|
|
</button>
|
|
);
|
|
})}
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default MobileNav; |