From 1afa7596d065de1428dd359f09d1028c877c6233 Mon Sep 17 00:00:00 2001 From: valentinkolb Date: Mon, 13 May 2024 18:41:56 +0200 Subject: [PATCH] fix(app): added legal pages and made formUtil description HTML --- src/Router.tsx | 15 +- src/components/auth/modals/LoginModal.tsx | 14 +- src/components/auth/modals/RegisterModal.tsx | 41 ++++- .../FromInput/formFieldComponents.tsx | 164 ++++++++++++++++++ .../{fromInput => FromInput}/index.tsx | 15 +- .../{fromInput => FromInput}/types.ts | 0 .../{fromInput => FromInput}/validation.ts | 2 +- .../formUtil/formBuilder/editField.tsx | 26 ++- src/components/formUtil/formBuilder/index.tsx | 2 +- .../formUtil/formTable/RenderCell.tsx | 2 +- src/components/formUtil/formTable/index.tsx | 2 +- src/components/formUtil/formTable/sorter.ts | 2 +- .../fromInput/formFieldComponents.tsx | 118 ------------- .../input/CheckboxCard/index.module.css | 5 + src/components/input/CheckboxCard/index.tsx | 6 +- src/components/input/Editor/index.tsx | 18 +- src/components/layout/footer/index.tsx | 8 +- src/lib/settings.ts | 1 + src/models/EventTypes.ts | 2 +- src/models/index.ts | 9 + src/pages/LegalPage.tsx | 33 ++++ .../e/:eventId/EventComponents/EventAGB.tsx | 2 +- .../UpdateEventListSlotEntryFormModal.tsx | 4 +- .../UpdateEventListSlotEntryStatusModal.tsx | 4 +- src/pages/events/s/EventListSlotView.tsx | 4 +- src/pages/privacy-policy.page.tsx | 20 --- src/pages/terms-and-conditions.page.tsx | 20 --- 27 files changed, 324 insertions(+), 215 deletions(-) create mode 100644 src/components/formUtil/FromInput/formFieldComponents.tsx rename src/components/formUtil/{fromInput => FromInput}/index.tsx (94%) rename src/components/formUtil/{fromInput => FromInput}/types.ts (100%) rename src/components/formUtil/{fromInput => FromInput}/validation.ts (98%) delete mode 100644 src/components/formUtil/fromInput/formFieldComponents.tsx create mode 100644 src/pages/LegalPage.tsx delete mode 100644 src/pages/privacy-policy.page.tsx delete mode 100644 src/pages/terms-and-conditions.page.tsx diff --git a/src/Router.tsx b/src/Router.tsx index e991c22..0c1edb7 100644 --- a/src/Router.tsx +++ b/src/Router.tsx @@ -4,8 +4,7 @@ import NotFound from "./pages/not-found/index.page.tsx"; import Layout from "@/components/layout"; import QRCodeGenerator from "./pages/util/qr/index.page.tsx"; import EventsRouter from "./pages/events/EventsRouter.tsx"; -import PrivacyPolicy from "./pages/privacy-policy.page.tsx"; -import TermsAndConditions from "./pages/terms-and-conditions.page.tsx"; +import LegalPage from "@/pages/LegalPage.tsx"; const router = createBrowserRouter([ { @@ -17,16 +16,8 @@ const router = createBrowserRouter([ element: }, { - path: "privacy-policy", - element: - }, - { - path: "imprint", - element: - }, - { - path: "terms-and-conditions", - element: + path: "legal/:page", + element: }, { path: "events/*", diff --git a/src/components/auth/modals/LoginModal.tsx b/src/components/auth/modals/LoginModal.tsx index 1c972e2..8fef763 100644 --- a/src/components/auth/modals/LoginModal.tsx +++ b/src/components/auth/modals/LoginModal.tsx @@ -36,7 +36,7 @@ export default function LoginModal() { username: "", password: "", authMethod: "ldap" as "ldap" | "guest", - privacy: false + terms: false } }) @@ -94,23 +94,23 @@ export default function LoginModal() { required label={ - Ich akzeptiere die - Datenschutzerklärung - . + AGB der StuVe + gelesen und nehme sie zur Kenntnis } - {...formValues.getInputProps("privacy", {type: "checkbox"})} + {...formValues.getInputProps("terms", {type: "checkbox"})} />