Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Replace flexbox with grid (Sales/Orders Cards)

Lukasz Szewczyk0d366085cae9
diff --git a/saleor/static/dashboard-next/home/components/Dashbaord/Dashbaord.tsx b/saleor/static/dashboard-next/home/components/Dashbaord/Dashbaord.tsx
index ef94de5dfb..20db9470ca 100644
--- a/saleor/static/dashboard-next/home/components/Dashbaord/Dashbaord.tsx
+++ b/saleor/static/dashboard-next/home/components/Dashbaord/Dashbaord.tsx
@@ -42,21 +42,26 @@ export interface DashboardProps {
}
const decorate = withStyles(theme => ({
- displayBlock: {
- display: "block"
- },
- flexbox: {
- display: "flex"
+ cardContainer: {
+ display: "grid",
+ gridColumnGap: `${theme.spacing.unit * 3}px`,
+ gridTemplateColumns: "1fr 1fr",
+ [theme.breakpoints.down("md")]: {
+ gridColumnGap: `${theme.spacing.unit}px`
+ },
+ [theme.breakpoints.down("sm")]: {
+ gridTemplateColumns: "1fr"
+ }
},
root: {
display: "grid" as "grid",
gridColumnGap: `${theme.spacing.unit * 3}px`,
gridTemplateColumns: "2fr 1fr",
- [theme.breakpoints.down("sm")]: {
+ [theme.breakpoints.down("md")]: {
gridColumnGap: `${theme.spacing.unit}px`
},
- [theme.breakpoints.down("xs")]: {
+ [theme.breakpoints.down("sm")]: {
gridTemplateColumns: "1fr"
}
}
@@ -69,7 +74,7 @@ const Dashboard = decorate<DashboardProps>(
<CardSpacer />
<div className={classes.root}>
<div>
- <div className={classes.flexbox}>
+ <div className={classes.cardContainer}>
<HomeSalesCard disabled={false} title={"Sales"} daily={daily} />
<HomeOrdersCard disabled={false} title={"Orders"} daily={daily} />
</div>
diff --git a/saleor/static/dashboard-next/home/components/HomeOrdersCard/HomeOrdersCard.tsx b/saleor/static/dashboard-next/home/components/HomeOrdersCard/HomeOrdersCard.tsx
index 04c39ed8ff..85fd42006b 100644
--- a/saleor/static/dashboard-next/home/components/HomeOrdersCard/HomeOrdersCard.tsx
+++ b/saleor/static/dashboard-next/home/components/HomeOrdersCard/HomeOrdersCard.tsx
@@ -36,11 +36,6 @@ const decorate = withStyles(theme => ({
fontWeight: "bold" as "bold"
},
fullWidth: {
- marginLeft: `${theme.spacing.unit * 1.5}px`,
- [theme.breakpoints.down("sm")]: {
- marginLeft: `${theme.spacing.unit * 0.5}px`
- },
- overflow: "initial" as "initial",
width: "100%"
},
icon: {
diff --git a/saleor/static/dashboard-next/home/components/HomeSalesCard/HomeSalesCard.tsx b/saleor/static/dashboard-next/home/components/HomeSalesCard/HomeSalesCard.tsx
index 1226243e71..943e93a6e9 100644
--- a/saleor/static/dashboard-next/home/components/HomeSalesCard/HomeSalesCard.tsx
+++ b/saleor/static/dashboard-next/home/components/HomeSalesCard/HomeSalesCard.tsx
@@ -43,11 +43,6 @@ const decorate = withStyles(theme => ({
fontWeight: "bold" as "bold"
},
fullWidth: {
- marginRight: `${theme.spacing.unit * 1.5}px`,
- [theme.breakpoints.down("sm")]: {
- marginRight: `${theme.spacing.unit * 0.5}px`
- },
- overflow: "initial" as "initial",
width: "100%"
},
icon: {