From aee768e850254fae1ec6b6af5bf9d2396b31e036 Mon Sep 17 00:00:00 2001 From: Kristof Csillag Date: Wed, 14 Feb 2024 10:03:55 +0100 Subject: [PATCH] More white-labeling: support for replacing icons and thumbnail Now web manifest, og:image and favicon can also be configured from .env Also, add _META_ to the name of some .env entries. --- .changelog/1255.trivial.md | 1 + .env | 7 +++++-- .env.production | 7 +++++-- public/index.html | 14 +++++++------- src/config.ts | 2 +- src/global.d.ts | 7 +++++-- 6 files changed, 24 insertions(+), 14 deletions(-) create mode 100644 .changelog/1255.trivial.md diff --git a/.changelog/1255.trivial.md b/.changelog/1255.trivial.md new file mode 100644 index 000000000..5f9f76dd4 --- /dev/null +++ b/.changelog/1255.trivial.md @@ -0,0 +1 @@ +More white-labeling: support for replacing icons and thumbnail diff --git a/.env b/.env index 8c9ae3795..b9a2106eb 100644 --- a/.env +++ b/.env @@ -6,8 +6,11 @@ REACT_APP_BUILD_VERSION= # REACT_APP_TESTNET_API=https://testnet.nexus.stg.oasis.io/v1/ REACT_APP_API=https://nexus.oasis.io/v1/ REACT_APP_TESTNET_API=https://testnet.nexus.oasis.io/v1/ -REACT_APP_TITLE=Oasis Explorer -REACT_APP_DESC=Official explorer for the Oasis Network. +REACT_APP_META_TITLE=Oasis Explorer +REACT_APP_META_IMAGE=oasis-og-image.jpg +REACT_APP_META_MANIFEST=app.webmanifest +REACT_APP_META_FAVICON=favicon.ico +REACT_APP_META_DESC=Official explorer for the Oasis Network. REACT_APP_SOCIAL_TELEGRAM=https://t.me/oasisprotocolcommunity REACT_APP_SOCIAL_TWITTER=https://twitter.com/oasisprotocol REACT_APP_SOCIAL_DISCORD=https://oasis.io/discord diff --git a/.env.production b/.env.production index b4d3e8010..898bc2346 100644 --- a/.env.production +++ b/.env.production @@ -1,8 +1,11 @@ REACT_APP_BUILD_DATETIME= REACT_APP_BUILD_SHA= REACT_APP_BUILD_VERSION= -REACT_APP_TITLE=Oasis Explorer -REACT_APP_DESC=Official explorer for the Oasis Network. +REACT_APP_META_TITLE=Oasis Explorer +REACT_APP_META_IMAGE=oasis-og-image.jpg +REACT_APP_META_MANIFEST=app.webmanifest +REACT_APP_META_FAVICON=favicon.ico +REACT_APP_META_DESC=Official explorer for the Oasis Network. REACT_APP_SOCIAL_TELEGRAM=https://t.me/oasisprotocolcommunity REACT_APP_SOCIAL_TWITTER=https://twitter.com/oasisprotocol REACT_APP_SOCIAL_DISCORD=https://oasis.io/discord diff --git a/public/index.html b/public/index.html index 3131e5e5a..466612389 100644 --- a/public/index.html +++ b/public/index.html @@ -3,17 +3,17 @@ - + - - - - + + + + - $REACT_APP_TITLE - + $REACT_APP_META_TITLE + diff --git a/src/config.ts b/src/config.ts index faa426e93..fa6ce54c4 100644 --- a/src/config.ts +++ b/src/config.ts @@ -163,4 +163,4 @@ export const deploys = { const stableDeploys = [...deploys.production, deploys.staging] export const isStableDeploy = stableDeploys.some(url => window.location.origin === url) -export const getAppTitle = () => process.env.REACT_APP_TITLE +export const getAppTitle = () => process.env.REACT_APP_META_TITLE diff --git a/src/global.d.ts b/src/global.d.ts index 056dc202a..dc359c103 100644 --- a/src/global.d.ts +++ b/src/global.d.ts @@ -8,8 +8,11 @@ declare global { REACT_APP_API: string REACT_APP_TESTNET_API: string REACT_APP_SHOW_BUILD_BANNERS?: 'true' | 'false' - REACT_APP_TITLE: string - REACT_APP_DESC: string + REACT_APP_META_TITLE: string + REACT_APP_META_IMAGE: string + REACT_APP_META_MANIFEST: string + REACT_APP_META_FAVICON: string + REACT_APP_META_DESC: string REACT_APP_SOCIAL_TELEGRAM?: string REACT_APP_SOCIAL_TWITTER?: string REACT_APP_SOCIAL_DISCORD?: string