From c19f235e5f4c9dc00c0b0f747e612e46f2c8296a Mon Sep 17 00:00:00 2001 From: Arvid Norlin Date: Wed, 21 Feb 2024 15:10:14 +0100 Subject: [PATCH] refactor: read ADOBE_SCRIPTS_SRC from env --- .env.local.example | 3 ++- components/Current/AdobeScript.tsx | 14 +++----------- env/server.ts | 2 ++ 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/.env.local.example b/.env.local.example index 0592f3b4a..5b058d208 100644 --- a/.env.local.example +++ b/.env.local.example @@ -3,4 +3,5 @@ CMS_API_KEY="" CMS_ENVIRONMENT="development" CMS_URL="https://eu-graphql.contentstack.com/stacks/${CMS_API_KEY}?environment=${CMS_ENVIRONMENT}" CMS_PREVIEW_URL="https://graphql-preview.contentstack.com/stacks/${CMS_API_KEY}?environment=${CMS_ENVIRONMENT}"; -CMS_PREVIEW_TOKEN="" \ No newline at end of file +CMS_PREVIEW_TOKEN="" +ADOBE_SCRIPT_SRC="" \ No newline at end of file diff --git a/components/Current/AdobeScript.tsx b/components/Current/AdobeScript.tsx index b52508b2d..197347235 100644 --- a/components/Current/AdobeScript.tsx +++ b/components/Current/AdobeScript.tsx @@ -2,22 +2,14 @@ import { env } from "@/env/server" import Script from "next/script" -const scriptScrs = { - // TODO: decide on naming and environments (development vs. test vs. staging etc) - development: "", - test: "https://assets.adobedtm.com/c1bd08b1e4e7/d64a7c1f5f17/launch-84c70d82a50c-staging.min.js", - production: - "https://assets.adobedtm.com/c1bd08b1e4e7/d64a7c1f5f17/launch-e56085bbe998.min.js", -} - export default function AdobeScript() { - return ( + return env.ADOBE_SCRIPT_SRC ? ( <> -