From 184232ba4fe304bb00a3dbbee21972b1ff29736b Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Tue, 15 May 2018 13:51:43 -0700 Subject: Add dogfood configs to website --- packages/website/ts/index.tsx | 2 +- packages/website/ts/utils/configs.ts | 6 +++++- packages/website/ts/utils/utils.ts | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) (limited to 'packages/website/ts') diff --git a/packages/website/ts/index.tsx b/packages/website/ts/index.tsx index 49bcdeaac..f255f81e7 100644 --- a/packages/website/ts/index.tsx +++ b/packages/website/ts/index.tsx @@ -35,7 +35,7 @@ import 'less/all.less'; // At the same time webpack statically parses for System.import() to determine bundle chunk split points // so each lazy import needs it's own `System.import()` declaration. const LazyPortal = - utils.isDevelopment() || utils.isStaging() + utils.isDevelopment() || utils.isStaging() || utils.isDogfood() ? createLazyComponent('Portal', async () => System.import(/* webpackChunkName: "portal" */ 'ts/containers/portal'), ) diff --git a/packages/website/ts/utils/configs.ts b/packages/website/ts/utils/configs.ts index a54fc56a8..bea9c4ee2 100644 --- a/packages/website/ts/utils/configs.ts +++ b/packages/website/ts/utils/configs.ts @@ -1,5 +1,6 @@ import * as _ from 'lodash'; import { Environments, OutdatedWrappedEtherByNetworkId, PublicNodeUrlsByNetworkId } from 'ts/types'; +import { utils } from 'ts/utils/utils'; const BASE_URL = window.location.origin; const isDevelopment = _.includes( @@ -10,13 +11,16 @@ const INFURA_API_KEY = 'T5WSC8cautR4KXyYgsRs'; export const configs = { AMOUNT_DISPLAY_PRECSION: 5, - BACKEND_BASE_URL: 'https://website-api.0xproject.com', + BACKEND_BASE_URL: utils.isDogfood() + ? 'http://ec2-52-91-181-85.compute-1.amazonaws.com' + : 'https://website-api.0xproject.com', BASE_URL, BITLY_ACCESS_TOKEN: 'ffc4c1a31e5143848fb7c523b39f91b9b213d208', DEFAULT_DERIVATION_PATH: `44'/60'/0'`, // WARNING: ZRX & WETH MUST always be default trackedTokens DEFAULT_TRACKED_TOKEN_SYMBOLS: ['WETH', 'ZRX'], DOMAIN_STAGING: 'staging-0xproject.s3-website-us-east-1.amazonaws.com', + DOMAIN_DOGFOOD: 'dogfood-0xproject.s3-website-us-east-1.amazonaws.com', DOMAIN_DEVELOPMENT: '0xproject.localhost:3572', DOMAIN_PRODUCTION: '0xproject.com', ENVIRONMENT: isDevelopment ? Environments.DEVELOPMENT : Environments.PRODUCTION, diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts index bf30f4e04..c3e261ddb 100644 --- a/packages/website/ts/utils/utils.ts +++ b/packages/website/ts/utils/utils.ts @@ -308,4 +308,7 @@ export const utils = { isStaging(): boolean { return _.includes(window.location.href, configs.DOMAIN_STAGING); }, + isDogfood(): boolean { + return _.includes(window.location.href, configs.DOMAIN_DOGFOOD); + }, }; -- cgit From 509a81a572937e1a7376d59c0ebb66fdb9e99960 Mon Sep 17 00:00:00 2001 From: fragosti Date: Tue, 15 May 2018 14:44:57 -0700 Subject: Add myself to about page --- packages/website/ts/pages/about/about.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'packages/website/ts') diff --git a/packages/website/ts/pages/about/about.tsx b/packages/website/ts/pages/about/about.tsx index 673022329..360cbb136 100644 --- a/packages/website/ts/pages/about/about.tsx +++ b/packages/website/ts/pages/about/about.tsx @@ -128,9 +128,6 @@ const teamRow4: ProfileInfo[] = [ github: '', medium: '', }, -]; - -const teamRow5: ProfileInfo[] = [ { name: 'Greg Hysen', title: 'Blockchain Engineer', @@ -140,6 +137,9 @@ const teamRow5: ProfileInfo[] = [ github: 'https://github.com/hysz', medium: '', }, +]; + +const teamRow5: ProfileInfo[] = [ { name: 'Remco Bloemen', title: 'Technical Fellow', @@ -149,6 +149,14 @@ const teamRow5: ProfileInfo[] = [ github: 'http://github.com/recmo', medium: '', }, + { + name: 'Francesco Agosti', + title: 'Senior Frontend Engineer', + description: `Full-stack engineer. Previously senior software engineer at Yelp. Computer science Duke.`, + image: 'images/team/fragosti.png', + linkedIn: 'https://www.linkedin.com/in/fragosti/', + github: 'http://github.com/fragosti', + }, ]; const advisors: ProfileInfo[] = [ -- cgit From 2ba78eb740d4eb04ecc1147f52dce236047f6816 Mon Sep 17 00:00:00 2001 From: fragosti Date: Tue, 15 May 2018 15:27:27 -0700 Subject: Fix circular dependency --- packages/website/ts/utils/backend_client.ts | 10 +++++----- packages/website/ts/utils/configs.ts | 5 ++--- packages/website/ts/utils/utils.ts | 9 ++++++--- 3 files changed, 13 insertions(+), 11 deletions(-) (limited to 'packages/website/ts') diff --git a/packages/website/ts/utils/backend_client.ts b/packages/website/ts/utils/backend_client.ts index 63e06fda7..cc238325a 100644 --- a/packages/website/ts/utils/backend_client.ts +++ b/packages/website/ts/utils/backend_client.ts @@ -1,7 +1,7 @@ import * as _ from 'lodash'; import { ArticlesBySection, WebsiteBackendGasInfo, WebsiteBackendPriceInfo, WebsiteBackendRelayerInfo } from 'ts/types'; -import { configs } from 'ts/utils/configs'; +import { utils } from 'ts/utils/utils'; import { fetchUtils } from 'ts/utils/fetch_utils'; const ETH_GAS_STATION_ENDPOINT = '/eth_gas_station'; @@ -11,7 +11,7 @@ const WIKI_ENDPOINT = '/wiki'; export const backendClient = { async getGasInfoAsync(): Promise { - const result = await fetchUtils.requestAsync(configs.BACKEND_BASE_URL, ETH_GAS_STATION_ENDPOINT); + const result = await fetchUtils.requestAsync(utils.getBackendBaseUrl(), ETH_GAS_STATION_ENDPOINT); return result; }, async getPriceInfoAsync(tokenSymbols: string[]): Promise { @@ -22,15 +22,15 @@ export const backendClient = { const queryParams = { tokens: joinedTokenSymbols, }; - const result = await fetchUtils.requestAsync(configs.BACKEND_BASE_URL, PRICES_ENDPOINT, queryParams); + const result = await fetchUtils.requestAsync(utils.getBackendBaseUrl(), PRICES_ENDPOINT, queryParams); return result; }, async getRelayerInfosAsync(): Promise { - const result = await fetchUtils.requestAsync(configs.BACKEND_BASE_URL, RELAYERS_ENDPOINT); + const result = await fetchUtils.requestAsync(utils.getBackendBaseUrl(), RELAYERS_ENDPOINT); return result; }, async getWikiArticlesBySectionAsync(): Promise { - const result = await fetchUtils.requestAsync(configs.BACKEND_BASE_URL, WIKI_ENDPOINT); + const result = await fetchUtils.requestAsync(utils.getBackendBaseUrl(), WIKI_ENDPOINT); return result; }, }; diff --git a/packages/website/ts/utils/configs.ts b/packages/website/ts/utils/configs.ts index bea9c4ee2..9fec814b7 100644 --- a/packages/website/ts/utils/configs.ts +++ b/packages/website/ts/utils/configs.ts @@ -11,9 +11,8 @@ const INFURA_API_KEY = 'T5WSC8cautR4KXyYgsRs'; export const configs = { AMOUNT_DISPLAY_PRECSION: 5, - BACKEND_BASE_URL: utils.isDogfood() - ? 'http://ec2-52-91-181-85.compute-1.amazonaws.com' - : 'https://website-api.0xproject.com', + BACKEND_BASE_PROD_URL: 'https://website-api.0xproject.com', + BACKEND_BASE_STAGING_URL: 'http://ec2-52-91-181-85.compute-1.amazonaws.com', BASE_URL, BITLY_ACCESS_TOKEN: 'ffc4c1a31e5143848fb7c523b39f91b9b213d208', DEFAULT_DERIVATION_PATH: `44'/60'/0'`, diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts index c3e261ddb..cb01fec24 100644 --- a/packages/website/ts/utils/utils.ts +++ b/packages/website/ts/utils/utils.ts @@ -24,6 +24,8 @@ import * as u2f from 'ts/vendor/u2f_api'; const LG_MIN_EM = 64; const MD_MIN_EM = 52; +const isDogfood = (): boolean => _.includes(window.location.href, configs.DOMAIN_DOGFOOD); + export const utils = { assert(condition: boolean, message: string): void { if (!condition) { @@ -302,13 +304,14 @@ export const utils = { } return parsedProviderName; }, + getBackendBaseUrl(): string { + return isDogfood() ? configs.BACKEND_BASE_STAGING_URL : configs.BACKEND_BASE_PROD_URL; + }, isDevelopment(): boolean { return configs.ENVIRONMENT === Environments.DEVELOPMENT; }, isStaging(): boolean { return _.includes(window.location.href, configs.DOMAIN_STAGING); }, - isDogfood(): boolean { - return _.includes(window.location.href, configs.DOMAIN_DOGFOOD); - }, + isDogfood, }; -- cgit From dc58d539c2ec0561974323aced0841d17117927d Mon Sep 17 00:00:00 2001 From: fragosti Date: Tue, 15 May 2018 15:54:17 -0700 Subject: fix style errors --- packages/website/ts/utils/backend_client.ts | 2 +- packages/website/ts/utils/utils.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/website/ts') diff --git a/packages/website/ts/utils/backend_client.ts b/packages/website/ts/utils/backend_client.ts index cc238325a..c440b1604 100644 --- a/packages/website/ts/utils/backend_client.ts +++ b/packages/website/ts/utils/backend_client.ts @@ -1,8 +1,8 @@ import * as _ from 'lodash'; import { ArticlesBySection, WebsiteBackendGasInfo, WebsiteBackendPriceInfo, WebsiteBackendRelayerInfo } from 'ts/types'; -import { utils } from 'ts/utils/utils'; import { fetchUtils } from 'ts/utils/fetch_utils'; +import { utils } from 'ts/utils/utils'; const ETH_GAS_STATION_ENDPOINT = '/eth_gas_station'; const PRICES_ENDPOINT = '/prices'; diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts index cb01fec24..3c99bd2fe 100644 --- a/packages/website/ts/utils/utils.ts +++ b/packages/website/ts/utils/utils.ts @@ -305,7 +305,7 @@ export const utils = { return parsedProviderName; }, getBackendBaseUrl(): string { - return isDogfood() ? configs.BACKEND_BASE_STAGING_URL : configs.BACKEND_BASE_PROD_URL; + return isDogfood() ? configs.BACKEND_BASE_STAGING_URL : configs.BACKEND_BASE_PROD_URL; }, isDevelopment(): boolean { return configs.ENVIRONMENT === Environments.DEVELOPMENT; -- cgit