Fixed max size for widgets (#624)

Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
This commit is contained in:
Alex
2021-03-04 18:09:22 -06:00
committed by GitHub
parent 07a23ab374
commit 716aabe782
2 changed files with 75 additions and 70 deletions

File diff suppressed because one or more lines are too long

View File

@@ -229,15 +229,20 @@ const PrDashboard = ({ classes, displayErrorMessage }: IPrDashboard) => {
<Grid item xs={12} className={classes.widgetsContainer}>
<AutoSizer style={autoSizerStyleProp}>
{({ width, height }: any) => {
const hpanel = height < minHeight ? minHeight : height;
let hpanel = height < minHeight ? minHeight : height;
if (hpanel > 380) {
hpanel = 480;
}
const totalWidth = width > 1920 ? 1920 : width;
return (
<ReactGridLayout
width={width}
width={totalWidth}
cols={colsInGrid}
containerPadding={[xSpacing, ySpacing]}
onLayoutChange={saveDashboardDistribution}
layout={dashboardDistr}
rowHeight={hpanel / 6}
style={{ margin: "0 auto", width: totalWidth }}
>
{panels(width)}
</ReactGridLayout>