From 904e8be4d497b1bc1e1fa8d69b30b49629810baa Mon Sep 17 00:00:00 2001 From: Juan Cazala Date: Wed, 13 Nov 2024 12:39:05 -0300 Subject: [PATCH] chore: move contentful stuff to config --- src/components/Navbar/utils.ts | 8 ++++---- src/config/env/dev.json | 8 ++++++-- src/config/env/prod.json | 8 ++++++-- src/config/env/stg.json | 8 ++++++-- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/components/Navbar/utils.ts b/src/components/Navbar/utils.ts index cba32d48..68bfe11d 100644 --- a/src/components/Navbar/utils.ts +++ b/src/components/Navbar/utils.ts @@ -41,10 +41,10 @@ export const getExtraButton = async () => { } } try { - const SPACE_ID = 'ea2ybdmmn1kv' - const ENV = 'master' - const ACCESS_TOKEN = '9dieh3AHS6uwb_YNMjxlO6FCibAFFJVdg2YzA5t6U-Y' - const ENTRY_ID = '18g1DzIyBxvu0steSwKyQr' + const SPACE_ID = config.get('CONTENTFUL_SPACE_ID') + const ENV = config.get('CONTENTFUL_ENV') + const ACCESS_TOKEN = config.get('CONTENTFUL_NAVBAR_ACCESS_TOKEN') + const ENTRY_ID = config.get('CONTENTFUL_NAVBAR_ENTRY_ID') const CONTENTFUL_URL = `https://cdn.contentful.com/spaces/${SPACE_ID}/environments/${ENV}/entries/${ENTRY_ID}?access_token=${ACCESS_TOKEN}` const response = await fetch(CONTENTFUL_URL) const entry = await response.json() diff --git a/src/config/env/dev.json b/src/config/env/dev.json index a92b1883..348210c0 100644 --- a/src/config/env/dev.json +++ b/src/config/env/dev.json @@ -34,5 +34,9 @@ "DOCS_DAO_URL": "https://docs.decentraland.org/player/general/dao/overview/what-is-the-dao/", "BLOG_URL": "https://decentraland.zone/blog/", "LANDING_CREATORS_URL": "https://decentraland.zone/create/", - "DOWNLOAD_URL": "https://decentraland.zone/download/" -} + "DOWNLOAD_URL": "https://decentraland.zone/download/", + "CONTENTFUL_SPACE_ID": "ea2ybdmmn1kv", + "CONTENTFUL_ENV": "master", + "CONTENTFUL_NAVBAR_ACCESS_TOKEN": "9dieh3AHS6uwb_YNMjxlO6FCibAFFJVdg2YzA5t6U-Y", + "CONTENTFUL_NAVBAR_ENTRY_ID": "18g1DzIyBxvu0steSwKyQr" +} \ No newline at end of file diff --git a/src/config/env/prod.json b/src/config/env/prod.json index ec924ff8..74ddf619 100644 --- a/src/config/env/prod.json +++ b/src/config/env/prod.json @@ -34,5 +34,9 @@ "DOCS_DAO_URL": "https://docs.decentraland.org/player/general/dao/overview/what-is-the-dao/", "BLOG_URL": "https://decentraland.org/blog/", "LANDING_CREATORS_URL": "https://decentraland.org/create/", - "DOWNLOAD_URL": "https://decentraland.org/download/" -} + "DOWNLOAD_URL": "https://decentraland.org/download/", + "CONTENTFUL_SPACE_ID": "ea2ybdmmn1kv", + "CONTENTFUL_ENV": "master", + "CONTENTFUL_NAVBAR_ACCESS_TOKEN": "9dieh3AHS6uwb_YNMjxlO6FCibAFFJVdg2YzA5t6U-Y", + "CONTENTFUL_NAVBAR_ENTRY_ID": "18g1DzIyBxvu0steSwKyQr" +} \ No newline at end of file diff --git a/src/config/env/stg.json b/src/config/env/stg.json index 745ad31f..9d3d4f3e 100644 --- a/src/config/env/stg.json +++ b/src/config/env/stg.json @@ -34,5 +34,9 @@ "DOCS_DAO_URL": "https://docs.decentraland.org/player/general/dao/overview/what-is-the-dao/", "BLOG_URL": "https://decentraland.today/blog/", "LANDING_CREATORS_URL": "https://decentraland.today/create/", - "DOWNLOAD_URL": "https://decentraland.todat/download/" -} + "DOWNLOAD_URL": "https://decentraland.todat/download/", + "CONTENTFUL_SPACE_ID": "ea2ybdmmn1kv", + "CONTENTFUL_ENV": "master", + "CONTENTFUL_NAVBAR_ACCESS_TOKEN": "9dieh3AHS6uwb_YNMjxlO6FCibAFFJVdg2YzA5t6U-Y", + "CONTENTFUL_NAVBAR_ENTRY_ID": "18g1DzIyBxvu0steSwKyQr" +} \ No newline at end of file