Skip to content

Commit f271026

Browse files
HellocraftingGalacticCodeGambitCopilotCopilot
authored
Datenschutz und Impressum MD's hinzugefügt und calls angepasst. (#162)
* Datenschutz und Impressum MD's hinzugefügt und calls angepasst. * Datenschutz und Impressum MD's hinzugefügt und calls angepasst. (Kommentar war invalide) * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Update navigation comments for Datenschutz and Impressum links * Fix Datenschutz and Impressum, Add Datenschutz and Impressum pages with navigation links * Add MarkdownRenderer component for rendering Markdown content in Impressum and Datenschutz pages * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * refactor: extract shared markdown reader helper Agent-Logs-Url: https://github.com/GalacticCodeGambit/LazyCook/sessions/9460d714-3139-45d5-b2e2-e6ee6e3d8563 Co-authored-by: GalacticCodeGambit <150372421+GalacticCodeGambit@users.noreply.github.com> * Update Impressum.md --------- Co-authored-by: F <150372421+GalacticCodeGambit@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent 4f25613 commit f271026

8 files changed

Lines changed: 445 additions & 3 deletions

File tree

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import ReactMarkdown from "react-markdown";
2+
import remarkGfm from "remark-gfm";
3+
import type { ComponentPropsWithoutRef } from "react";
4+
5+
type MarkdownRendererProps = {
6+
content: string;
7+
};
8+
9+
const markdownComponents = {
10+
h1: (props: ComponentPropsWithoutRef<"h1">) => (
11+
<h1 className="mb-6 text-3xl font-semibold text-gray-900" {...props} />
12+
),
13+
h2: (props: ComponentPropsWithoutRef<"h2">) => (
14+
<h2 className="mb-4 mt-8 text-2xl font-semibold text-gray-900" {...props} />
15+
),
16+
h3: (props: ComponentPropsWithoutRef<"h3">) => (
17+
<h3 className="mb-3 mt-6 text-xl font-semibold text-gray-900" {...props} />
18+
),
19+
p: (props: ComponentPropsWithoutRef<"p">) => (
20+
<p className="mb-4 leading-7 text-gray-700" {...props} />
21+
),
22+
ul: (props: ComponentPropsWithoutRef<"ul">) => (
23+
<ul className="mb-4 ml-6 list-disc space-y-2 text-gray-700" {...props} />
24+
),
25+
ol: (props: ComponentPropsWithoutRef<"ol">) => (
26+
<ol className="mb-4 ml-6 list-decimal space-y-2 text-gray-700" {...props} />
27+
),
28+
li: (props: ComponentPropsWithoutRef<"li">) => (
29+
<li className="leading-7" {...props} />
30+
),
31+
strong: (props: ComponentPropsWithoutRef<"strong">) => (
32+
<strong className="font-semibold text-gray-900" {...props} />
33+
),
34+
a: (props: ComponentPropsWithoutRef<"a">) => (
35+
<a className="text-blue-600 underline underline-offset-2 hover:text-blue-700" {...props} />
36+
),
37+
blockquote: (props: ComponentPropsWithoutRef<"blockquote">) => (
38+
<blockquote className="mb-4 border-l-4 border-gray-300 pl-4 italic text-gray-600" {...props} />
39+
),
40+
hr: () => <hr className="my-8 border-gray-200" />,
41+
code: (props: ComponentPropsWithoutRef<"code">) => (
42+
<code className="rounded bg-gray-100 px-1.5 py-0.5 font-mono text-sm text-gray-800" {...props} />
43+
),
44+
};
45+
46+
export default function MarkdownRenderer({ content }: MarkdownRendererProps) {
47+
return (
48+
<article className="rounded-lg border border-gray-200 bg-white p-6 shadow-sm">
49+
<div className="max-w-none">
50+
<ReactMarkdown remarkPlugins={[remarkGfm]} components={markdownComponents}>
51+
{content}
52+
</ReactMarkdown>
53+
</div>
54+
</article>
55+
);
56+
}
57+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import MarkdownRenderer from "@/app/components/markdown-renderer";
2+
import { readMarkdownFile } from "@/app/lib/read-markdown";
3+
4+
export default function DatenschutzPage() {
5+
const content = readMarkdownFile("Datenschutz.md");
6+
7+
return (
8+
<main className="min-h-screen bg-white px-6 py-12">
9+
<div className="mx-auto max-w-4xl">
10+
<h1 className="text-3xl font-semibold mb-6">Datenschutzerklärung</h1>
11+
<p className="text-gray-600 mb-8">
12+
Die vollständige Datenschutzerklärung wird hier aus der bestehenden Markdown-Datei angezeigt.
13+
</p>
14+
<MarkdownRenderer content={content} />
15+
</div>
16+
</main>
17+
);
18+
}

project/frontend/app/homepage/MarkdownFiles/Datenschutz.md

Lines changed: 307 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Impressum
2+
3+
## Angaben gemäß § 5 TMG
4+
5+
**Lazycook GmbH**
6+
Erzbergerstraße 121
7+
76133 Karlsruhe
8+
Deutschland
9+
10+
## Kontakt
11+
12+
- **Telefon:** +49 000 00000000
13+
- **E-Mail:** lazycook.noreply@gmail.com
14+
- **Website:** https://www.lazycook.de
15+
16+
## Verantwortlich für den Inhalt nach § 55 Abs. 2 RStV
17+
18+
**Lazycook GmbH**
19+
Erzbergerstraße 121
20+
76133 Karlsruhe
21+
Deutschland
22+
23+
## Rechtliche Hinweise
24+
25+
Trotz sorgfältiger inhaltlicher Kontrolle übernehmen wir keine Haftung für die Inhalte externer Links. Für den Inhalt der verlinkten Seiten sind ausschließlich deren Betreiber verantwortlich.

project/frontend/app/homepage/homepage.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33

44
import { ChefHat, Search, BookOpen, Star, Clock, Smile } from 'lucide-react';
5+
import Link from 'next/link';
56
import { Button } from '../components/ui/button';
67
import {useCallback, useState} from "react";
78
import Modal from "@/app/components/modal";
@@ -27,9 +28,9 @@ export default function Homepage() {
2728
</div>
2829

2930
<nav className="hidden md:flex items-center gap-6">
30-
// TODO Datenschutz & Impressum
31-
<a href="#" className="text-gray-700 hover:text-black">Datenschutz</a>
32-
<a href="#" className="text-gray-700 hover:text-black">Impressum</a>
31+
{/* Datenschutz & Impressum */}
32+
<Link href="/datenschutz" className="text-gray-700 hover:text-black">Datenschutz</Link>
33+
<Link href="/impressum" className="text-gray-700 hover:text-black">Impressum</Link>
3334
</nav>
3435

3536
<div className="flex items-center gap-3">
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import MarkdownRenderer from "@/app/components/markdown-renderer";
2+
import { readMarkdownFile } from "@/app/lib/read-markdown";
3+
4+
export default function ImpressumPage() {
5+
const content = readMarkdownFile("Impressum.md");
6+
7+
return (
8+
<main className="min-h-screen bg-white px-6 py-12">
9+
<div className="mx-auto max-w-4xl">
10+
<h1 className="text-3xl font-semibold mb-6">Impressum</h1>
11+
<p className="text-gray-600 mb-8">
12+
Das vollständige Impressum wird hier aus der bestehenden Markdown-Datei angezeigt.
13+
</p>
14+
<MarkdownRenderer content={content} />
15+
</div>
16+
</main>
17+
);
18+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { readFileSync } from "node:fs";
2+
import path from "node:path";
3+
import { notFound } from "next/navigation";
4+
5+
export function readMarkdownFile(fileName: string) {
6+
try {
7+
return readFileSync(
8+
path.join(process.cwd(), "app", "homepage", "MarkdownFiles", fileName),
9+
"utf8"
10+
);
11+
} catch {
12+
notFound();
13+
}
14+
}

project/frontend/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@
1515
"lucide-react": "^0.553.0",
1616
"next": "16.2.3",
1717
"next-auth": "^4.24.13",
18+
"react-markdown": "^10.1.0",
1819
"radix-ui": "^1.4.3",
1920
"react": "19.2.0",
2021
"react-dom": "19.2.0",
2122
"react-hook-form": "latest",
2223
"react-resizable-panels": "latest",
2324
"recharts": "^3.4.1",
25+
"remark-gfm": "^4.0.1",
2426
"tailwind-merge": "^3.4.0",
2527
"vaul": "latest"
2628
},

0 commit comments

Comments
 (0)