From 917fc275f921b07a406807f5fb326e35fb400ffd Mon Sep 17 00:00:00 2001 From: lukas Date: Thu, 17 Sep 2026 11:34:04 +0200 Subject: [PATCH] Add a sticky site footer Adds a Footer with the brand, quick links (Menu, Basket, Your orders, Help), and a copyright line, rendered on every page. Body is now a full-height flex column so the footer sits at the bottom of the viewport on short pages instead of floating right under the content. Co-Authored-By: Claude Sonnet 5 --- src/components/ui/Footer.module.scss | 46 ++++++++++++++++++++++++++++ src/components/ui/Footer.tsx | 28 +++++++++++++++++ src/routes/__root.module.scss | 5 +++ src/routes/__root.tsx | 4 ++- src/styles/globals.scss | 3 ++ 5 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 src/components/ui/Footer.module.scss create mode 100644 src/components/ui/Footer.tsx diff --git a/src/components/ui/Footer.module.scss b/src/components/ui/Footer.module.scss new file mode 100644 index 0000000..d58ff04 --- /dev/null +++ b/src/components/ui/Footer.module.scss @@ -0,0 +1,46 @@ +@use '../../styles/variables' as *; + +.footer { + margin-top: $space-5; + padding: $space-4 $space-3; + border-top: 1px solid $color-border; + background: $color-surface; +} + +.content { + max-width: 640px; + margin: 0 auto; + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: space-between; + gap: $space-3; +} + +.brand { + text-decoration: none; + color: $color-text; +} + +.links { + display: flex; + flex-wrap: wrap; + gap: $space-3; + + a { + color: $color-text-muted; + text-decoration: none; + font-size: 0.9rem; + + &:hover { + color: $color-text; + } + } +} + +.copyright { + margin: 0; + width: 100%; + color: $color-text-muted; + font-size: 0.8rem; +} diff --git a/src/components/ui/Footer.tsx b/src/components/ui/Footer.tsx new file mode 100644 index 0000000..227c9a9 --- /dev/null +++ b/src/components/ui/Footer.tsx @@ -0,0 +1,28 @@ +import { Link } from '@tanstack/react-router' + +import { Logo } from '#/components/ui/Logo.tsx' + +import styles from './Footer.module.scss' + +type FooterProps = { + brandName: string +} + +export const Footer = ({ brandName }: FooterProps) => ( +
+
+ + + + +

+ © {new Date().getFullYear()} {brandName} +

+
+
+) diff --git a/src/routes/__root.module.scss b/src/routes/__root.module.scss index 9b68dc4..ff824b0 100644 --- a/src/routes/__root.module.scss +++ b/src/routes/__root.module.scss @@ -20,6 +20,11 @@ border-bottom: 1px solid color-mix(in srgb, $color-border 30%, transparent); } +.content { + flex: 1 0 auto; + min-width: 0; +} + .brand { font-size: 1.1rem; font-weight: 700; diff --git a/src/routes/__root.tsx b/src/routes/__root.tsx index 22efd4b..10ef2fb 100644 --- a/src/routes/__root.tsx +++ b/src/routes/__root.tsx @@ -6,6 +6,7 @@ import { } from '@tanstack/react-router' import { BasketLink } from '#/components/basket/BasketLink.tsx' +import { Footer } from '#/components/ui/Footer.tsx' import { Logo } from '#/components/ui/Logo.tsx' import { NotFound } from '#/components/ui/NotFound.tsx' import BetterAuthHeader from '#/integrations/better-auth/header-user.tsx' @@ -40,7 +41,8 @@ const RootDocument = ({ children }: { children: React.ReactNode }) => { - {children} +
{children}
+