fix(andreknie.de): improve mobile dock and resource requests

This commit is contained in:
2026-07-28 20:54:08 +02:00
parent 0459daa074
commit 8236cce85c
12 changed files with 219 additions and 61 deletions
@@ -24,8 +24,8 @@ export default function Datenschutz() {
<p><strong style={{ color: 'var(--text-primary)' }}>4. Newsletter (Double-Opt-In)</strong></p>
<p>Für die Newsletter-Anmeldung wird Ihre E-Mail-Adresse bis zur Bestätigung temporär gespeichert. Nach erfolgreicher Bestätigung wird sie als aktives Abonnement gespeichert, bis Sie sich abmelden. Eine Abmeldung können Sie jederzeit per E-Mail an <a href="mailto:kontakt@d-hive.de">kontakt@d-hive.de</a> mit dem Hinweis Newsletter abbestellen veranlassen.</p>
<p><strong style={{ color: 'var(--text-primary)' }}>5. Ressourcen-Downloads</strong></p>
<p>Für einen Ressourcen-Download werden Name, E-Mail-Adresse, Unternehmen, angeforderte Ressource und Zeitpunkt gespeichert. Die Daten dienen der Bearbeitung der Download-Anfrage und der Beziehungspflege. Sie werden gelöscht, sobald der Zweck entfällt oder Sie die Löschung unter <a href="mailto:datenschutz@d-hive.de">datenschutz@d-hive.de</a> anfordern.</p>
<p><strong style={{ color: 'var(--text-primary)' }}>5. Ressourcenanfragen</strong></p>
<p>Für eine Ressourcenanfrage werden Name, E-Mail-Adresse, Unternehmen und die angeforderte Ressource ausschließlich an <a href="mailto:kontakt@d-hive.de">kontakt@d-hive.de</a> übermittelt. Es erfolgt kein automatischer Download und kein automatischer Versand. Die Anfrage dient der Prüfung, ob André ein aktuelles Profil verschickt. Eine lokale Lead-Datei wird dabei nicht angelegt.</p>
<p><strong style={{ color: 'var(--text-primary)' }}>6. Speaker-CV-Anfrage</strong></p>
<p>Für die Speaker-CV-Anfrage werden Name, E-Mail-Adresse, Nachricht und Zeitpunkt gespeichert. Die Daten werden nach erfolgreichem Versand des CV zur Bearbeitung und Beziehungspflege gespeichert und gelöscht, sobald der Zweck entfällt oder Sie die Löschung unter <a href="mailto:datenschutz@d-hive.de">datenschutz@d-hive.de</a> anfordern.</p>
@@ -12,6 +12,12 @@
box-sizing: border-box;
}
@media (max-width: 600px) {
.hero {
padding-bottom: calc(60px + var(--dock-content-space));
}
}
.hero-content {
position: relative;
z-index: 10;
+93 -12
View File
@@ -1,29 +1,110 @@
import React from 'react'
import React, { useState } from 'react'
import { useContent } from '../hooks/useContent'
import { useFormSubmit } from '../hooks/useFormSubmit'
import { validateResourceDownload } from '../utils/validation'
const inputStyle = {
width: '100%',
padding: '12px',
background: 'var(--bg-elevated)',
border: '1px solid var(--glass-border)',
borderRadius: 'var(--radius-sm)',
color: 'var(--text-primary)',
fontSize: '1rem',
}
function ResourceRequestForm({ resource, onCancel }) {
const resourceId = resource.id || resource.slug
const [form, setForm] = useState({ name: '', email: '', company: '', resource_id: resourceId, company_website: '' })
const { submit, loading, success, errors, serverError } = useFormSubmit('/api/resource-download', validateResourceDownload)
function updateField(event) {
setForm(prev => ({ ...prev, [event.target.name]: event.target.value }))
}
async function handleSubmit(event) {
event.preventDefault()
await submit(form)
}
return (
<div className="glass-panel" style={{ padding: '24px', marginTop: '24px' }}>
{success ? (
<p style={{ margin: 0, color: 'var(--text-primary)' }}>
Danke! Wir prüfen die Anfrage und melden uns bei dir.
</p>
) : (
<form onSubmit={handleSubmit} noValidate>
<h2 style={{ fontSize: '1.25rem', marginBottom: '8px' }}>Material anfragen</h2>
<p style={{ color: 'var(--text-secondary)', marginTop: 0 }}>
Wir prüfen die Anfrage. Bei positiver Prüfung verschickt André ein aktuelles Profil persönlich.
</p>
<div aria-hidden="true" style={{ position: 'absolute', left: '-9999px', width: '1px', height: '1px', overflow: 'hidden' }}>
<label htmlFor="resource-company-website">Firmen-Website (bitte leer lassen)</label>
<input id="resource-company-website" name="company_website" tabIndex={-1} autoComplete="off" value={form.company_website} onChange={updateField} />
</div>
<input type="hidden" name="resource_id" value={resourceId} />
<label htmlFor="resource-name">Name</label>
<input id="resource-name" name="name" value={form.name} onChange={updateField} style={inputStyle} autoComplete="name" aria-invalid={Boolean(errors.name)} />
{errors.name && <p role="alert" style={{ color: '#ff4444', margin: '4px 0 12px' }}>{errors.name}</p>}
<label htmlFor="resource-email">E-Mail</label>
<input id="resource-email" name="email" type="email" value={form.email} onChange={updateField} style={inputStyle} autoComplete="email" aria-invalid={Boolean(errors.email)} />
{errors.email && <p role="alert" style={{ color: '#ff4444', margin: '4px 0 12px' }}>{errors.email}</p>}
<label htmlFor="resource-company">Unternehmen</label>
<input id="resource-company" name="company" value={form.company} onChange={updateField} style={inputStyle} autoComplete="organization" aria-invalid={Boolean(errors.company)} />
{errors.company && <p role="alert" style={{ color: '#ff4444', margin: '4px 0 12px' }}>{errors.company}</p>}
{serverError && <p role="alert" style={{ color: '#ff4444' }}>{serverError}</p>}
{errors.resource_id && <p role="alert" style={{ color: '#ff4444' }}>{errors.resource_id}</p>}
<div style={{ display: 'flex', gap: '12px', marginTop: '20px', flexWrap: 'wrap' }}>
<button type="submit" className="primary-button" disabled={loading}>
{loading ? 'Wird gesendet...' : 'Anfrage senden'}
</button>
<button type="button" className="secondary-button" onClick={onCancel}>Abbrechen</button>
</div>
</form>
)}
</div>
)
}
export default function Resources() {
const { items } = useContent('resources', { pageSize: 20 })
const [selectedResource, setSelectedResource] = useState(null)
return (
<main style={{ paddingTop: '120px', minHeight: '100vh' }}>
<div className="app-container">
<div className="section-header">
<h1 className="section-title"><span className="text-gradient">Ressourcen</span></h1>
<p className="section-subtitle">Praktische Materialien zum Download.</p>
<p className="section-subtitle">Materialien auf Anfrage. Jede Anfrage wird zunächst geprüft.</p>
</div>
<div style={{ display: 'grid', gap: '20px', maxWidth: '700px', margin: '0 auto' }}>
{items.map(res => (
<div key={res.id || res.slug} className="glass-panel" style={{ padding: '24px', display: 'flex', justifyContent: 'space-between', alignItems: 'center', gap: '16px' }}>
<div>
<h3 style={{ marginBottom: '4px', fontSize: '1.1rem' }}>{res.title}</h3>
<p style={{ color: 'var(--text-secondary)', margin: 0, fontSize: '0.9rem' }}>{res.description}</p>
{items.map(resource => {
const resourceId = resource.id || resource.slug
const selected = selectedResource === resourceId
return (
<div key={resourceId} className="glass-panel" style={{ padding: '24px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', gap: '16px', flexWrap: 'wrap' }}>
<div>
<h2 style={{ marginBottom: '4px', fontSize: '1.1rem' }}>{resource.title}</h2>
<p style={{ color: 'var(--text-secondary)', margin: 0, fontSize: '0.9rem' }}>{resource.description}</p>
</div>
<button type="button" className="primary-button" onClick={() => setSelectedResource(selected ? null : resourceId)} style={{ padding: '10px 20px', fontSize: '0.9rem', whiteSpace: 'nowrap' }}>
{selected ? 'Schließen' : 'Material anfragen'}
</button>
</div>
{selected && <ResourceRequestForm key={resourceId} resource={resource} onCancel={() => setSelectedResource(null)} />}
</div>
<button className="primary-button" style={{ padding: '10px 20px', fontSize: '0.9rem', whiteSpace: 'nowrap' }}>
Download
</button>
</div>
))}
)
})}
{items.length === 0 && <p style={{ textAlign: 'center', color: 'var(--text-secondary)' }}>Ressourcen werden vorbereitet.</p>}
</div>
</div>