Phase 5 of the dashboard roadmap. Business-facing data that was previously hard-coded (and, for address/hours, duplicated three independent ways across Footer.jsx, ContactPage.jsx, and the i18n strings) is now stored in app_settings and editable under Website settings: logo (light/dark variants, falling back to the bundled defaults until set), street/zip/city, and a day-by-day business_hours editor. Footer.jsx and ContactPage.jsx now share one open/closed and hours-formatting implementation (new utils/businessHours.js) instead of three separate hard-coded representations of the same thing. New legal_pages table (impressum/datenschutz/agb) + PageContentController replaces the three fully hard-coded React pages with fetched, admin- editable HTML - built-in defaults matching the original page content kick in until an admin saves anything, so a fresh install isn't blank. Reuses the Phase 4 RichTextEditor (extended with a heading toggle and inline-code toggle, since the legal text needs both) via a new "Rechtstexte" tab in Settings. Legal content lives only in DB and is authored exclusively by logged-in admins, so dangerouslySetInnerHTML here doesn't take untrusted input. IMAGE_COLUMNS in SettingsController (export/import) is now table => array of columns instead of table => one column, since app_settings has three image columns (hero/logo/logo_dark) - this also retroactively fixes hero_image_path never having been wired into export/import at all. app_settings and legal_pages both got TABLE_COLUMNS/IMPORT_SECTIONS entries so they round-trip through a hoster-migration export like everything else. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
29 lines
903 B
JavaScript
29 lines
903 B
JavaScript
import { useEffect, useState } from 'react';
|
|
import { api } from '../../api/client.js';
|
|
import usePageMeta from '../../hooks/usePageMeta.js';
|
|
|
|
export default function Datenschutz() {
|
|
const [page, setPage] = useState(null);
|
|
|
|
useEffect(() => {
|
|
api.get('/legal-pages/datenschutz').then(setPage).catch(() => {});
|
|
}, []);
|
|
|
|
usePageMeta({
|
|
title: page?.title || 'Datenschutzerklärung',
|
|
description: 'Datenschutzerklärung von HifiPlanet Amorbach gemäß Art. 13 DSGVO.',
|
|
path: '/datenschutz',
|
|
});
|
|
|
|
if (!page) return null;
|
|
|
|
return (
|
|
<div className="mx-auto max-w-3xl px-4 py-12 sm:px-6">
|
|
<h1 className="mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl">{page.title}</h1>
|
|
<div
|
|
className="legal-content text-sm text-neutral-600 dark:text-neutral-300"
|
|
dangerouslySetInnerHTML={{ __html: page.body_html }}
|
|
/>
|
|
</div>
|
|
);
|
|
}
|