From e69d120bd9ce710f730049ba106ec0358cee5266 Mon Sep 17 00:00:00 2001 From: Innei Date: Thu, 15 May 2025 23:58:07 +0800 Subject: [PATCH] feat(legal): integrate privacy policy and terms of service into the application, #3577 - Added a new internal package for legal documents, including privacy policy and terms of service. - Implemented a build script to convert markdown files to HTML for easy access. - Updated the mobile and desktop applications to link to the new legal documents. - Enhanced the login modal to include links to the privacy policy and terms of service. - Updated routing in the SSR application to serve the legal documents. These changes ensure compliance with legal requirements and improve user access to important information. Signed-off-by: Innei --- .../renderer/src/modules/auth/LegalModal.tsx | 25 ++++ .../src/modules/auth/LoginModalContent.tsx | 32 +++- apps/desktop/package.json | 1 + apps/mobile/package.json | 1 + apps/mobile/src/modules/login/index.tsx | 17 ++- .../src/modules/settings/routes/Privacy.tsx | 7 + .../mobile/src/screens/(headless)/privacy.tsx | 30 ++++ apps/mobile/src/screens/(headless)/terms.tsx | 81 +--------- apps/mobile/src/sitemap.tsx | 3 +- apps/ssr/index.ts | 2 + apps/ssr/package.json | 1 + apps/ssr/src/router/static.ts | 13 ++ locales/app/en.json | 3 + locales/app/zh-CN.json | 3 + locales/external/en.json | 2 +- locales/settings/en.json | 1 + package.json | 2 + packages/internal/legal/package.json | 16 ++ packages/internal/legal/privacy.md | 141 ++++++++++++++++++ packages/internal/legal/script/build.ts | 132 ++++++++++++++++ packages/internal/legal/tos.md | 109 ++++++++++++++ pnpm-lock.yaml | 22 +++ turbo.json | 5 + vercel.json | 20 +++ 24 files changed, 585 insertions(+), 84 deletions(-) create mode 100644 apps/desktop/layer/renderer/src/modules/auth/LegalModal.tsx create mode 100644 apps/mobile/src/screens/(headless)/privacy.tsx create mode 100644 apps/ssr/src/router/static.ts create mode 100644 packages/internal/legal/package.json create mode 100644 packages/internal/legal/privacy.md create mode 100644 packages/internal/legal/script/build.ts create mode 100644 packages/internal/legal/tos.md diff --git a/apps/desktop/layer/renderer/src/modules/auth/LegalModal.tsx b/apps/desktop/layer/renderer/src/modules/auth/LegalModal.tsx new file mode 100644 index 000000000..c30f451aa --- /dev/null +++ b/apps/desktop/layer/renderer/src/modules/auth/LegalModal.tsx @@ -0,0 +1,25 @@ +import { legalHtml } from "@follow/legal" +import { stopPropagation } from "@follow/utils/dom" +import { m } from "motion/react" +import type { FC } from "react" + +type LegalModalProps = { + type: "privacy" | "tos" +} + +export const LegalModalContent: FC = ({ type }) => { + const content = type === "privacy" ? legalHtml.privacy : legalHtml.tos + + return ( + +
+