Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui): enhance sidebar responsiveness for split-screen scenarios #150

Merged
merged 1 commit into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions frontend/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,11 @@
}
}

.scrollbar-hide::-webkit-scrollbar {
display: none;
}
.scrollbar-hide {
-ms-overflow-style: none;
scrollbar-width: none;
}

14 changes: 7 additions & 7 deletions frontend/src/components/Navigation/Sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,38 +34,38 @@ function Sidebar() {
'h-5 w-5 transition-transform duration-200 ease-out group-hover:scale-110';

return (
<div className="sidebar text-theme-dark dark:text-theme-light bg-theme-light m-4 flex w-36 flex-col justify-between rounded-2xl border border-gray-300 p-4 backdrop-blur-md backdrop-saturate-150 dark:border-white/10 dark:bg-white/5">
<div className="sidebar text-theme-dark dark:text-theme-light bg-theme-light m-2 sm:m-4 flex flex-col justify-between rounded-lg sm:rounded-2xl border border-gray-300 p-2 sm:p-4 backdrop-blur-md backdrop-saturate-150 dark:border-white/10 dark:bg-white/5 w-full sm:w-36">
<div className="mt-2 flex flex-col gap-4">
<Link to="/home" className={linkClasses('/home')}>
<Home
className={iconClasses}
strokeWidth={isActive('/home') ? 2.5 : 2}
/>
<span className="text-sm font-medium">Home</span>
<span className="text-xs sm:text-sm font-medium">Home</span>
</Link>

<Link to="/ai-tagging" className={linkClasses('/ai-tagging')}>
<Sparkles
className={iconClasses}
strokeWidth={isActive('/ai-tagging') ? 2.5 : 2}
/>
<span className="text-sm font-medium">AI Tagging</span>
<span className="text-xs sm:text-sm font-medium">AI Tagging</span>
</Link>

<Link to="/videos" className={linkClasses('/videos')}>
<Video
className={iconClasses}
strokeWidth={isActive('/videos') ? 2.5 : 2}
/>
<span className="text-sm font-medium">Videos</span>
<span className="text-xs sm:text-sm font-medium">Videos</span>
</Link>

<Link to="/albums" className={linkClasses('/albums')}>
<Images
className={iconClasses}
strokeWidth={isActive('/albums') ? 2.5 : 2}
/>
<span className="text-sm font-medium">Albums</span>
<span className="text-xs sm:text-sm font-medium">Albums</span>
</Link>
</div>

Expand All @@ -74,10 +74,10 @@ function Sidebar() {
className={`${iconClasses} transform transition-transform group-hover:rotate-90`}
strokeWidth={isActive('/settings') ? 2.5 : 2}
/>
<span className="text-sm font-medium">Settings</span>
<span className="text-xs sm:text-sm font-medium">Settings</span>
</Link>
</div>
);
}

export default Sidebar;
export default Sidebar;
7 changes: 6 additions & 1 deletion frontend/src/layout/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ const Layout: React.FC<{ children: React.ReactNode }> = ({ children }) => {
<div className="flex w-full flex-col">
<Navbar title="User" />
<div className="sidebar flex" style={{ height: 'calc(100vh - 92px)' }}>
<Sidebar />
<div
className="scrollbar-hide h-full overflow-y-auto"
style={{ WebkitOverflowScrolling: 'touch' }}
>
<Sidebar />
</div>
<div className="flex flex-1 overflow-x-auto p-4">{children}</div>
</div>
</div>
Expand Down