aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/utils
diff options
context:
space:
mode:
authorBrandon Millman <brandon@0xproject.com>2018-06-14 04:34:54 +0800
committerGitHub <noreply@github.com>2018-06-14 04:34:54 +0800
commit0e354e5ea1f9951088331a310999bf87c8f8f4b3 (patch)
tree91e67da2ff5c7bfd85f31714eb09e34292eb4c66 /packages/website/ts/utils
parent4efd28c092e74b438d0397069c0c55cc90c537f2 (diff)
parentd172a97247f133a5340c5df263fe0f23019db956 (diff)
downloaddexon-sol-tools-0e354e5ea1f9951088331a310999bf87c8f8f4b3.tar
dexon-sol-tools-0e354e5ea1f9951088331a310999bf87c8f8f4b3.tar.gz
dexon-sol-tools-0e354e5ea1f9951088331a310999bf87c8f8f4b3.tar.bz2
dexon-sol-tools-0e354e5ea1f9951088331a310999bf87c8f8f4b3.tar.lz
dexon-sol-tools-0e354e5ea1f9951088331a310999bf87c8f8f4b3.tar.xz
dexon-sol-tools-0e354e5ea1f9951088331a310999bf87c8f8f4b3.tar.zst
dexon-sol-tools-0e354e5ea1f9951088331a310999bf87c8f8f4b3.zip
Merge pull request #685 from 0xProject/feature/website/jobs-page
Jobs page
Diffstat (limited to 'packages/website/ts/utils')
-rw-r--r--packages/website/ts/utils/backend_client.ts13
-rw-r--r--packages/website/ts/utils/utils.ts3
2 files changed, 15 insertions, 1 deletions
diff --git a/packages/website/ts/utils/backend_client.ts b/packages/website/ts/utils/backend_client.ts
index 6b16aea6b..835a6ef4d 100644
--- a/packages/website/ts/utils/backend_client.ts
+++ b/packages/website/ts/utils/backend_client.ts
@@ -1,10 +1,17 @@
import * as _ from 'lodash';
-import { ArticlesBySection, WebsiteBackendGasInfo, WebsiteBackendPriceInfo, WebsiteBackendRelayerInfo } from 'ts/types';
+import {
+ ArticlesBySection,
+ WebsiteBackendGasInfo,
+ WebsiteBackendJobInfo,
+ WebsiteBackendPriceInfo,
+ WebsiteBackendRelayerInfo,
+} from 'ts/types';
import { fetchUtils } from 'ts/utils/fetch_utils';
import { utils } from 'ts/utils/utils';
const ETH_GAS_STATION_ENDPOINT = '/eth_gas_station';
+const JOBS_ENDPOINT = '/jobs';
const PRICES_ENDPOINT = '/prices';
const RELAYERS_ENDPOINT = '/relayers';
const WIKI_ENDPOINT = '/wiki';
@@ -15,6 +22,10 @@ export const backendClient = {
const result = await fetchUtils.requestAsync(utils.getBackendBaseUrl(), ETH_GAS_STATION_ENDPOINT);
return result;
},
+ async getJobInfosAsync(): Promise<WebsiteBackendJobInfo[]> {
+ const result = await fetchUtils.requestAsync(utils.getBackendBaseUrl(), JOBS_ENDPOINT);
+ return result;
+ },
async getPriceInfoAsync(tokenSymbols: string[]): Promise<WebsiteBackendPriceInfo> {
if (_.isEmpty(tokenSymbols)) {
return {};
diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts
index 651a4212a..eb384fbb4 100644
--- a/packages/website/ts/utils/utils.ts
+++ b/packages/website/ts/utils/utils.ts
@@ -318,6 +318,9 @@ export const utils = {
shouldShowPortalV2(): boolean {
return this.isDevelopment() || this.isStaging() || this.isDogfood();
},
+ shouldShowJobsPage(): boolean {
+ return this.isDevelopment() || this.isStaging() || this.isDogfood();
+ },
getEthToken(tokenByAddress: TokenByAddress): Token {
const tokens = _.values(tokenByAddress);
const etherToken = _.find(tokens, { symbol: constants.ETHER_TOKEN_SYMBOL });