From 7a6a5d75952e8a555fa7f3fc84fdcd26946eea88 Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Tue, 15 May 2018 14:49:11 -0700 Subject: Modulate number of columns based on screenwidth --- packages/website/ts/components/portal/portal.tsx | 2 +- .../ts/components/relayer_index/relayer_index.tsx | 21 ++++++++++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/packages/website/ts/components/portal/portal.tsx b/packages/website/ts/components/portal/portal.tsx index d9d50c5ab..9b1fe69a3 100644 --- a/packages/website/ts/components/portal/portal.tsx +++ b/packages/website/ts/components/portal/portal.tsx @@ -383,7 +383,7 @@ export class Portal extends React.Component { return (
} - body={} + body={} /> ); } diff --git a/packages/website/ts/components/relayer_index/relayer_index.tsx b/packages/website/ts/components/relayer_index/relayer_index.tsx index b327c9817..9e028fc06 100644 --- a/packages/website/ts/components/relayer_index/relayer_index.tsx +++ b/packages/website/ts/components/relayer_index/relayer_index.tsx @@ -6,11 +6,12 @@ import { GridList } from 'material-ui/GridList'; import * as React from 'react'; import { RelayerGridTile } from 'ts/components/relayer_index/relayer_grid_tile'; -import { WebsiteBackendRelayerInfo } from 'ts/types'; +import { ScreenWidths, WebsiteBackendRelayerInfo } from 'ts/types'; import { backendClient } from 'ts/utils/backend_client'; export interface RelayerIndexProps { networkId: number; + screenWidth: ScreenWidths; } interface RelayerIndexState { @@ -35,7 +36,9 @@ const styles: Styles = { }; const CELL_HEIGHT = 290; -const NUMBER_OF_COLUMNS = 4; +const NUMBER_OF_COLUMNS_LARGE = 4; +const NUMBER_OF_COLUMNS_MEDIUM = 3; +const NUMBER_OF_COLUMNS_SMALL = 2; const GRID_PADDING = 20; export class RelayerIndex extends React.Component { @@ -69,11 +72,12 @@ export class RelayerIndex extends React.Component ); } else { + const numberOfColumns = this._numberOfColumnsForScreenWidth(this.props.screenWidth); return (
@@ -107,6 +111,17 @@ export class RelayerIndex extends React.Component