diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-09-26 03:08:32 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-09-26 03:08:32 +0800 |
commit | d20f713fade2d23e847dfb349938730ca95cbf15 (patch) | |
tree | 76f2192d18eb1d26e719cce68f380d30f331543f | |
parent | b40861747b73bb9a0826853751b7caa5cbf085ae (diff) | |
download | dexon-sol-tools-d20f713fade2d23e847dfb349938730ca95cbf15.tar.gz dexon-sol-tools-d20f713fade2d23e847dfb349938730ca95cbf15.tar.zst dexon-sol-tools-d20f713fade2d23e847dfb349938730ca95cbf15.zip |
When number of relayers is less than number of columns, reduce column number to number of relayers
-rw-r--r-- | packages/website/ts/components/relayer_index/relayer_index.tsx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/website/ts/components/relayer_index/relayer_index.tsx b/packages/website/ts/components/relayer_index/relayer_index.tsx index 4aea1bbbb..91dbeb27a 100644 --- a/packages/website/ts/components/relayer_index/relayer_index.tsx +++ b/packages/website/ts/components/relayer_index/relayer_index.tsx @@ -56,7 +56,11 @@ export class RelayerIndex extends React.Component<RelayerIndexProps, RelayerInde </div> ); } else { - const numberOfColumns = this._numberOfColumnsForScreenWidth(this.props.screenWidth); + const numberOfRelayers = this.state.relayerInfos.length; + const numberOfColumns = Math.min( + numberOfRelayers, + this._numberOfColumnsForScreenWidth(this.props.screenWidth), + ); return ( <GridList cellHeight={CELL_HEIGHT} |