-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1244 from oasisprotocol/csillag/white-label
Support for white-labeling Explorer
- Loading branch information
Showing
16 changed files
with
456 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add support for white-labeling Explorer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
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_SOCIAL_TELEGRAM=https://t.me/oasisprotocolcommunity | ||
REACT_APP_SOCIAL_TWITTER=https://twitter.com/oasisprotocol | ||
REACT_APP_SOCIAL_DISCORD=https://oasis.io/discord | ||
REACT_APP_SOCIAL_YOUTUBE=https://www.youtube.com/channel/UC35UFPcZ2F1wjPxhPrSsESQ | ||
REACT_APP_SOCIAL_REDDIT=https://www.reddit.com/r/oasisnetwork/ | ||
# REACT_APP_SOCIAL_LINKEDIN=https://www.linkedin.com/company/oasisprotocol | ||
# REACT_APP_SOCIAL_DOCS=https://oasisprotocol.org/developers#overview | ||
# REACT_APP_SOCIAL_HOME=https://oasisprotocol.org/ | ||
REACT_APP_PROD_URL=https://explorer.oasis.io, https://explorer.prd.oasis.io | ||
REACT_APP_STAGING_URL=https://explorer.stg.oasis.io | ||
REACT_APP_SHOW_BUILD_BANNERS=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"extends": "@parcel/config-default", | ||
"transformers": { | ||
"*.html": [ | ||
"@plasmohq/parcel-transformer-inject-env", | ||
"..." | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
import { FC } from 'react' | ||
import { useTranslation } from 'react-i18next' | ||
import { deploys } from '../../../config' | ||
import { deploys, getAppTitle } from '../../../config' | ||
import { StickyAlert } from '../StickyAlert' | ||
|
||
const useBuildBanners = process.env.REACT_APP_SHOW_BUILD_BANNERS === 'true' | ||
|
||
export const BuildBanner: FC = () => { | ||
const { t } = useTranslation() | ||
|
||
if (window.location.origin === deploys.localhost) { | ||
if (!useBuildBanners || window.location.origin === deploys.localhost) { | ||
return null | ||
} | ||
if (deploys.production.includes(window.location.origin)) { | ||
return null | ||
} | ||
if (window.location.origin === deploys.staging) { | ||
if (deploys.staging.includes(window.location.origin)) { | ||
return <StickyAlert severity="warning">{t('banner.buildStaging')}</StickyAlert> | ||
} | ||
return <StickyAlert severity="warning">{t('banner.buildPreview')}</StickyAlert> | ||
return <StickyAlert severity="warning">{t('banner.buildPreview', { appTitle: getAppTitle() })}</StickyAlert> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
declare global { | ||
namespace NodeJS { | ||
interface ProcessEnv { | ||
NODE_ENV: 'development' | 'production' | 'test' | ||
REACT_APP_BUILD_DATETIME: string | ||
REACT_APP_BUILD_SHA: string | ||
REACT_APP_BUILD_VERSION: string | ||
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_SOCIAL_TELEGRAM?: string | ||
REACT_APP_SOCIAL_TWITTER?: string | ||
REACT_APP_SOCIAL_DISCORD?: string | ||
REACT_APP_SOCIAL_YOUTUBE?: string | ||
REACT_APP_SOCIAL_REDDIT?: string | ||
READ_APP_SOCIAL_LINKEDIN?: string | ||
READ_APP_SOCIAL_DOCS?: string | ||
READ_APP_SOCIAL_HOME?: string | ||
REACT_APP_PROD_URL: string | ||
REACT_APP_STAGING_URL?: string | ||
} | ||
} | ||
} |
Oops, something went wrong.