From c4372930ddd495c3ccaaf93e7ba67498bb6f1170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Gierwia=C5=82o?= Date: Fri, 5 Dec 2025 18:33:25 +0100 Subject: [PATCH] feat(content): add How It Works page with markdown support - Create HowItWorksPage component with markdown rendering - Add how-it-works.md with Lorem Ipsum placeholder content - Add /how-it-works route in App.jsx - Add How It Works link to homepage footer (Product section) --- frontend/public/content/how-it-works.md | 29 ++++++++ frontend/src/App.jsx | 4 ++ frontend/src/pages/HomePage.jsx | 5 ++ frontend/src/pages/HowItWorksPage.jsx | 91 +++++++++++++++++++++++++ 4 files changed, 129 insertions(+) create mode 100644 frontend/public/content/how-it-works.md create mode 100644 frontend/src/pages/HowItWorksPage.jsx diff --git a/frontend/public/content/how-it-works.md b/frontend/public/content/how-it-works.md new file mode 100644 index 0000000..294717f --- /dev/null +++ b/frontend/public/content/how-it-works.md @@ -0,0 +1,29 @@ +# How It Works + +## Lorem Ipsum + +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. + +## Ut Enim Ad Minim + +Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat: + +1. **Duis aute irure** - Dolor in reprehenderit in voluptate velit esse cillum dolore +2. **Eu fugiat nulla** - Pariatur excepteur sint occaecat cupidatat non proident +3. **Sunt in culpa** - Qui officia deserunt mollit anim id est laborum + +## Sed Ut Perspiciatis + +Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. + +## Nemo Enim Ipsam + +Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. + +### Neque Porro Quisquam + +Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. + +--- + +*For questions or feedback, [contact us](/contact).* diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 13f0f09..8e7f5e0 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -22,6 +22,7 @@ import ActivityLogsPage from './pages/admin/ActivityLogsPage'; import ContactMessagesPage from './pages/admin/ContactMessagesPage'; import ContactPage from './pages/ContactPage'; import AboutUsPage from './pages/AboutUsPage'; +import HowItWorksPage from './pages/HowItWorksPage'; import NotFoundPage from './pages/NotFoundPage'; import VerificationBanner from './components/common/VerificationBanner'; import InstallPWA from './components/pwa/InstallPWA'; @@ -232,6 +233,9 @@ function App() { {/* About Us Page - Public route */} } /> + {/* How It Works Page - Public route */} + } /> + {/* Public Profile - /u/username format (no auth required) */} } /> diff --git a/frontend/src/pages/HomePage.jsx b/frontend/src/pages/HomePage.jsx index 02344eb..e4a3023 100644 --- a/frontend/src/pages/HomePage.jsx +++ b/frontend/src/pages/HomePage.jsx @@ -263,6 +263,11 @@ const HomePage = () => {

Product

    +
  • + + How It Works + +
  • Events diff --git a/frontend/src/pages/HowItWorksPage.jsx b/frontend/src/pages/HowItWorksPage.jsx new file mode 100644 index 0000000..e9888ba --- /dev/null +++ b/frontend/src/pages/HowItWorksPage.jsx @@ -0,0 +1,91 @@ +import { useState, useEffect } from 'react'; +import ReactMarkdown from 'react-markdown'; +import Layout from '../components/layout/Layout'; + +export default function HowItWorksPage() { + const [content, setContent] = useState(''); + const [loading, setLoading] = useState(true); + const [error, setError] = useState(''); + + useEffect(() => { + // Fetch markdown content + fetch('/content/how-it-works.md') + .then(response => { + if (!response.ok) { + throw new Error('Failed to load content'); + } + return response.text(); + }) + .then(text => { + setContent(text); + setLoading(false); + }) + .catch(err => { + console.error('Error loading how-it-works content:', err); + setError('Failed to load page content'); + setLoading(false); + }); + }, []); + + if (loading) { + return ( + +
    +
    +
    +

    Loading...

    +
    +
    +
    + ); + } + + if (error) { + return ( + +
    +
    +

    {error}

    +
    +
    +
    + ); + } + + return ( + +
    +
    +
    + { + const isInternal = href && href.startsWith('/'); + if (isInternal) { + return ( + + {children} + + ); + } + return ( + + {children} + + ); + }, + // Ensure images are responsive + img: ({ node, ...props }) => ( + {props.alt + ), + }} + > + {content} + +
    +
    +
    +
    + ); +}