diff --git a/src/core/env/Environment.ts b/src/core/env/Environment.ts index c3bead6b9..44085efb7 100644 --- a/src/core/env/Environment.ts +++ b/src/core/env/Environment.ts @@ -2,6 +2,8 @@ import IApiClient from 'core/api/client/IApiClient'; type EnvVars = { FEAT_AREAS?: string | null; + INSTANCE_OWNER_HREF?: string | null; + INSTANCE_OWNER_NAME?: string | null; MUIX_LICENSE_KEY: string | null; ZETKIN_APP_DOMAIN: string | null; ZETKIN_GEN2_ORGANIZE_URL?: string | null; diff --git a/src/features/surveys/components/surveyForm/SurveyFooter.tsx b/src/features/surveys/components/surveyForm/SurveyFooter.tsx index d416698ed..70f5acad9 100644 --- a/src/features/surveys/components/surveyForm/SurveyFooter.tsx +++ b/src/features/surveys/components/surveyForm/SurveyFooter.tsx @@ -7,8 +7,10 @@ import messageIds from 'features/surveys/l10n/messageIds'; import { Msg, useMessages } from 'core/i18n'; import SurveyContainer from './SurveyContainer'; import theme from 'theme'; +import { useEnv } from 'core/hooks'; const SurveyFooter: FC = () => { + const env = useEnv(); const messages = useMessages(messageIds); const links = useMemo( @@ -19,16 +21,17 @@ const SurveyFooter: FC = () => { }, { href: - process.env.ZETKIN_PRIVACY_POLICY_LINK || - messages.surveyForm.policy.link(), + typeof env.vars.ZETKIN_PRIVACY_POLICY_LINK === 'string' + ? env.vars.ZETKIN_PRIVACY_POLICY_LINK + : messages.surveyForm.policy.link(), text: messages.surveyFooter.links.privacy(), }, - ...(typeof process.env.NEXT_PUBLIC_INSTANCE_OWNER_NAME === 'string' && - typeof process.env.NEXT_PUBLIC_INSTANCE_OWNER_NAME_HREF === 'string' + ...(typeof process.env.INSTANCE_OWNER_NAME === 'string' && + typeof process.env.INSTANCE_OWNER_HREF === 'string' ? [ { - href: process.env.NEXT_PUBLIC_INSTANCE_OWNER_NAME_HREF, - text: process.env.NEXT_PUBLIC_INSTANCE_OWNER_NAME, + href: env.vars.INSTANCE_OWNER_HREF as string, + text: env.vars.INSTANCE_OWNER_NAME as string, }, ] : []), @@ -49,7 +52,7 @@ const SurveyFooter: FC = () => { - {typeof process.env.NEXT_PUBLIC_INSTANCE_OWNER_NAME === 'string' && ( + {typeof env.vars.INSTANCE_OWNER_NAME === 'string' && ( {