chore: fix linting errors and ts bugs.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
'use client'
|
||||
|
||||
import Image from '@/spa/components/ui/UnoptimizedImage'
|
||||
|
||||
import React, { useState, useEffect, useRef } from 'react';
|
||||
import { Link, useLocation } from '@/spa/router';
|
||||
import { ArrowRight, Upload } from 'lucide-react';
|
||||
@@ -27,7 +29,6 @@ const ICONS: Record<SpaIconName, () => React.ReactElement> = {
|
||||
|
||||
|
||||
/* ── Tokens ────────────────────────────────────────────── */
|
||||
const NAVY = '#111D55';
|
||||
const ANTHRA = '#1A2030'; // nav + footer shared bg
|
||||
const GOLD = '#EFBF04';
|
||||
const MUTED = '#D0D5DD';
|
||||
@@ -77,9 +78,11 @@ const Layout: React.FC<LayoutProps> = ({ children, header = defaultHeaderData, f
|
||||
|
||||
// Close everything on route change
|
||||
useEffect(() => {
|
||||
setOpen(false);
|
||||
setMobileOpen(false);
|
||||
setExpand(null);
|
||||
setTimeout(() => {
|
||||
setOpen(false);
|
||||
setMobileOpen(false);
|
||||
setExpand(null);
|
||||
}, 0);
|
||||
if (location.hash) {
|
||||
setTimeout(() => {
|
||||
const el = document.querySelector(location.hash);
|
||||
@@ -134,7 +137,7 @@ const Layout: React.FC<LayoutProps> = ({ children, header = defaultHeaderData, f
|
||||
|
||||
// Hide floating CTA when the form section (#bewerben) is in view – homepage only
|
||||
useEffect(() => {
|
||||
setFormVisible(false);
|
||||
setTimeout(() => setFormVisible(false), 0);
|
||||
if (location.pathname !== '/') return;
|
||||
const el = document.getElementById('bewerben');
|
||||
if (!el) return;
|
||||
@@ -182,7 +185,7 @@ const Layout: React.FC<LayoutProps> = ({ children, header = defaultHeaderData, f
|
||||
{/* LEFT – logo */}
|
||||
<div style={{ flex:1, display:'flex', alignItems:'center', padding:'0 24px', height:'100%', borderRight:`1px solid ${LINE}` }}>
|
||||
<Link to="/" style={{ display:'flex', alignItems:'center', textDecoration:'none' }}>
|
||||
<img
|
||||
<Image unoptimized
|
||||
src={logo}
|
||||
alt={header.logo?.alt || header.overlayLogoAlt}
|
||||
style={{ height:38, width:'auto', display:'block', objectFit:'contain' }}
|
||||
@@ -256,7 +259,7 @@ const Layout: React.FC<LayoutProps> = ({ children, header = defaultHeaderData, f
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ position:'absolute', top:48, right:80 }}>
|
||||
<img src={logo} alt={header.overlayLogoAlt} style={{ height:40, width:'auto', display:'block', opacity:0.9 }} />
|
||||
<Image unoptimized src={logo} alt={header.overlayLogoAlt} style={{ height:40, width:'auto', display:'block', opacity:0.9 }} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -435,7 +438,7 @@ const Layout: React.FC<LayoutProps> = ({ children, header = defaultHeaderData, f
|
||||
}}>
|
||||
{/* Logo */}
|
||||
<Link to="/" style={{ display:'flex', alignItems:'center', textDecoration:'none' }}>
|
||||
<img src={logo} alt={header.logo?.alt || header.overlayLogoAlt} style={{ height:32, width:'auto', display:'block', objectFit:'contain' }} />
|
||||
<Image unoptimized src={logo} alt={header.logo?.alt || header.overlayLogoAlt} style={{ height:32, width:'auto', display:'block', objectFit:'contain' }} />
|
||||
</Link>
|
||||
|
||||
{/* Hamburger */}
|
||||
@@ -479,7 +482,7 @@ const Layout: React.FC<LayoutProps> = ({ children, header = defaultHeaderData, f
|
||||
{/* Header row: logo + close */}
|
||||
<div style={{ position:'relative', zIndex:1, display:'flex', alignItems:'center', justifyContent:'space-between', padding:'0 8px 0 20px', height:60, borderBottom:`1px solid ${SEP}`, flexShrink:0 }}>
|
||||
<Link to="/" onClick={() => setMobileOpen(false)} style={{ display:'flex', alignItems:'center', textDecoration:'none' }}>
|
||||
<img src={logo} alt={header.overlayLogoAlt} style={{ height:32, width:'auto', display:'block', objectFit:'contain' }} />
|
||||
<Image unoptimized src={logo} alt={header.overlayLogoAlt} style={{ height:32, width:'auto', display:'block', objectFit:'contain' }} />
|
||||
</Link>
|
||||
<button onClick={() => setMobileOpen(false)} aria-label={header.closeLabel}
|
||||
style={{ display:'flex', alignItems:'center', justifyContent:'center', width:48, height:48, background:'none', border:'none', cursor:'pointer', padding:0, flexShrink:0 }}>
|
||||
@@ -709,7 +712,7 @@ const Layout: React.FC<LayoutProps> = ({ children, header = defaultHeaderData, f
|
||||
maxWidth: isMobile ? '100%' : 420,
|
||||
}}>
|
||||
{/* Logo */}
|
||||
<img
|
||||
<Image unoptimized
|
||||
src={footerLogo}
|
||||
alt={footer.logo?.alt || footer.logoAlt}
|
||||
style={{ width: 140, height: 'auto', marginBottom: 10, opacity: 0.9 }}
|
||||
@@ -895,7 +898,7 @@ const Layout: React.FC<LayoutProps> = ({ children, header = defaultHeaderData, f
|
||||
<div style={{ width: 1, height: 20, background: 'rgba(239,191,4,0.2)', flexShrink: 0 }} />
|
||||
{footer.partnerLogos.map((partner, index) => (
|
||||
partner.image?.url ? (
|
||||
<img
|
||||
<Image unoptimized
|
||||
key={`${partner.alt}-${index}`}
|
||||
src={partner.image.url}
|
||||
alt={partner.image.alt || partner.alt}
|
||||
|
||||
Reference in New Issue
Block a user