refactor(layout): Footer flips with theme · drop shadow noise on Header/MobileMenu · LOCATIONS display via org.ts SSOT

- Footer: was hardcoded `bg-neutral-900 text-white` (always dark) — flipped
  to `bg-neutral-50 dark:bg-neutral-950` so it inherits the page rhythm
  in both modes. Borders + muted text replace the dark monoblock.
- Header (scrolled state): drop `shadow-sm shadow-neutral-200/50` —
  doubling shadow + border to cue scroll was the calmer-than-x.com signal
  the nav refactor was after. Border-only matches the design system rule
  ("shadow-lg/xl/2xl on cards breaks dark mode").
- MobileMenu: drop `shadow-2xl dark:shadow-black/40` for the same reason;
  the backdrop already lifts the panel visually.
- org.ts: extract `getLocationsDisplay()` returning the address-lines view
  that Footer (and any future contact card) wants. Country line is
  emitted only for the primary store — collapses the inline if-it's-the-
  warehouse-skip-country branch Footer was carrying.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
g-butandClaude Opus 4.7 committed 2026-05-30 23:28:18 +02:00
1 parent 6f60d06fa2
commit b1b1f80e99
4 files changed
+79 -46

No files matched your search

+40 -44
View File
@@ -4,43 +4,40 @@ import { Link } from '@/i18n/navigation'
import { mainNavigation, socialLinks } from '@/config/navigation'
import { Logo } from '@/components/ui/Logo'
import { Mail, Phone, MapPin, Clock } from 'lucide-react'
import { ORG, CONTACT, LOCATIONS, OPENING_HOURS } from '@/config/org'
import { ORG, CONTACT, OPENING_HOURS, getLocationsDisplay } from '@/config/org'
import { ROUTES } from '@/config/routes'
const footerLocations = [
{
name: LOCATIONS.store.name,
addressLines: [LOCATIONS.store.street, `${LOCATIONS.store.postalCode} ${LOCATIONS.store.city}`, LOCATIONS.store.country],
},
{
name: LOCATIONS.warehouse.name,
addressLines: [LOCATIONS.warehouse.street, `${LOCATIONS.warehouse.postalCode} ${LOCATIONS.warehouse.city}`],
extra: LOCATIONS.warehouse.note,
},
]
import { NewsletterSignup } from '@/components/community/NewsletterSignup'
import Heading from '@/components/ui/Heading'
import { useTranslations } from 'next-intl'
const footerLocations = getLocationsDisplay()
/**
* Footer — flips with theme like the rest of the site. The legacy
* "always dark" treatment broke the visual rhythm of the page in
* light mode. Surface uses neutral-50 / neutral-950 to match the
* canvas, with border-only separators (no shadows, no gradients —
* consistent with the design system rules).
*/
export default function Footer() {
const tFooter = useTranslations('footer')
const tNav = useTranslations('nav')
return (
<footer className="bg-neutral-900 text-white">
<footer className="bg-neutral-50 dark:bg-neutral-950 text-neutral-900 dark:text-neutral-100 border-t border-neutral-200 dark:border-white/[0.06]">
<div className="container mx-auto px-4 py-12">
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 gap-8">
{/* Brand Section */}
<div>
<Logo className="mb-4" showText={true} />
<p className="text-sm text-neutral-300">
<p className="text-sm text-neutral-600 dark:text-neutral-400">
{tFooter('mission')}
</p>
</div>
{/* Navigation Section */}
<nav aria-label={tFooter('navigation')}>
<Heading level={3} className="text-sm font-semibold uppercase tracking-wider text-neutral-300 mb-4">
<Heading level={3} className="text-sm font-semibold uppercase tracking-wider text-neutral-500 dark:text-neutral-400 mb-4">
{tFooter('navigation')}
</Heading>
<ul className="space-y-2">
@@ -49,7 +46,7 @@ export default function Footer() {
{item.external ? (
<a
href={item.href}
className="text-sm text-neutral-300 hover:text-white transition-colors"
className="text-sm text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-white transition-colors"
target="_blank"
rel="noopener noreferrer"
>
@@ -58,7 +55,7 @@ export default function Footer() {
) : (
<Link
href={item.href}
className="text-sm text-neutral-300 hover:text-white transition-colors"
className="text-sm text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-white transition-colors"
>
{item.nameKey ? tNav(item.nameKey as never) : item.name}
</Link>
@@ -70,33 +67,33 @@ export default function Footer() {
{/* Contact Section */}
<div>
<Heading level={3} className="text-sm font-semibold uppercase tracking-wider text-neutral-300 mb-4">
<Heading level={3} className="text-sm font-semibold uppercase tracking-wider text-neutral-500 dark:text-neutral-400 mb-4">
{tNav('contact')}
</Heading>
<address className="space-y-4 not-italic">
{footerLocations.map((location) => (
<div className="flex items-start" key={location.name}>
<MapPin className="w-4 h-4 mt-0.5 mr-3 flex-shrink-0 text-neutral-300" />
<div className="flex items-start" key={location.key}>
<MapPin className="w-4 h-4 mt-0.5 mr-3 flex-shrink-0 text-neutral-500 dark:text-neutral-400" />
<div>
<p className="text-sm font-medium text-neutral-200">{location.name}</p>
<p className="text-sm font-medium text-neutral-800 dark:text-neutral-200">{location.name}</p>
{location.addressLines.map((line) => (
<p className="text-sm text-neutral-300" key={line}>{line}</p>
<p className="text-sm text-neutral-600 dark:text-neutral-400" key={line}>{line}</p>
))}
{'extra' in location && location.extra && (
<p className="text-xs text-neutral-300 mt-0.5">{location.extra}</p>
{location.note && (
<p className="text-xs text-neutral-500 dark:text-neutral-500 mt-0.5">{location.note}</p>
)}
</div>
</div>
))}
<div className="flex items-center gap-3">
<Phone className="w-4 h-4 text-neutral-300 flex-shrink-0" />
<a href={`tel:${CONTACT.phone}`} className="text-sm text-neutral-300 hover:text-white transition-colors">
<Phone className="w-4 h-4 text-neutral-500 dark:text-neutral-400 flex-shrink-0" />
<a href={`tel:${CONTACT.phone}`} className="text-sm text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-white transition-colors">
{CONTACT.phone}
</a>
</div>
<div className="flex items-center gap-3">
<Mail className="w-4 h-4 text-neutral-300 flex-shrink-0" />
<a href={`mailto:${CONTACT.email}`} className="text-sm text-neutral-300 hover:text-white transition-colors">
<Mail className="w-4 h-4 text-neutral-500 dark:text-neutral-400 flex-shrink-0" />
<a href={`mailto:${CONTACT.email}`} className="text-sm text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-white transition-colors">
{CONTACT.email}
</a>
</div>
@@ -105,11 +102,11 @@ export default function Footer() {
{/* Opening Hours */}
<div>
<Heading level={3} className="text-sm font-semibold uppercase tracking-wider text-neutral-300 mb-4">
<Heading level={3} className="text-sm font-semibold uppercase tracking-wider text-neutral-500 dark:text-neutral-400 mb-4">
<Clock className="inline w-4 h-4 mr-1.5 mb-0.5" />
{tFooter('openingHours')}
</Heading>
<div className="space-y-1 text-sm text-neutral-300">
<div className="space-y-1 text-sm text-neutral-600 dark:text-neutral-400">
<p>{tFooter('openingHoursMonday', { hours: OPENING_HOURS.monday })}</p>
<p>{tFooter('openingHoursTueFri', { hours: OPENING_HOURS.tuesdayToFriday })}</p>
</div>
@@ -117,20 +114,19 @@ export default function Footer() {
</div>
{/* Newsletter */}
<div className="mt-10 pt-8 border-t border-neutral-800">
<div className="mt-10 pt-8 border-t border-neutral-200 dark:border-white/[0.06]">
<NewsletterSignup
source="footer"
variant="dark"
/>
</div>
{/* Social Links */}
<div className="mt-8 pt-6 border-t border-neutral-800 flex justify-center gap-4">
<div className="mt-8 pt-6 border-t border-neutral-200 dark:border-white/[0.06] flex justify-center gap-4">
{socialLinks.map((social) => (
<a
key={social.name}
href={social.href}
className="p-2 text-neutral-300 hover:text-white transition-colors rounded-md hover:bg-neutral-800"
className="p-2 text-neutral-500 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-white transition-colors rounded-md hover:bg-neutral-100 dark:hover:bg-white/[0.04]"
target="_blank"
rel="noopener noreferrer"
>
@@ -140,29 +136,29 @@ export default function Footer() {
))}
</div>
{/* Legal Links */}
<div className="mt-6 pt-6 border-t border-neutral-800">
<nav aria-label={tFooter('legal')} className="flex flex-wrap justify-center gap-x-6 gap-y-2 text-xs text-neutral-300">
<Link href={ROUTES.public.impressum} className="hover:text-white transition-colors">
{/* Legal Links — routes from ROUTES.public SSOT */}
<div className="mt-6 pt-6 border-t border-neutral-200 dark:border-white/[0.06]">
<nav aria-label={tFooter('legal')} className="flex flex-wrap justify-center gap-x-6 gap-y-2 text-xs text-neutral-500 dark:text-neutral-400">
<Link href={ROUTES.public.impressum} className="hover:text-neutral-900 dark:hover:text-white transition-colors">
{tFooter('impressum')}
</Link>
<Link href={ROUTES.public.datenschutz} className="hover:text-white transition-colors">
<Link href={ROUTES.public.datenschutz} className="hover:text-neutral-900 dark:hover:text-white transition-colors">
{tFooter('privacyPolicy')}
</Link>
<Link href={ROUTES.public.agb} className="hover:text-white transition-colors">
<Link href={ROUTES.public.agb} className="hover:text-neutral-900 dark:hover:text-white transition-colors">
{tFooter('termsOfService')}
</Link>
<Link href={ROUTES.public.transparenz} className="hover:text-white transition-colors">
<Link href={ROUTES.public.transparenz} className="hover:text-neutral-900 dark:hover:text-white transition-colors">
{tFooter('transparency')}
</Link>
<Link href={ROUTES.public.mitgliedWerden} className="hover:text-white transition-colors">
<Link href={ROUTES.public.mitgliedWerden} className="hover:text-neutral-900 dark:hover:text-white transition-colors">
{tNav('membership')}
</Link>
</nav>
</div>
{/* Copyright */}
<div className="mt-6 text-center text-xs text-neutral-300">
<div className="mt-6 text-center text-xs text-neutral-500 dark:text-neutral-500">
&copy; {new Date().getFullYear()} {ORG.name}. {tFooter('allRightsReserved')}
</div>
</div>
+3 -1
View File
@@ -114,7 +114,9 @@ export function MobileMenu({
tabIndex={-1}
className={cn(
"fixed inset-y-0 right-0 z-[101] w-full sm:max-w-md",
"bg-white dark:bg-neutral-900 shadow-2xl dark:shadow-black/40",
// Border-only separation matches the rest of the design system —
// the translucent backdrop already provides the plane lift.
"bg-white dark:bg-neutral-900 border-l border-neutral-200 dark:border-white/[0.06]",
"flex flex-col",
"transition-transform duration-300 ease-out",
isOpen ? "translate-x-0" : "translate-x-full"
+3 -1
View File
@@ -66,8 +66,10 @@ export function Header() {
className={cn(
"fixed top-0 left-0 right-0 z-50",
"transition-all duration-300",
// Scrolled state: border-only (no shadow). Double-cueing scroll
// with both shadow + border was a calmer-than-x.com signal.
isScrolled || anyDropdownOpen
? "bg-white/95 backdrop-blur-xl shadow-sm shadow-neutral-200/50 border-b border-neutral-100 dark:bg-neutral-950/95 dark:shadow-none dark:border-white/[0.06]"
? "bg-white/95 backdrop-blur-xl border-b border-neutral-200 dark:bg-neutral-950/95 dark:border-white/[0.06]"
: "bg-white/80 backdrop-blur-md dark:bg-neutral-950/80"
)}
>
+33
View File
@@ -75,6 +75,39 @@ export const LOCATIONS = {
},
} as const
/**
* Display-shaped view of every LOCATIONS entry — name + the
* address lines a card / footer / contact block wants to render,
* plus an optional note. Centralises the "street, then postal+city,
* then country (or omit it if same as Switzerland)" decision so
* consumers don't re-build it inline.
*/
export interface LocationDisplay {
key: string
name: string
addressLines: string[]
note?: string
}
export function getLocationsDisplay(): LocationDisplay[] {
return Object.entries(LOCATIONS).map(([key, loc]) => {
const note = 'note' in loc ? loc.note : undefined
return {
key,
name: loc.name,
addressLines: [
loc.street,
`${loc.postalCode} ${loc.city}`,
// Only show country for the primary store (we're a Swiss org, all
// locations are CH — the country line is for press / SEO use of
// .fullWithCountry rather than visible chrome).
...(key === 'store' ? [loc.country] : []),
],
...(note ? { note } : {}),
}
})
}
// ============================================================================
// CONTACT
// ============================================================================