I'm using React Grid layout to display a grid of widgets.
Here is my grid component :
class WidgetsGrid extends Component {
render() {
var layout = [
{ i: "a", x: 0, y: 0, w: 3, h: 3, minW: 2, maxW: 4 }
];
var layouts = { lg: layout };
return (
<ResponsiveReactGridLayout
className="layout"
layouts={layouts}
breakpoints={{ lg: 1200, md: 996, sm: 768, xs: 480, xxs: 0 }}
cols={{ lg: 12, md: 10, sm: 6, xs: 4, xxs: 2 }}
>
<div key="a">
<FirstWidget />
</div>
</ResponsiveReactGridLayout>
);
}
}
I display a child (FirstWidget) inside the grid :
class FirstWidget extends Component {
render() {
return (
<Card style={styles.main}>
<IconActivity style={styles.activity} color={green500} />
<CardHeader title="Premier Widget" subtitle="Sous-titre" />
<CardText>
<BarChart />
</CardText>
<div style={styles.footer}>
<h6 style={styles.timeText}>
<IconTime style={styles.iconText} />
<span>Actualisé il y a 5 minutes</span>
</h6>
</div>
</Card>
);
}
}
The issue is that the display is not made properly and the FirstWidget card doesn't fill the div parent (div key="a") as you can see on the image below :
So how I can resolve that ?
Thank you for your help.