From f2ba61e64bcc0a7ff06a3aa8eec6df3fd8cf7ac9 Mon Sep 17 00:00:00 2001 From: keyan Date: Fri, 23 Feb 2024 09:32:20 -0600 Subject: [PATCH] enhance navigation --- api/ssrApollo.js | 8 +- components/fee-button.js | 2 +- components/hat.js | 2 +- components/header.module.css | 16 +- components/item.module.css | 1 - components/layout.js | 40 +- components/layout.module.css | 10 +- components/navigation/common.js | 382 ++++++++++++++++++ components/navigation/desktop/header.js | 14 + components/navigation/desktop/second-bar.js | 20 + components/navigation/desktop/top-bar.js | 24 ++ components/navigation/index.js | 25 ++ components/navigation/mobile/footer.js | 34 ++ .../navigation/mobile/footer.module.css | 17 + components/navigation/mobile/header.js | 14 + components/navigation/mobile/offcanvas.js | 108 +++++ components/navigation/mobile/second-bar.js | 19 + components/navigation/mobile/top-bar.js | 25 ++ components/navigation/static.js | 19 + components/navigation/sticky-bar.js | 59 +++ components/post.js | 8 +- components/search.js | 4 +- components/search.module.css | 2 +- components/sub-select.js | 4 +- components/sub-select.module.css | 10 +- components/territory-header.js | 79 ++-- middleware.js | 2 +- package-lock.json | 7 +- package.json | 1 + pages/[name]/index.js | 6 +- pages/_document.js | 6 +- pages/invites/[id].js | 6 +- pages/items/[id]/edit.js | 3 +- pages/login.js | 14 +- pages/signup.js | 4 +- pages/~/index.js | 2 - styles/globals.scss | 18 +- svgs/sn.svg | 1 + 38 files changed, 913 insertions(+), 103 deletions(-) create mode 100644 components/navigation/common.js create mode 100644 components/navigation/desktop/header.js create mode 100644 components/navigation/desktop/second-bar.js create mode 100644 components/navigation/desktop/top-bar.js create mode 100644 components/navigation/index.js create mode 100644 components/navigation/mobile/footer.js create mode 100644 components/navigation/mobile/footer.module.css create mode 100644 components/navigation/mobile/header.js create mode 100644 components/navigation/mobile/offcanvas.js create mode 100644 components/navigation/mobile/second-bar.js create mode 100644 components/navigation/mobile/top-bar.js create mode 100644 components/navigation/static.js create mode 100644 components/navigation/sticky-bar.js create mode 100644 svgs/sn.svg diff --git a/api/ssrApollo.js b/api/ssrApollo.js index 95830f2f..2de50596 100644 --- a/api/ssrApollo.js +++ b/api/ssrApollo.js @@ -82,7 +82,7 @@ export function getGetServerSideProps ( const callback = process.env.PUBLIC_URL + req.url return { redirect: { - destination: `/login?callbackUrl=${encodeURIComponent(callback)}` + destination: `/signup?callbackUrl=${encodeURIComponent(callback)}` } } } @@ -111,9 +111,9 @@ export function getGetServerSideProps ( } if (error || !data || (notFound && notFound(data, vars, me))) { - return { - notFound: true - } + res.writeHead(301, { + Location: '/404' + }).end() } props = { diff --git a/components/fee-button.js b/components/fee-button.js index dd7db599..8823aa7b 100644 --- a/components/fee-button.js +++ b/components/fee-button.js @@ -159,7 +159,7 @@ function AnonInfo () { return ( showModal(onClose => diff --git a/components/hat.js b/components/hat.js index 9856b6a0..8db6f250 100644 --- a/components/hat.js +++ b/components/hat.js @@ -10,7 +10,7 @@ export default function Hat ({ user, badge, className = 'ms-1', height = 16, wid if (!user || Number(user.id) === AD_USER_ID) return null if (Number(user.id) === ANON_USER_ID) { return ( - + {badge ? ( diff --git a/components/header.module.css b/components/header.module.css index a650a66e..ad6249c8 100644 --- a/components/header.module.css +++ b/components/header.module.css @@ -1,12 +1,11 @@ .brand { - font-family: lightning; - font-size: 2rem; padding: 0; - line-height: 100%; - margin-bottom: -.3rem; margin-right: 0; - text-shadow: 0 0 10px var(--bs-primary); - color: var(--theme-brandColor) !important; +} + +.brand svg { + fill: var(--theme-brandColor); + filter: drop-shadow(0 0 6px var(--bs-primary)); } .postAnon { @@ -44,6 +43,10 @@ fill: var(--theme-navLinkActive); } +.hide { + display: none; +} + .dropdown svg { vertical-align: text-top; } @@ -79,6 +82,7 @@ display: flex; flex-grow: 1; justify-content: center; + align-items: center; } .price > div { diff --git a/components/item.module.css b/components/item.module.css index 074c1997..29ff94a8 100644 --- a/components/item.module.css +++ b/components/item.module.css @@ -1,5 +1,4 @@ .title { - font-weight: 500; white-space: normal; max-width: 100%; display: inline-block; diff --git a/components/layout.js b/components/layout.js index c0b7f6f9..b5d54f37 100644 --- a/components/layout.js +++ b/components/layout.js @@ -1,4 +1,6 @@ -import Header, { HeaderStatic } from './header' +import Navigation from './navigation' +import NavFooter from './navigation/mobile/footer' +import NavStatic from './navigation/static' import Container from 'react-bootstrap/Container' import Footer from './footer' import Seo, { SeoSearch } from './seo' @@ -12,51 +14,53 @@ export default function Layout ({ return ( <> {seo && } -
+ {contain ? ( - + {children} ) : children} {footer &&