Fix linter errors and relayer index reloading

This commit is contained in:
Brandon Millman 2018-05-14 14:19:39 -07:00
parent ea948ac2c8
commit c787dc7356
3 changed files with 17 additions and 14 deletions

View File

@ -217,7 +217,7 @@ export class LegacyPortal extends React.Component<LegacyPortalProps, LegacyPorta
/> />
<Route <Route
path={`${WebsitePaths.Portal}/trades`} path={`${WebsitePaths.Portal}/trades`}
component={this._renderTradeHistory.bind(this)} render={this._renderTradeHistory.bind(this)}
/> />
<Route <Route
path={`${WebsitePaths.Home}`} path={`${WebsitePaths.Home}`}

View File

@ -210,7 +210,7 @@ export class Portal extends React.Component<PortalProps, PortalState> {
<Route <Route
exact={true} exact={true}
path={`${WebsitePaths.Portal}`} path={`${WebsitePaths.Portal}`}
component={this._renderWallet.bind(this)} render={this._renderWallet.bind(this)}
/> />
</Switch> </Switch>
</div> </div>
@ -227,13 +227,17 @@ export class Portal extends React.Component<PortalProps, PortalState> {
/> />
<Route <Route
path={`${WebsitePaths.Portal}/trades`} path={`${WebsitePaths.Portal}/trades`}
component={this._renderTradeHistory.bind(this)} render={this._renderTradeHistory.bind(this)}
/> />
<Route <Route
path={`${WebsitePaths.Portal}/direct`} path={`${WebsitePaths.Portal}/direct`}
component={this._renderTradeDirect.bind(this)} render={this._renderTradeDirect.bind(this)}
/>
<Route
exact={true}
path={`${WebsitePaths.Portal}/`}
render={this._renderRelayerIndex.bind(this)}
/> />
<Route path={`${WebsitePaths.Home}`} component={this._renderRelayerIndex.bind(this)} />
</Switch> </Switch>
</div> </div>
</div> </div>
@ -275,7 +279,7 @@ export class Portal extends React.Component<PortalProps, PortalState> {
</div> </div>
); );
} }
private _renderMenu(routeComponentProps: RouteComponentProps<any>) { private _renderMenu(routeComponentProps: RouteComponentProps<any>): React.ReactNode {
return ( return (
<div> <div>
<BackButton to={`${WebsitePaths.Portal}`} labelText={'back to Relayers'} /> <BackButton to={`${WebsitePaths.Portal}`} labelText={'back to Relayers'} />
@ -283,7 +287,7 @@ export class Portal extends React.Component<PortalProps, PortalState> {
</div> </div>
); );
} }
private _renderWallet() { private _renderWallet(): React.ReactNode {
const allTokens = _.values(this.props.tokenByAddress); const allTokens = _.values(this.props.tokenByAddress);
const trackedTokens = _.filter(allTokens, t => t.isTracked); const trackedTokens = _.filter(allTokens, t => t.isTracked);
return ( return (
@ -309,7 +313,7 @@ export class Portal extends React.Component<PortalProps, PortalState> {
</div> </div>
); );
} }
private _renderEthWrapper() { private _renderEthWrapper(): React.ReactNode {
return ( return (
<div> <div>
<Title labelText={'Wrapped ETH'} /> <Title labelText={'Wrapped ETH'} />
@ -325,7 +329,7 @@ export class Portal extends React.Component<PortalProps, PortalState> {
</div> </div>
); );
} }
private _renderTradeHistory() { private _renderTradeHistory(): React.ReactNode {
return ( return (
<div> <div>
<Title labelText={'Trade History'} /> <Title labelText={'Trade History'} />
@ -337,7 +341,7 @@ export class Portal extends React.Component<PortalProps, PortalState> {
</div> </div>
); );
} }
private _renderTradeDirect(match: any, location: Location, history: History) { private _renderTradeDirect(match: any, location: Location, history: History): React.ReactNode {
return ( return (
<div> <div>
<Title labelText={'Trade Direct'} /> <Title labelText={'Trade Direct'} />
@ -349,7 +353,7 @@ export class Portal extends React.Component<PortalProps, PortalState> {
</div> </div>
); );
} }
private _renderTokenBalances() { private _renderTokenBalances(): React.ReactNode {
const allTokens = _.values(this.props.tokenByAddress); const allTokens = _.values(this.props.tokenByAddress);
const trackedTokens = _.filter(allTokens, t => t.isTracked); const trackedTokens = _.filter(allTokens, t => t.isTracked);
return ( return (
@ -371,7 +375,7 @@ export class Portal extends React.Component<PortalProps, PortalState> {
</div> </div>
); );
} }
private _renderRelayerIndex() { private _renderRelayerIndex(): React.ReactNode {
return ( return (
<div> <div>
<Title labelText={'Explore 0x Relayers'} /> <Title labelText={'Explore 0x Relayers'} />

View File

@ -239,9 +239,8 @@ export class Wallet extends React.Component<WalletProps, WalletState> {
const userAddress = this.props.userAddress; const userAddress = this.props.userAddress;
const primaryText = utils.getAddressBeginAndEnd(userAddress); const primaryText = utils.getAddressBeginAndEnd(userAddress);
return ( return (
<Link to={`${WebsitePaths.Portal}/account`} style={{ textDecoration: 'none' }}> <Link key={HEADER_ITEM_KEY} to={`${WebsitePaths.Portal}/account`} style={{ textDecoration: 'none' }}>
<ListItem <ListItem
key={HEADER_ITEM_KEY}
primaryText={primaryText} primaryText={primaryText}
leftIcon={<Identicon address={userAddress} diameter={ICON_DIMENSION} />} leftIcon={<Identicon address={userAddress} diameter={ICON_DIMENSION} />}
style={{ ...styles.paddedItem, ...styles.borderedItem }} style={{ ...styles.paddedItem, ...styles.borderedItem }}