Implement BS-008 privacy draft and public prerendering
This commit is contained in:
+14
-18
@@ -9,31 +9,26 @@ import Services from "./views/Services/Services";
|
||||
import About from "./views/About/About";
|
||||
import Contact from "./views/Contact/Contact";
|
||||
import Projects, { ProjectCaseStudy } from "./views/Projects/Projects";
|
||||
import Privacy from "./views/Legal/Privacy";
|
||||
import PropTypes from "prop-types";
|
||||
import { createElement } from "react";
|
||||
import { publicPageMeta } from "./config/site";
|
||||
|
||||
const pages = [
|
||||
["privacy", "Privacy policy", "Privacy information is awaiting review against the actual website data flows before publication."],
|
||||
];
|
||||
|
||||
export default function App() {
|
||||
export default function App({ Router = BrowserRouter, routerProps = {} }) {
|
||||
return (
|
||||
<div className="app">
|
||||
<BrowserRouter>
|
||||
{createElement(Router, routerProps, <>
|
||||
<a className="skipLink" href="#main-content">Skip to main content</a>
|
||||
<Header />
|
||||
<main id="main-content" className="pageContent" tabIndex="-1">
|
||||
<Routes>
|
||||
<Route index element={<><PageMeta /><Homepage /></>} />
|
||||
<Route path="services" element={<><PageMeta title="Services" description="Website development, custom software, API integration and managed hosting from BortStack." /><Services /></>} />
|
||||
<Route path="about" element={<><PageMeta title="About" description="BortStack’s approach to practical software development, clear communication and ongoing support." /><About /></>} />
|
||||
<Route path="contact" element={<><PageMeta title="Contact" description="Discuss your software project with BortStack." /><Contact /></>} />
|
||||
<Route path="projects" element={<><PageMeta title="Projects" description="Explore BortStack software projects: RouletteBuddy, PitchInvader and API Admin." /><Projects /></>} />
|
||||
<Route index element={<><PageMeta {...publicPageMeta["/"]} /><Homepage /></>} />
|
||||
<Route path="services" element={<><PageMeta {...publicPageMeta["/services"]} /><Services /></>} />
|
||||
<Route path="about" element={<><PageMeta {...publicPageMeta["/about"]} /><About /></>} />
|
||||
<Route path="contact" element={<><PageMeta {...publicPageMeta["/contact"]} /><Contact /></>} />
|
||||
<Route path="projects" element={<><PageMeta {...publicPageMeta["/projects"]} /><Projects /></>} />
|
||||
<Route path="projects/:slug" element={<ProjectCaseStudy />} />
|
||||
{pages.map(([path, title, description]) => (
|
||||
<Route key={path} path={path} element={<>
|
||||
<PageMeta title={title} description={description} noIndex />
|
||||
<RoutePlaceholder title={title} description={description} />
|
||||
</>} />
|
||||
))}
|
||||
<Route path="privacy" element={<><PageMeta {...publicPageMeta["/privacy"]} /><Privacy /></>} />
|
||||
<Route path="*" element={<>
|
||||
<PageMeta title="Page not found" noIndex />
|
||||
<RoutePlaceholder title="Page not found" description="This page is not available. Use the navigation to explore BortStack." />
|
||||
@@ -41,7 +36,8 @@ export default function App() {
|
||||
</Routes>
|
||||
</main>
|
||||
<Footer />
|
||||
</BrowserRouter>
|
||||
</>)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
App.propTypes = { Router: PropTypes.elementType, routerProps: PropTypes.object };
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { useState } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
import { FiMoon, FiSun } from "react-icons/fi";
|
||||
|
||||
export default function ThemeToggle() {
|
||||
const [theme, setTheme] = useState(() => document.documentElement.dataset.bsTheme === "light" ? "light" : "dark");
|
||||
const [theme, setTheme] = useState("dark");
|
||||
useEffect(() => { setTheme(document.documentElement.dataset.bsTheme === "light" ? "light" : "dark"); }, []);
|
||||
function toggle() {
|
||||
const next = theme === "dark" ? "light" : "dark";
|
||||
document.documentElement.dataset.bsTheme = next;
|
||||
|
||||
@@ -8,3 +8,12 @@ export const site = Object.freeze({
|
||||
export function pageTitle(title) {
|
||||
return title ? site.titleTemplate.replace("%s", title) : site.defaultTitle;
|
||||
}
|
||||
|
||||
export const publicPageMeta = Object.freeze({
|
||||
"/": { title: "", description: site.description },
|
||||
"/services": { title: "Services", description: "Website development, custom software, API integration and managed hosting from BortStack." },
|
||||
"/about": { title: "About", description: "BortStack’s approach to practical software development, clear communication and ongoing support." },
|
||||
"/contact": { title: "Contact", description: "Discuss your software project with BortStack." },
|
||||
"/projects": { title: "Projects", description: "Explore BortStack software projects: RouletteBuddy, PitchInvader and API Admin." },
|
||||
"/privacy": { title: "Privacy policy", description: "How the BortStack website handles theme preferences and project enquiries.", noIndex: true },
|
||||
});
|
||||
|
||||
+5
-6
@@ -1,9 +1,8 @@
|
||||
import { StrictMode } from 'react'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import { createRoot, hydrateRoot } from 'react-dom/client'
|
||||
import App from './App.jsx'
|
||||
|
||||
createRoot(document.getElementById('root')).render(
|
||||
<StrictMode>
|
||||
<App />
|
||||
</StrictMode>,
|
||||
)
|
||||
const root = document.getElementById('root')
|
||||
const app = <StrictMode><App /></StrictMode>
|
||||
if (root.hasChildNodes() && document.documentElement.dataset.prerenderPath === window.location.pathname) hydrateRoot(root, app)
|
||||
else createRoot(root).render(app)
|
||||
|
||||
@@ -52,6 +52,7 @@ h1, h2, h3 { color: var(--site-text); font-weight: 650; line-height: 1.15; lette
|
||||
.routePlaceholder { padding-block: clamp(4rem, 10vw, 8rem); max-width: 850px; }
|
||||
.routePlaceholder h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
|
||||
.routePlaceholder > p:not(.eyebrow) { color: var(--site-muted); max-width: 60ch; margin-block: 1.5rem; }
|
||||
.routePlaceholder code { color: var(--site-link); }
|
||||
.themeToggle {
|
||||
position: relative; display: inline-flex; flex-shrink: 0; align-items: center;
|
||||
width: 70px; height: 30px; padding: 1px; border-radius: 18px;
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
import { Container } from "react-bootstrap";
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
export default function Privacy() {
|
||||
return (
|
||||
<main>
|
||||
<article>
|
||||
<h1>Privacy policy</h1>
|
||||
<p role="note">
|
||||
This is a template placeholder. Replace it with a policy
|
||||
reviewed for the generated application, its data handling,
|
||||
providers, jurisdiction, and users before production.
|
||||
</p>
|
||||
</article>
|
||||
</main>
|
||||
);
|
||||
return <Container as="article" className="routePlaceholder">
|
||||
<p className="eyebrow">BortStack · Privacy</p>
|
||||
<h1>Privacy policy</h1>
|
||||
<p>This page describes the current website’s technical handling of project enquiries and theme preferences. The full privacy notice is pending review before publication.</p>
|
||||
<h2>Project enquiries</h2>
|
||||
<p>The contact form asks for your name, email address and project description. You may also choose a service. The independent contact service validates these details and, when email delivery is enabled, sends the enquiry to BortStack through Resend. Your address is used as the reply-to address. Enquiry details are used to respond, discuss potential project work and prepare a proposal or quote when requested. They are not used for later marketing messages. The website does not save an enquiry in its own database or in browser storage.</p>
|
||||
<p>Enquiries that do not become client work are reviewed after 12 months and deleted when there is no continuing business reason to keep them. Relevant correspondence for a client project is handled under a separate client-record policy. Mail backup retention remains to be confirmed.</p>
|
||||
<h2>Who handles enquiries</h2>
|
||||
<p>Resend processes outbound enquiry emails and stores message content and delivery records in the United States. Its published data processing agreement describes safeguards for transfers from the European Economic Area. Received mail is hosted with Hetzner in Helsinki, Finland. Prospective enquiries are not passed to a CRM, helpdesk or subcontractor. Resend’s own storage period depends on the account plan and must be checked against the configured account before publication.</p>
|
||||
<h2>Theme preference</h2>
|
||||
<p>If you switch between dark and light themes, the browser stores your choice locally under <code>bortstack-theme</code>. The site remains usable if that storage is unavailable.</p>
|
||||
<h2>Further details</h2>
|
||||
<p>Robert O’Reilly is responsible for how BortStack project enquiries are handled. To ask about your enquiry information or request access, correction or deletion, email <a href="mailto:support@bortstack.com">support@bortstack.com</a>. Requests are assessed under applicable data protection rules; deletion is not automatic where information still needs to be kept. The legal basis, backup retention and full data-rights wording are still being confirmed. This page must be reviewed and completed before the website is published.</p>
|
||||
<p><Link to="/contact">Contact BortStack</Link></p>
|
||||
</Container>;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ describe("public marketing routes", () => {
|
||||
await waitFor(() => expect(screen.getByText(/Enquiries are temporarily unavailable/)).toBeInTheDocument());
|
||||
}
|
||||
else expect(fetchMock).not.toHaveBeenCalled();
|
||||
if (path === "/privacy") await waitFor(() => expect(document.querySelector('meta[name="robots"]')).toHaveAttribute("content", "noindex, nofollow"));
|
||||
expect(screen.queryByRole("link", { name: /login|register|dashboard/i })).not.toBeInTheDocument();
|
||||
});
|
||||
it("exposes the four marketing links and closes navigation on selection", async () => {
|
||||
|
||||
@@ -14,10 +14,12 @@ describe("generic public pages", () => {
|
||||
expect(screen.getByRole("heading", { name: /software solutions/i })).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("marks legal pages as placeholders", () => {
|
||||
const { rerender } = render(<Privacy />);
|
||||
expect(screen.getByText(/template placeholder/i)).toBeInTheDocument();
|
||||
rerender(<Terms />);
|
||||
it("describes verified privacy flows while leaving terms unpublished", () => {
|
||||
const { unmount } = render(<MemoryRouter><Privacy /></MemoryRouter>);
|
||||
expect(screen.getByText(/The contact form asks for your name/i)).toBeInTheDocument();
|
||||
expect(screen.getByText(/full privacy notice is pending review/i)).toBeInTheDocument();
|
||||
unmount();
|
||||
render(<Terms />);
|
||||
expect(screen.getByText(/template placeholder/i)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user