Skip to content

Commit f2dba7e

Browse files
committed
feat: modernize mobile layout with shadcn/ui tabs and improved navigation
- Replace custom button-based mobile navigation with professional shadcn/ui tabs - Add @radix-ui/react-tabs dependency for accessible tab functionality - Refactor MobileLayout component to use Tabs, TabsList, TabsTrigger, and TabsContent - Implement proper tab state management with automatic editor switching - Add vertical divider between tabs and user avatar in mobile toolbar - Preserve master password functionality in mobile UserButton menu - Split MainLayout into separate Desktop and Mobile layout components - Update folder panel to show full width on mobile, fixed width on desktop - Hide desktop user profile section on mobile devices - Add scroll support to ChangeMasterPasswordDialog for better mobile UX - Remove back arrow from notes panel on mobile for cleaner interface
1 parent 8b78605 commit f2dba7e

File tree

10 files changed

+430
-332
lines changed

10 files changed

+430
-332
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
"@radix-ui/react-label": "^2.1.7",
6868
"@radix-ui/react-scroll-area": "^1.2.9",
6969
"@radix-ui/react-slot": "^1.2.3",
70+
"@radix-ui/react-tabs": "^1.1.13",
7071
"@tailwindcss/vite": "^4.1.11",
7172
"@tiptap/extension-code-block-lowlight": "^2.26.1",
7273
"@tiptap/extension-task-item": "^2.26.1",

pnpm-lock.yaml

Lines changed: 90 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/folders/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ export default function FolderPanel({
206206

207207
return (
208208
<>
209-
<div className="border-border bg-background flex h-full w-64 flex-col overflow-hidden border-r transition-all duration-300">
209+
<div className="border-border bg-background flex h-full w-full md:w-64 flex-col overflow-hidden border-r transition-all duration-300">
210210
<div className="border-border h-17 shrink-0 border-b p-3">
211211
<div className="flex items-center justify-between">
212212
<h3 className="text-foreground text-lg font-semibold">Folders</h3>
@@ -286,7 +286,7 @@ export default function FolderPanel({
286286
<ThemeToggle />
287287
</div>
288288

289-
<div className="border-border mt-auto border-t p-4">
289+
<div className="border-border mt-auto border-t p-4 hidden md:block">
290290
<div className="flex items-center gap-3">
291291
<UserButton
292292
appearance={{
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import FolderPanel from '@/components/folders';
2+
import NotesPanel from '@/components/notes/NotesPanel';
3+
import Index from '@/components/editor';
4+
import type { FolderPanelProps, FilesPanelProps, EditorProps } from '@/types/layout';
5+
6+
interface DesktopLayoutProps {
7+
folderSidebarOpen: boolean;
8+
filesPanelOpen: boolean;
9+
folderPanelProps: FolderPanelProps;
10+
filesPanelProps: FilesPanelProps;
11+
editorProps: EditorProps;
12+
}
13+
14+
export function DesktopLayout({
15+
folderSidebarOpen,
16+
filesPanelOpen,
17+
folderPanelProps,
18+
filesPanelProps,
19+
editorProps,
20+
}: DesktopLayoutProps) {
21+
return (
22+
<div className="bg-background flex h-screen">
23+
<FolderPanel isOpen={folderSidebarOpen} {...folderPanelProps} />
24+
<NotesPanel isOpen={filesPanelOpen} {...filesPanelProps} />
25+
<div className="flex flex-1 flex-col">
26+
<main className="flex-1 overflow-hidden">
27+
<Index {...editorProps} />
28+
</main>
29+
</div>
30+
</div>
31+
);
32+
}

0 commit comments

Comments
 (0)