Adding support for optional frontend config.

Dropdown network selector is hidden by default, and enabled using config.
fixes #79
This commit is contained in:
softsimon
2020-06-22 22:10:49 +07:00
parent 7e9ba6b983
commit 0a264a7078
11 changed files with 86 additions and 12 deletions

View File

@@ -34,5 +34,21 @@ export const mempoolFeeColors = [
export const feeLevels = [1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 20, 30, 40, 50, 60, 70, 80, 90, 100, 125, 150, 175, 200,
250, 300, 350, 400, 500, 600, 700, 800, 900, 1000, 1200, 1400, 1600, 1800, 2000];
export const ELCTRS_ITEMS_PER_PAGE = 25;
export const KEEP_BLOCKS_AMOUNT = 8;
interface Env {
TESTNET_ENABLED: boolean;
LIQUID_ENABLED: boolean;
ELCTRS_ITEMS_PER_PAGE: number;
KEEP_BLOCKS_AMOUNT: number;
};
const defaultEnv: Env = {
'TESTNET_ENABLED': false,
'LIQUID_ENABLED': false,
'ELCTRS_ITEMS_PER_PAGE': 25,
'KEEP_BLOCKS_AMOUNT': 8
};
const browserWindow = window || {};
// @ts-ignore
const browserWindowEnv = browserWindow.__env || {};
export const env: Env = Object.assign(defaultEnv, browserWindowEnv);