From cbf95d0cd12204f85a5ab4ceba52bf059e18ade5 Mon Sep 17 00:00:00 2001 From: hfcRed Date: Sat, 7 Mar 2026 09:45:11 +0100 Subject: [PATCH] Layout cleanup --- app/components/SideNav.module.css | 12 +++++------- app/components/layout/NavDialog.tsx | 1 + app/components/layout/TopNavMenus.module.css | 13 +++++-------- app/components/layout/TopRightButtons.module.css | 2 +- app/components/layout/TopRightButtons.tsx | 2 -- app/components/layout/index.module.css | 10 ++++------ app/components/layout/index.tsx | 9 --------- 7 files changed, 16 insertions(+), 33 deletions(-) diff --git a/app/components/SideNav.module.css b/app/components/SideNav.module.css index abb1d6462..29535349c 100644 --- a/app/components/SideNav.module.css +++ b/app/components/SideNav.module.css @@ -8,8 +8,12 @@ top: 0; left: 0; height: 100dvh; - display: flex; + display: none; flex-direction: column; + + @media screen and (min-width: 600px) { + display: flex; + } } .sideNavCollapsed { @@ -314,9 +318,3 @@ .listLinkBadgeWarning { background-color: var(--color-text-second); } - -@media screen and (max-width: 599px) { - .sideNav { - display: none; - } -} diff --git a/app/components/layout/NavDialog.tsx b/app/components/layout/NavDialog.tsx index 22c7ece6c..4aa1bb85a 100644 --- a/app/components/layout/NavDialog.tsx +++ b/app/components/layout/NavDialog.tsx @@ -11,6 +11,7 @@ import { Image } from "../Image"; import { LogInButtonContainer } from "./LogInButtonContainer"; import styles from "./NavDialog.module.css"; +// xxx: deprecate? export function NavDialog({ isOpen, close, diff --git a/app/components/layout/TopNavMenus.module.css b/app/components/layout/TopNavMenus.module.css index c20bfd72f..3a523f265 100644 --- a/app/components/layout/TopNavMenus.module.css +++ b/app/components/layout/TopNavMenus.module.css @@ -1,7 +1,10 @@ .container { - display: flex; + display: none; align-items: center; - gap: var(--s-1); + + @media screen and (min-width: 600px) { + display: flex; + } } .menuButton { @@ -57,9 +60,3 @@ .menuItemIcon { flex-shrink: 0; } - -@media screen and (max-width: 1000px) { - .container { - display: none; - } -} diff --git a/app/components/layout/TopRightButtons.module.css b/app/components/layout/TopRightButtons.module.css index 30d843f39..5205669b6 100644 --- a/app/components/layout/TopRightButtons.module.css +++ b/app/components/layout/TopRightButtons.module.css @@ -7,7 +7,7 @@ .searchAndAddContainer { display: grid; grid-template-columns: 2fr 1fr; - gap: var(--s-3); + gap: var(--s-2); } .searchWrapper > button, diff --git a/app/components/layout/TopRightButtons.tsx b/app/components/layout/TopRightButtons.tsx index bfe63a10f..7b4297acc 100644 --- a/app/components/layout/TopRightButtons.tsx +++ b/app/components/layout/TopRightButtons.tsx @@ -11,12 +11,10 @@ export function TopRightButtons({ showSupport, showSearch, isLoggedIn, - openNavDialog: _openNavDialog, }: { showSupport: boolean; showSearch: boolean; isLoggedIn: boolean; - openNavDialog: () => void; }) { const { t } = useTranslation(["common", "front"]); diff --git a/app/components/layout/index.module.css b/app/components/layout/index.module.css index 3046cfc4a..30b77fa35 100644 --- a/app/components/layout/index.module.css +++ b/app/components/layout/index.module.css @@ -19,7 +19,7 @@ width: 100%; height: var(--layout-nav-height); align-items: center; - gap: var(--s-3); + gap: var(--s-2); border-bottom: 1.5px solid var(--color-border); background-color: var(--color-bg); font-weight: var(--weight-extra); @@ -170,11 +170,9 @@ } .mobileLogo { - display: none; -} + display: flex; -@media screen and (max-width: 599px) { - .mobileLogo { - display: flex; + @media screen and (min-width: 600px) { + display: none; } } diff --git a/app/components/layout/index.tsx b/app/components/layout/index.tsx index 85253ca4d..dabbd1e3e 100644 --- a/app/components/layout/index.tsx +++ b/app/components/layout/index.tsx @@ -38,7 +38,6 @@ import sideNavStyles from "../SideNav.module.css"; import { Footer } from "./Footer"; import styles from "./index.module.css"; import { LogInButtonContainer } from "./LogInButtonContainer"; -import { NavDialog } from "./NavDialog"; import { NotificationContent, useNotifications } from "./NotificationPopover"; import notificationPopoverStyles from "./NotificationPopover.module.css"; import { TopNavMenus } from "./TopNavMenus"; @@ -166,7 +165,6 @@ export function Layout({ children: React.ReactNode; data?: RootLoaderData; }) { - const [navDialogOpen, setNavDialogOpen] = React.useState(false); const [sideNavCollapsed, setSideNavCollapsed] = useSideNavCollapsed( data?.sidenavCollapsed ?? false, ); @@ -192,7 +190,6 @@ export function Layout({ return ( <> - setNavDialogOpen(false)} /> - {sideNavCollapsed ? ( -
- -
- ) : null} setSideNavCollapsed(!sideNavCollapsed)} /> @@ -327,7 +319,6 @@ export function Layout({ )} showSearch={Boolean(data?.user)} isLoggedIn={Boolean(data?.user)} - openNavDialog={() => setNavDialogOpen(true)} /> {showLeaderboard ? : null}