From 20cb625343f4f46bcbea0f654f933f94de074ec1 Mon Sep 17 00:00:00 2001 From: Eug-VS Date: Tue, 7 Jan 2020 22:37:41 +0300 Subject: Use full-page SmartList on Scoreboard page --- src/components/Scoreboard/Scoreboard.js | 56 ++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/src/components/Scoreboard/Scoreboard.js b/src/components/Scoreboard/Scoreboard.js index c7bc6d8..a101a5b 100644 --- a/src/components/Scoreboard/Scoreboard.js +++ b/src/components/Scoreboard/Scoreboard.js @@ -1,23 +1,24 @@ import React, { useEffect, useState } from 'react'; -import { - Container, - Typography, - Grid, -} from "@material-ui/core"; - import { makeStyles } from "@material-ui/core/styles"; import { get } from "../../requests"; + +import SmartList from "../SmartList/SmartList"; import SolutionCard from "../SolutionCard/SolutionCard"; import Loading from "../Loading/Loading"; const useStyles = makeStyles(theme => ({ - pageHeader: { - textAlign: 'center', - margin: theme.spacing(2), - }, + cell: { + display: 'flex', + justifyContent: 'center', + padding: theme.spacing(4), + + '& .MuiCard-root': { + width: '30%', + } + } })); const Scoreboard = () => { @@ -40,21 +41,26 @@ const Scoreboard = () => { updateSolutions(); }, []); - return ( - - - Scoreboard - - {(solutions.length === 0) && } - - {solutions.slice(0, 30).map(solution => ( - - - - ))} - - - ); + const renderItem = ({ index, style }) => { + return ( +
+ +
+ ) + }; + + + return (solutions.length === 0) ? +
+ +
+ : + }; + export default Scoreboard; -- cgit v1.2.3