Skip to content
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
5 changes: 5 additions & 0 deletions SparkyFitnessFrontend/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,8 @@
@apply bg-background text-foreground;
}
}

/* Handling apple safe areas at the bottom bar */
.apple-safe-area {
padding-bottom: env(safe-area-inset-bottom);
}
55 changes: 27 additions & 28 deletions SparkyFitnessFrontend/src/layouts/MainLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,8 @@ const MainLayout: React.FC<MainLayoutProps> = ({ onShowAboutDialog }) => {
</Button>
</div>
</div>
<nav
className={`hidden sm:grid w-full gap-1 ${gridClass} mb-6 bg-slate-200/60 dark:bg-muted/50 p-1 rounded-lg`}
>

<nav className={`hidden sm:grid w-full gap-1 ${gridClass} mb-6 bg-slate-200/60 dark:bg-muted/50 p-1 rounded-lg`}>
{availableTabs.map(({ value, label, icon: Icon }) => (
<Button
key={value}
Expand All @@ -320,31 +319,31 @@ const MainLayout: React.FC<MainLayoutProps> = ({ onShowAboutDialog }) => {
</nav>

{/* Mobile Navigation */}
<nav
className={`grid w-full gap-1 fixed bottom-0 left-0 right-0 sm:hidden bg-background border-t py-2 px-2 h-14 z-50 ${mobileGridClass}`}
>
{availableMobileTabs.map(({ value, label, icon: Icon }) => (
<Button
key={value}
variant="ghost"
className={`flex flex-col items-center gap-1 py-2 ${
location.pathname ===
(value === 'Add' ? location.pathname : value)
? 'text-primary'
: ''
}`}
onClick={() => {
if (value === 'Add') {
setIsAddCompOpen((prev) => !prev);
} else {
setIsAddCompOpen(false);
navigate(value);
}
}}
>
<Icon className="h-8 w-8" />
</Button>
))}
<nav className="apple-safe-area sm:hidden fixed bottom-0 left-0 right-0 z-50 w-full bg-background border-t">
<div className={`h-14 grid ${mobileGridClass} items-center justify-items-center`}>
{availableMobileTabs.map(({ value, label, icon: Icon }) => (
<Button
key={value}
variant="ghost"
className={`flex flex-col items-center gap-1 py-2 ${
location.pathname ===
(value === 'Add' ? location.pathname : value)
? 'text-primary'
: ''
}`}
onClick={() => {
if (value === 'Add') {
setIsAddCompOpen((prev) => !prev);
} else {
setIsAddCompOpen(false);
navigate(value);
}
}}
>
<Icon className="h-8 w-8" />
</Button>
))}
</div>
</nav>

<div className="pb-16 sm:pb-0">
Expand Down
Loading