From b2382826c0ebcc027f5fea3286cd7e417eea5d6a Mon Sep 17 00:00:00 2001 From: katspaugh <381895+katspaugh@users.noreply.github.com> Date: Tue, 3 Dec 2024 11:01:15 +0100 Subject: [PATCH 1/9] Feat: check page hostname to toggle trademark elements --- .github/workflows/build/action.yml | 1 - README.md | 1 - src/components/common/Footer/index.tsx | 6 ++++-- src/components/common/Header/index.tsx | 28 ++++++++++++++++---------- src/config/constants.ts | 2 +- src/hooks/useIsOfficialHost.ts | 6 ++++++ src/pages/cookie.tsx | 6 ++++-- src/pages/imprint.tsx | 6 ++++-- src/pages/licenses.tsx | 6 ++++-- src/pages/privacy.tsx | 6 ++++-- src/pages/terms.tsx | 6 ++++-- 11 files changed, 48 insertions(+), 26 deletions(-) create mode 100644 src/hooks/useIsOfficialHost.ts diff --git a/.github/workflows/build/action.yml b/.github/workflows/build/action.yml index ba6ad94d7e..99a1f8d09d 100644 --- a/.github/workflows/build/action.yml +++ b/.github/workflows/build/action.yml @@ -50,7 +50,6 @@ runs: NEXT_PUBLIC_WC_PROJECT_ID: ${{ fromJSON(inputs.secrets).NEXT_PUBLIC_WC_PROJECT_ID }} NEXT_PUBLIC_SAFE_RELAY_SERVICE_URL_PRODUCTION: ${{ fromJSON(inputs.secrets).NEXT_PUBLIC_SAFE_GELATO_RELAY_SERVICE_URL_PRODUCTION }} NEXT_PUBLIC_SAFE_RELAY_SERVICE_URL_STAGING: ${{ fromJSON(inputs.secrets).NEXT_PUBLIC_SAFE_GELATO_RELAY_SERVICE_URL_STAGING }} - NEXT_PUBLIC_IS_OFFICIAL_HOST: ${{ fromJSON(inputs.secrets).NEXT_PUBLIC_IS_OFFICIAL_HOST }} NEXT_PUBLIC_BLOCKAID_CLIENT_ID: ${{ fromJSON(inputs.secrets).NEXT_PUBLIC_BLOCKAID_CLIENT_ID }} NEXT_PUBLIC_SOCIAL_WALLET_OPTIONS_STAGING: ${{ fromJSON(inputs.secrets).NEXT_PUBLIC_SOCIAL_WALLET_OPTIONS_STAGING }} NEXT_PUBLIC_SOCIAL_WALLET_OPTIONS_PRODUCTION: ${{ fromJSON(inputs.secrets).NEXT_PUBLIC_SOCIAL_WALLET_OPTIONS_PRODUCTION }} diff --git a/README.md b/README.md index 9daa12ad6d..6befc57202 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,6 @@ Here's the list of all the environment variables: | `NEXT_PUBLIC_GOOGLE_TAG_MANAGER_LATEST_AUTH` | Preview GTM key | | `NEXT_PUBLIC_GOOGLE_TAG_MANAGER_LIVE_AUTH` | Production GTM key | | `NEXT_PUBLIC_SENTRY_DSN` | [Sentry](https://sentry.io) id for tracking runtime errors | -| `NEXT_PUBLIC_IS_OFFICIAL_HOST` | Whether it's the official distribution of the app, or a fork; has legal implications. Set to true only if you also update the legal pages like Imprint and Terms of use | | `NEXT_PUBLIC_REDEFINE_API` | Redefine API base URL | | `NEXT_PUBLIC_FIREBASE_OPTIONS_PRODUCTION` | Firebase Cloud Messaging (FCM) `initializeApp` options on production | | `NEXT_PUBLIC_FIREBASE_VAPID_KEY_PRODUCTION` | FCM vapid key on production | diff --git a/src/components/common/Footer/index.tsx b/src/components/common/Footer/index.tsx index de2d36f115..f01e46dda1 100644 --- a/src/components/common/Footer/index.tsx +++ b/src/components/common/Footer/index.tsx @@ -8,7 +8,8 @@ import { AppRoutes } from '@/config/routes' import packageJson from '../../../../package.json' import ExternalLink from '../ExternalLink' import MUILink from '@mui/material/Link' -import { HELP_CENTER_URL, IS_DEV, IS_OFFICIAL_HOST } from '@/config/constants' +import { HELP_CENTER_URL } from '@/config/constants' +import { useIsOfficialHost } from '@/hooks/useIsOfficialHost' const footerPages = [ AppRoutes.welcome.index, @@ -32,6 +33,7 @@ const FooterLink = ({ children, href }: { children: ReactNode; href: string }): const Footer = (): ReactElement | null => { const router = useRouter() + const isOfficialHost = useIsOfficialHost() if (!footerPages.some((path) => router.pathname.startsWith(path))) { return null @@ -44,7 +46,7 @@ const Footer = (): ReactElement | null => { return (