From e0482f5400261bcaced8ea2263b1032939d25b92 Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Mon, 14 May 2018 22:11:12 -0700 Subject: Wait for blockchain to display the account management routes --- packages/website/ts/components/portal/portal.tsx | 48 +++++++++++++++------- .../ts/components/relayer_index/relayer_index.tsx | 4 +- packages/website/ts/pages/fullscreen_message.tsx | 30 ++++++++++++++ packages/website/ts/pages/not_found.tsx | 43 ++++++------------- 4 files changed, 78 insertions(+), 47 deletions(-) create mode 100644 packages/website/ts/pages/fullscreen_message.tsx (limited to 'packages/website/ts') diff --git a/packages/website/ts/components/portal/portal.tsx b/packages/website/ts/components/portal/portal.tsx index f3b0cc721..bdaf9b18e 100644 --- a/packages/website/ts/components/portal/portal.tsx +++ b/packages/website/ts/components/portal/portal.tsx @@ -1,6 +1,7 @@ import { colors, Styles } from '@0xproject/react-shared'; import { BigNumber } from '@0xproject/utils'; import * as _ from 'lodash'; +import CircularProgress from 'material-ui/CircularProgress'; import * as React from 'react'; import * as DocumentTitle from 'react-document-title'; import { Link, Route, RouteComponentProps, Switch } from 'react-router-dom'; @@ -22,6 +23,7 @@ import { Wallet } from 'ts/components/wallet/wallet'; import { GenerateOrderForm } from 'ts/containers/generate_order_form'; import { localStorage } from 'ts/local_storage/local_storage'; import { trackedTokenStorage } from 'ts/local_storage/tracked_token_storage'; +import { FullscreenMessage } from 'ts/pages/fullscreen_message'; import { Dispatcher } from 'ts/redux/dispatcher'; import { BlockchainErrs, @@ -218,20 +220,8 @@ export class Portal extends React.Component {
- - - {
); } + private _renderAccountManagement(): React.ReactNode { + return this.props.blockchainIsLoaded ? ( + + + + + + + + ) : ( +
+
+
+ +
+
+
+ ); + } private _renderEthWrapper(): React.ReactNode { return (
@@ -383,6 +395,14 @@ export class Portal extends React.Component {
); } + private _renderNotFoundMessage(): React.ReactNode { + return ( + + ); + } private _onTokenChosen(tokenAddress: string): void { if (_.isEmpty(tokenAddress)) { this.setState({ diff --git a/packages/website/ts/components/relayer_index/relayer_index.tsx b/packages/website/ts/components/relayer_index/relayer_index.tsx index d4fd6aeaf..9eaf9fe03 100644 --- a/packages/website/ts/components/relayer_index/relayer_index.tsx +++ b/packages/website/ts/components/relayer_index/relayer_index.tsx @@ -59,10 +59,10 @@ export class RelayerIndex extends React.Component +
{_.isUndefined(this.state.error) ? ( diff --git a/packages/website/ts/pages/fullscreen_message.tsx b/packages/website/ts/pages/fullscreen_message.tsx new file mode 100644 index 000000000..141fb38a4 --- /dev/null +++ b/packages/website/ts/pages/fullscreen_message.tsx @@ -0,0 +1,30 @@ +import { Styles } from '@0xproject/react-shared'; +import * as React from 'react'; + +export interface FullscreenMessageProps { + headerText: string; + bodyText: string; +} + +const styles: Styles = { + thin: { + fontWeight: 100, + }, +}; + +export const FullscreenMessage = (props: FullscreenMessageProps) => { + return ( +
+
+
+
+

{props.headerText}

+
+
{props.bodyText}
+
+
+
+
+
+ ); +}; diff --git a/packages/website/ts/pages/not_found.tsx b/packages/website/ts/pages/not_found.tsx index 96c73d4ec..674271636 100644 --- a/packages/website/ts/pages/not_found.tsx +++ b/packages/website/ts/pages/not_found.tsx @@ -3,6 +3,7 @@ import * as _ from 'lodash'; import * as React from 'react'; import { Footer } from 'ts/components/footer'; import { TopBar } from 'ts/components/top_bar/top_bar'; +import { FullscreenMessage } from 'ts/pages/fullscreen_message'; import { Dispatcher } from 'ts/redux/dispatcher'; import { Translate } from 'ts/utils/translate'; @@ -12,35 +13,15 @@ export interface NotFoundProps { dispatcher: Dispatcher; } -interface NotFoundState {} - -const styles: Styles = { - thin: { - fontWeight: 100, - }, +export const NotFound = (props: NotFoundProps) => { + return ( +
+ + +
+
+ ); }; - -export class NotFound extends React.Component { - public render(): React.ReactNode { - return ( -
- -
-
-
-
-

404 Not Found

-
-
- Hm... looks like we couldn't find what you are looking for. -
-
-
-
-
-
-
- ); - } -} -- cgit v1.2.3