Merge pull request #143 from mirumee/fix/table-cell-padding

Fix table cell padding
This commit is contained in:
Marcin Gębala 2019-09-02 12:58:55 +02:00 committed by GitHub
commit c834dabc1b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 114 additions and 48 deletions

View file

@ -13,3 +13,4 @@ All notable, unreleased changes to this project will be documented in this file.
- Add dynamic dashboard settings - #135 by @benekex2 - Add dynamic dashboard settings - #135 by @benekex2
- Fix plugins page translations - #141 by @benekex2 - Fix plugins page translations - #141 by @benekex2
- Add attributes to column picker - #136 by @dominik-zeglen - Add attributes to column picker - #136 by @dominik-zeglen
- Fix table cell padding - #143 by @dominik-zeglen

View file

@ -46,7 +46,9 @@ const useStyles = makeStyles((theme: Theme) => ({
colSearchable: { colSearchable: {
textAlign: "center" textAlign: "center"
}, },
colSlug: {}, colSlug: {
paddingLeft: 0
},
colVisible: { colVisible: {
textAlign: "center" textAlign: "center"
}, },

View file

@ -28,7 +28,9 @@ const styles = (theme: Theme) =>
colAvailability: { colAvailability: {
width: 240 width: 240
}, },
colName: {}, colName: {
paddingLeft: 0
},
colProducts: { colProducts: {
width: 240 width: 240
} }

View file

@ -35,9 +35,10 @@ const styles = (theme: Theme) =>
"&:last-child": { "&:last-child": {
paddingRight: 0 paddingRight: 0
}, },
width: 48 + theme.spacing.unit / 2 width: 76 + theme.spacing.unit / 2
}, },
colName: { colName: {
paddingLeft: 0,
width: "auto" width: "auto"
}, },
colNameLabel: { colNameLabel: {

View file

@ -45,6 +45,7 @@ const styles = createStyles({
overflowY: "scroll" overflowY: "scroll"
}, },
wideCell: { wideCell: {
paddingLeft: 0,
width: "100%" width: "100%"
} }
}); });

View file

@ -59,7 +59,8 @@ const styles = (theme: Theme) =>
colName: { colName: {
"&$colNameFixed": { "&$colNameFixed": {
width: 250 width: 250
} },
paddingLeft: 0
}, },
colNameFixed: {}, colNameFixed: {},
colNameHeader: { colNameHeader: {

View file

@ -21,7 +21,7 @@ const styles = (theme: Theme) =>
width: "100%" width: "100%"
}, },
alignSelf: "flex-start", alignSelf: "flex-start",
marginRight: theme.spacing.unit * 5.5 marginRight: 28
}, },
cardActionsExpanded: { cardActionsExpanded: {
maxHeight: theme.spacing.unit * 6 maxHeight: theme.spacing.unit * 6
@ -41,7 +41,8 @@ const styles = (theme: Theme) =>
}, },
alignItems: "center", alignItems: "center",
background: theme.palette.background.default, background: theme.palette.background.default,
display: "flex" display: "flex",
paddingLeft: theme.spacing.unit * 3
}, },
root: { root: {
borderColor: theme.overrides.MuiCard.root.borderColor, borderColor: theme.overrides.MuiCard.root.borderColor,

View file

@ -31,7 +31,9 @@ const styles = (theme: Theme) =>
} }
}, },
colEmail: {}, colEmail: {},
colName: {}, colName: {
paddingLeft: 0
},
colOrders: { colOrders: {
textAlign: "center" textAlign: "center"
}, },

View file

@ -42,9 +42,10 @@ const styles = (theme: Theme) =>
"&:last-child": { "&:last-child": {
paddingRight: 0 paddingRight: 0
}, },
width: 48 + theme.spacing.unit / 2 width: 76 + theme.spacing.unit / 2
}, },
colName: { colName: {
paddingLeft: 0,
width: "auto" width: "auto"
}, },
colNameLabel: { colNameLabel: {

View file

@ -47,7 +47,9 @@ const styles = (theme: Theme) =>
colEnd: { colEnd: {
textAlign: "right" textAlign: "right"
}, },
colName: {}, colName: {
paddingLeft: 0
},
colStart: { colStart: {
textAlign: "right" textAlign: "right"
}, },

View file

@ -56,7 +56,9 @@ const styles = (theme: Theme) =>
colMinSpent: { colMinSpent: {
textAlign: "right" textAlign: "right"
}, },
colName: {}, colName: {
paddingLeft: 0
},
colStart: { colStart: {
textAlign: "right" textAlign: "right"
}, },

View file

@ -29,8 +29,12 @@ const styles = (theme: Theme) =>
}, },
avatarSpacing: { avatarSpacing: {
paddingBottom: theme.spacing.unit * 2, paddingBottom: theme.spacing.unit * 2,
paddingRight: theme.spacing.unit,
paddingTop: theme.spacing.unit * 2 paddingTop: theme.spacing.unit * 2
}, },
label: {
paddingLeft: 0
},
noProducts: { noProducts: {
paddingBottom: 20, paddingBottom: 20,
paddingTop: 20 paddingTop: 20
@ -81,7 +85,7 @@ export const HomeProductList = withStyles(styles, { name: "HomeProductList" })(
avatarProps={classes.avatarProps} avatarProps={classes.avatarProps}
/> />
<TableCell> <TableCell className={classes.label}>
{variant ? ( {variant ? (
<> <>
<Typography color={"primary"}> <Typography color={"primary"}>

16
src/icons/ArrowSort.tsx Normal file
View file

@ -0,0 +1,16 @@
import createSvgIcon from "@material-ui/icons/utils/createSvgIcon";
import React from "react";
export const ArrowSort = createSvgIcon(
<>
<rect width="24" height="24" fill="transparent" />
<path
fillRule="evenodd"
clipRule="evenodd"
d="M11.0328 17.1401V4H12.9672V17.1401L14.6322 15.4751L16 16.8429L12 20.8429L8 16.8429L9.36782 15.4751L11.0328 17.1401Z"
fill="currentColor"
/>
</>
);
ArrowSort.displayName = "ArrowSort";
export default ArrowSort;

View file

@ -39,7 +39,9 @@ const styles = (theme: Theme) =>
colItems: { colItems: {
textAlign: "right" textAlign: "right"
}, },
colTitle: {}, colTitle: {
paddingLeft: 0
},
row: { row: {
cursor: "pointer" cursor: "pointer"
} }
@ -88,6 +90,7 @@ const MenuList = withStyles(styles, { name: "MenuList" })(
id="menuListItems" id="menuListItems"
/> />
</TableCell> </TableCell>
<TableCell />
</TableHead> </TableHead>
<TableFooter> <TableFooter>
<TableRow> <TableRow>

View file

@ -36,7 +36,7 @@ const styles = (theme: Theme) =>
"&:last-child": { "&:last-child": {
paddingRight: 0 paddingRight: 0
}, },
width: 48 + theme.spacing.unit / 2 width: 76 + theme.spacing.unit / 2
}, },
colName: { colName: {
width: "auto" width: "auto"

View file

@ -43,7 +43,9 @@ const styles = (theme: Theme) =>
}, },
colCustomer: {}, colCustomer: {},
colDate: {}, colDate: {},
colNumber: {}, colNumber: {
paddingLeft: 0
},
colTotal: { colTotal: {
textAlign: "right" textAlign: "right"
}, },

View file

@ -39,6 +39,12 @@ const styles = (theme: Theme) =>
avatar: { avatar: {
paddingLeft: 0 paddingLeft: 0
}, },
colName: {
paddingLeft: 0
},
colVariantCheckbox: {
padding: 0
},
content: { content: {
overflowY: "scroll" overflowY: "scroll"
}, },
@ -259,7 +265,7 @@ const OrderProductAddDialog = withStyles(styles, {
className={classes.avatar} className={classes.avatar}
thumbnail={maybe(() => product.thumbnail.url)} thumbnail={maybe(() => product.thumbnail.url)}
/> />
<TableCell className={classes.wideCell} colSpan={2}> <TableCell className={classes.colName} colSpan={2}>
{maybe(() => product.name)} {maybe(() => product.name)}
</TableCell> </TableCell>
</TableRow> </TableRow>
@ -267,7 +273,7 @@ const OrderProductAddDialog = withStyles(styles, {
(variant, variantIndex) => ( (variant, variantIndex) => (
<TableRow key={variant.id}> <TableRow key={variant.id}>
<TableCell /> <TableCell />
<TableCell> <TableCell className={classes.colVariantCheckbox}>
<Checkbox <Checkbox
className={classes.variantCheckbox} className={classes.variantCheckbox}
checked={ checked={
@ -288,7 +294,7 @@ const OrderProductAddDialog = withStyles(styles, {
} }
/> />
</TableCell> </TableCell>
<TableCell> <TableCell className={classes.colName}>
<div>{variant.name}</div> <div>{variant.name}</div>
<div className={classes.grayText}> <div className={classes.grayText}>
<FormattedMessage <FormattedMessage

View file

@ -25,6 +25,7 @@ const styles = createStyles({
cursor: "pointer" cursor: "pointer"
}, },
colName: { colName: {
paddingLeft: 0,
width: "auto" width: "auto"
}, },
colNameLabel: { colNameLabel: {

View file

@ -38,7 +38,9 @@ const styles = (theme: Theme) =>
} }
}, },
colSlug: {}, colSlug: {},
colTitle: {}, colTitle: {
paddingLeft: 0
},
colVisibility: {}, colVisibility: {},
link: { link: {
cursor: "pointer" cursor: "pointer"

View file

@ -33,7 +33,9 @@ const styles = (theme: Theme) =>
width: 300 width: 300
} }
}, },
colName: {}, colName: {
paddingLeft: 0
},
colTax: {}, colTax: {},
colType: {}, colType: {},
link: { link: {

View file

@ -23,6 +23,10 @@ import { ProductVariantDetails_productVariant } from "../../types/ProductVariant
const styles = (theme: Theme) => const styles = (theme: Theme) =>
createStyles({ createStyles({
colName: {
paddingLeft: 0,
textAlign: [["left"], "!important"] as any
},
link: { link: {
cursor: "pointer" cursor: "pointer"
}, },
@ -37,9 +41,6 @@ const styles = (theme: Theme) =>
width: 2 width: 2
}, },
position: "relative" position: "relative"
},
textLeft: {
textAlign: [["left"], "!important"] as any
} }
}); });
@ -92,7 +93,7 @@ const ProductVariantNavigation = withStyles(styles, {
fallbackThumbnail fallbackThumbnail
)} )}
/> />
<TableCell className={classes.textLeft}> <TableCell className={classes.colName}>
{variant ? variant.name || variant.sku : <Skeleton />} {variant ? variant.name || variant.sku : <Skeleton />}
</TableCell> </TableCell>
</TableRow> </TableRow>
@ -114,7 +115,7 @@ const ProductVariantNavigation = withStyles(styles, {
className={classes.tabActive} className={classes.tabActive}
thumbnail={null} thumbnail={null}
/> />
<TableCell className={classes.textLeft}> <TableCell className={classes.colName}>
<FormattedMessage <FormattedMessage
defaultMessage="New Variant" defaultMessage="New Variant"
description="variant name" description="variant name"

View file

@ -45,7 +45,9 @@ const styles = (theme: Theme) =>
width: ICONBUTTON_SIZE + theme.spacing.unit / 2 width: ICONBUTTON_SIZE + theme.spacing.unit / 2
}, },
colCountries: {}, colCountries: {},
colName: {}, colName: {
paddingLeft: 0
},
row: { row: {
cursor: "pointer" cursor: "pointer"
} }

View file

@ -46674,7 +46674,7 @@ exports[`Storyshots Views / HomePage default 1`] = `
</div> </div>
</td> </td>
<td <td
class="MuiTableCell-root-id MuiTableCell-body-id" class="MuiTableCell-root-id MuiTableCell-body-id HomeProductList-label-id"
> >
<p <p
class="MuiTypography-root-id MuiTypography-body2-id MuiTypography-colorPrimary-id" class="MuiTypography-root-id MuiTypography-body2-id MuiTypography-colorPrimary-id"
@ -47401,7 +47401,7 @@ exports[`Storyshots Views / HomePage loading 1`] = `
</div> </div>
</td> </td>
<td <td
class="MuiTableCell-root-id MuiTableCell-body-id" class="MuiTableCell-root-id MuiTableCell-body-id HomeProductList-label-id"
> >
<span <span
class="Skeleton-skeleton-id" class="Skeleton-skeleton-id"
@ -49050,6 +49050,10 @@ exports[`Storyshots Views / Navigation / Menu list default 1`] = `
> >
Items Items
</th> </th>
<th
class="MuiTableCell-root-id MuiTableCell-head-id"
scope="col"
/>
</tr> </tr>
</thead> </thead>
<tfoot <tfoot
@ -49388,6 +49392,10 @@ exports[`Storyshots Views / Navigation / Menu list loading 1`] = `
> >
Items Items
</th> </th>
<th
class="MuiTableCell-root-id MuiTableCell-head-id"
scope="col"
/>
</tr> </tr>
</thead> </thead>
<tfoot <tfoot
@ -49661,6 +49669,10 @@ exports[`Storyshots Views / Navigation / Menu list no data 1`] = `
> >
Items Items
</th> </th>
<th
class="MuiTableCell-root-id MuiTableCell-head-id"
scope="col"
/>
</tr> </tr>
</thead> </thead>
<tfoot <tfoot
@ -82515,7 +82527,7 @@ exports[`Storyshots Views / Products / Create product variant add first variant
</div> </div>
</td> </td>
<td <td
class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-textLeft-id" class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-colName-id"
> >
New Variant New Variant
</td> </td>
@ -82942,7 +82954,7 @@ exports[`Storyshots Views / Products / Create product variant default 1`] = `
</div> </div>
</td> </td>
<td <td
class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-textLeft-id" class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-colName-id"
> >
Cordoba Oro Cordoba Oro
</td> </td>
@ -82970,7 +82982,7 @@ exports[`Storyshots Views / Products / Create product variant default 1`] = `
</div> </div>
</td> </td>
<td <td
class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-textLeft-id" class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-colName-id"
> >
silver silver
</td> </td>
@ -83024,7 +83036,7 @@ exports[`Storyshots Views / Products / Create product variant default 1`] = `
</div> </div>
</td> </td>
<td <td
class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-textLeft-id" class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-colName-id"
> >
New Variant New Variant
</td> </td>
@ -83462,7 +83474,7 @@ exports[`Storyshots Views / Products / Create product variant when loading data
</div> </div>
</td> </td>
<td <td
class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-textLeft-id" class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-colName-id"
> >
<span <span
class="Skeleton-skeleton-id" class="Skeleton-skeleton-id"
@ -83520,7 +83532,7 @@ exports[`Storyshots Views / Products / Create product variant when loading data
</div> </div>
</td> </td>
<td <td
class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-textLeft-id" class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-colName-id"
> >
New Variant New Variant
</td> </td>
@ -83890,7 +83902,7 @@ exports[`Storyshots Views / Products / Create product variant with errors 1`] =
</div> </div>
</td> </td>
<td <td
class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-textLeft-id" class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-colName-id"
> >
Cordoba Oro Cordoba Oro
</td> </td>
@ -83918,7 +83930,7 @@ exports[`Storyshots Views / Products / Create product variant with errors 1`] =
</div> </div>
</td> </td>
<td <td
class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-textLeft-id" class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-colName-id"
> >
silver silver
</td> </td>
@ -83972,7 +83984,7 @@ exports[`Storyshots Views / Products / Create product variant with errors 1`] =
</div> </div>
</td> </td>
<td <td
class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-textLeft-id" class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-colName-id"
> >
New Variant New Variant
</td> </td>
@ -95477,7 +95489,7 @@ exports[`Storyshots Views / Products / Product variant details attribute errors
</div> </div>
</td> </td>
<td <td
class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-textLeft-id" class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-colName-id"
> >
Extended Hard Extended Hard
</td> </td>
@ -95505,7 +95517,7 @@ exports[`Storyshots Views / Products / Product variant details attribute errors
</div> </div>
</td> </td>
<td <td
class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-textLeft-id" class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-colName-id"
> >
Extended Soft Extended Soft
</td> </td>
@ -95533,7 +95545,7 @@ exports[`Storyshots Views / Products / Product variant details attribute errors
</div> </div>
</td> </td>
<td <td
class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-textLeft-id" class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-colName-id"
> >
Normal Hard Normal Hard
</td> </td>
@ -95561,7 +95573,7 @@ exports[`Storyshots Views / Products / Product variant details attribute errors
</div> </div>
</td> </td>
<td <td
class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-textLeft-id" class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-colName-id"
> >
Normal Soft Normal Soft
</td> </td>
@ -96160,7 +96172,7 @@ exports[`Storyshots Views / Products / Product variant details when loaded data
</div> </div>
</td> </td>
<td <td
class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-textLeft-id" class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-colName-id"
> >
Extended Hard Extended Hard
</td> </td>
@ -96188,7 +96200,7 @@ exports[`Storyshots Views / Products / Product variant details when loaded data
</div> </div>
</td> </td>
<td <td
class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-textLeft-id" class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-colName-id"
> >
Extended Soft Extended Soft
</td> </td>
@ -96216,7 +96228,7 @@ exports[`Storyshots Views / Products / Product variant details when loaded data
</div> </div>
</td> </td>
<td <td
class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-textLeft-id" class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-colName-id"
> >
Normal Hard Normal Hard
</td> </td>
@ -96244,7 +96256,7 @@ exports[`Storyshots Views / Products / Product variant details when loaded data
</div> </div>
</td> </td>
<td <td
class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-textLeft-id" class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-colName-id"
> >
Normal Soft Normal Soft
</td> </td>
@ -96849,7 +96861,7 @@ exports[`Storyshots Views / Products / Product variant details when loading data
</div> </div>
</td> </td>
<td <td
class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-textLeft-id" class="MuiTableCell-root-id MuiTableCell-body-id ProductVariantNavigation-colName-id"
> >
<span <span
class="Skeleton-skeleton-id" class="Skeleton-skeleton-id"

View file

@ -270,8 +270,7 @@ export default (colors: IThemeColors): Theme =>
paddingTop: 8 paddingTop: 8
}, },
head: { head: {
fontSize: ".875rem", fontSize: ".875rem"
fontWeight: 400
}, },
paddingCheckbox: { paddingCheckbox: {
"&:first-child": { "&:first-child": {
@ -292,7 +291,7 @@ export default (colors: IThemeColors): Theme =>
}, },
borderBottomColor: colors.paperBorder, borderBottomColor: colors.paperBorder,
height: 56, height: 56,
padding: "4px 24px 4px 0" padding: "4px 24px"
} }
}, },
MuiTableRow: { MuiTableRow: {