aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/utils
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-06-02 08:28:04 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-06-02 08:28:04 +0800
commit95086a75e6d08b930c196ccf6d0926c4e0f4cd48 (patch)
treede4159b6af049cdc7df34a30da55c1535754115f /packages/website/ts/utils
parent62e60e2ba6d07b9b892b4f2e92a5421c54f5fa20 (diff)
parent073a96cf63a8b2e5639d15133d09545f7bde1388 (diff)
downloaddexon-sol-tools-95086a75e6d08b930c196ccf6d0926c4e0f4cd48.tar
dexon-sol-tools-95086a75e6d08b930c196ccf6d0926c4e0f4cd48.tar.gz
dexon-sol-tools-95086a75e6d08b930c196ccf6d0926c4e0f4cd48.tar.bz2
dexon-sol-tools-95086a75e6d08b930c196ccf6d0926c4e0f4cd48.tar.lz
dexon-sol-tools-95086a75e6d08b930c196ccf6d0926c4e0f4cd48.tar.xz
dexon-sol-tools-95086a75e6d08b930c196ccf6d0926c4e0f4cd48.tar.zst
dexon-sol-tools-95086a75e6d08b930c196ccf6d0926c4e0f4cd48.zip
Merge branch 'feature/website/landing-subscribe-button' into feature/website/landing-subscribe-button-2
Diffstat (limited to 'packages/website/ts/utils')
-rw-r--r--packages/website/ts/utils/backend_client.ts8
-rw-r--r--packages/website/ts/utils/colors.ts19
-rw-r--r--packages/website/ts/utils/fetch_utils.ts12
-rw-r--r--packages/website/ts/utils/style.ts5
-rw-r--r--packages/website/ts/utils/utils.ts3
-rw-r--r--packages/website/ts/utils/wallet_item_styles.ts2
6 files changed, 23 insertions, 26 deletions
diff --git a/packages/website/ts/utils/backend_client.ts b/packages/website/ts/utils/backend_client.ts
index c440b1604..6b16aea6b 100644
--- a/packages/website/ts/utils/backend_client.ts
+++ b/packages/website/ts/utils/backend_client.ts
@@ -8,6 +8,7 @@ const ETH_GAS_STATION_ENDPOINT = '/eth_gas_station';
const PRICES_ENDPOINT = '/prices';
const RELAYERS_ENDPOINT = '/relayers';
const WIKI_ENDPOINT = '/wiki';
+const SUBSCRIBE_SUBSTACK_NEWSLETTER_ENDPOINT = '/newsletter_subscriber/substack';
export const backendClient = {
async getGasInfoAsync(): Promise<WebsiteBackendGasInfo> {
@@ -33,4 +34,11 @@ export const backendClient = {
const result = await fetchUtils.requestAsync(utils.getBackendBaseUrl(), WIKI_ENDPOINT);
return result;
},
+ async subscribeToNewsletterAsync(email: string): Promise<Response> {
+ const result = await fetchUtils.postAsync(utils.getBackendBaseUrl(), SUBSCRIBE_SUBSTACK_NEWSLETTER_ENDPOINT, {
+ email,
+ referrer: window.location.href,
+ });
+ return result;
+ },
};
diff --git a/packages/website/ts/utils/colors.ts b/packages/website/ts/utils/colors.ts
deleted file mode 100644
index 5ffdd6ba7..000000000
--- a/packages/website/ts/utils/colors.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { colors as sharedColors } from '@0xproject/react-shared';
-
-const appColors = {
- walletBoxShadow: 'rgba(56, 59, 137, 0.2)',
- walletBorder: '#ededee',
- walletDefaultItemBackground: '#fbfbfc',
- walletFocusedItemBackground: '#f0f1f4',
- allowanceToggleShadow: 'rgba(0, 0, 0, 0)',
- allowanceToggleOffTrack: '#adadad',
- allowanceToggleOnTrack: sharedColors.mediumBlue,
- wrapEtherConfirmationButton: sharedColors.mediumBlue,
- drawerMenuBackground: '#4a4a4a',
- menuItemDefaultSelectedBackground: '#424242',
-};
-
-export const colors = {
- ...sharedColors,
- ...appColors,
-};
diff --git a/packages/website/ts/utils/fetch_utils.ts b/packages/website/ts/utils/fetch_utils.ts
index d2e902db5..e65ac64e1 100644
--- a/packages/website/ts/utils/fetch_utils.ts
+++ b/packages/website/ts/utils/fetch_utils.ts
@@ -20,6 +20,18 @@ export const fetchUtils = {
const result = await response.json();
return result;
},
+
+ async postAsync(baseUrl: string, path: string, body: object): Promise<Response> {
+ const url = `${baseUrl}${path}`;
+ const response = await fetch(url, {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ body: JSON.stringify(body),
+ });
+ return response;
+ },
};
function queryStringFromQueryParams(queryParams?: object): string {
diff --git a/packages/website/ts/utils/style.ts b/packages/website/ts/utils/style.ts
deleted file mode 100644
index 0411cdd91..000000000
--- a/packages/website/ts/utils/style.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export const zIndex = {
- topBar: 1100,
- overlay: 1105,
- aboveOverlay: 1106,
-};
diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts
index b9d962b75..10381845b 100644
--- a/packages/website/ts/utils/utils.ts
+++ b/packages/website/ts/utils/utils.ts
@@ -306,7 +306,8 @@ export const utils = {
return parsedProviderName;
},
getBackendBaseUrl(): string {
- return isDogfood() ? configs.BACKEND_BASE_STAGING_URL : configs.BACKEND_BASE_PROD_URL;
+ return 'http://localhost:3000';
+ // return isDogfood() ? configs.BACKEND_BASE_STAGING_URL : configs.BACKEND_BASE_PROD_URL;
},
isDevelopment(): boolean {
return configs.ENVIRONMENT === Environments.DEVELOPMENT;
diff --git a/packages/website/ts/utils/wallet_item_styles.ts b/packages/website/ts/utils/wallet_item_styles.ts
index 6b038efd2..9d6033d74 100644
--- a/packages/website/ts/utils/wallet_item_styles.ts
+++ b/packages/website/ts/utils/wallet_item_styles.ts
@@ -1,6 +1,6 @@
import { Styles } from '@0xproject/react-shared';
-import { colors } from 'ts/utils/colors';
+import { colors } from 'ts/style/colors';
export const styles: Styles = {
focusedItem: {