diff --git a/webapp/Dockerfile b/webapp/Dockerfile index 15f04b69..33fd521c 100644 --- a/webapp/Dockerfile +++ b/webapp/Dockerfile @@ -8,6 +8,17 @@ COPY yarn.lock .yarnrc.yml ./ COPY .yarn .yarn RUN yarn fetch +ARG NEXT_PUBLIC_JWT_NAME +ENV NEXT_PUBLIC_JWT_NAME=$NEXT_PUBLIC_JWT_NAME +ARG NEXT_PUBLIC_MATOMO_URL +ENV NEXT_PUBLIC_MATOMO_URL=$NEXT_PUBLIC_MATOMO_URL +ARG NEXT_PUBLIC_MATOMO_SITE_ID +ENV NEXT_PUBLIC_MATOMO_SITE_ID=$NEXT_PUBLIC_MATOMO_SITE_ID +ARG NEXT_PUBLIC_MATOMO_TRACKING_ENABLED +ENV NEXT_PUBLIC_MATOMO_TRACKING_ENABLED=$NEXT_PUBLIC_MATOMO_TRACKING_ENABLED +ARG NEXT_PUBLIC_CRISP_TOKEN +ENV NEXT_PUBLIC_CRISP_TOKEN=$NEXT_PUBLIC_CRISP_TOKEN + COPY . . RUN --mount=type=secret,id=sentry_auth_token export SENTRY_AUTH_TOKEN="$(cat /run/secrets/sentry_auth_token)"; \ yarn build diff --git a/webapp/src/components/support/Crisp.ts b/webapp/src/components/support/Crisp.ts index 33450dd4..b7ee79a1 100644 --- a/webapp/src/components/support/Crisp.ts +++ b/webapp/src/components/support/Crisp.ts @@ -6,13 +6,13 @@ import { UserIncluded } from "~/server/api/routers/user"; type CrispProps = { user: UserIncluded; + crispToken: string; onClose: () => void; } -const crispToken = process.env.NEXT_PUBLIC_CRISP_TOKEN as string const CrispChat = (props: CrispProps) => { - const { user, onClose } = props; + const { user, onClose, crispToken } = props; useEffect(() => { if (crispToken) { Crisp.configure(crispToken, { diff --git a/webapp/src/pages/dashboard/account/index.tsx b/webapp/src/pages/dashboard/account/index.tsx index 053d73b5..039c814a 100644 --- a/webapp/src/pages/dashboard/account/index.tsx +++ b/webapp/src/pages/dashboard/account/index.tsx @@ -25,6 +25,8 @@ import { UserIncluded } from "~/server/api/routers/user"; import NewPassComponent from "~/components/NewPassComponent"; import dynamic from "next/dynamic"; +const CRISP_TOKEN = process.env.NEXT_PUBLIC_CRISP_TOKEN as string + const displayDynamicCJECardMessage = (user: User) => { if (!user.image) { return ( @@ -260,7 +262,7 @@ export default function Account() { onClose={() => setIsOpenNewPassComponent(false)} /> { - isOpenCrisp && user && ( { + isOpenCrisp && user && ( { setIsOpenCrisp(false) }} />) }