Skip to content

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

Remove MiuAvatar and add clearer classNames

Lukasz Szewczyk7c19f7cbd3fb
diff --git a/saleor/static/dashboard-next/components/TableCellAvatar/TableCellAvatar.tsx b/saleor/static/dashboard-next/components/TableCellAvatar/TableCellAvatar.tsx
index aade04c39a..ff7e9a0fec 100644
--- a/saleor/static/dashboard-next/components/TableCellAvatar/TableCellAvatar.tsx
+++ b/saleor/static/dashboard-next/components/TableCellAvatar/TableCellAvatar.tsx
@@ -10,10 +10,17 @@ import NoPhoto from "../../icons/NoPhoto";
interface TableCellAvatarProps {
className?: string;
thumbnail?: string;
- avatarSize?: string;
+ avatarProps?: string;
}
const decorate = withStyles(theme => ({
+ avatar: {
+ background: "none",
+ border: "1px solid #eaeaea",
+ borderRadius: 2,
+ color: "#bdbdbd",
+ padding: theme.spacing.unit / 2
+ },
root: {
paddingLeft: theme.spacing.unit * 3,
paddingRight: theme.spacing.unit * 3,
@@ -21,18 +28,21 @@ const decorate = withStyles(theme => ({
}
}));
const TableCellAvatar = decorate<TableCellAvatarProps>(
- ({ classes, className, thumbnail, avatarSize }) => (
+ ({ classes, className, thumbnail, avatarProps }) => (
<TableCell className={classNames(classes.root, className)}>
{thumbnail === undefined ? (
- <Avatar className={classNames(avatarSize)}>
+ <Avatar className={classNames(classes.avatar, avatarProps)}>
<Cached />
</Avatar>
) : thumbnail === null ? (
- <Avatar className={classNames(avatarSize)}>
+ <Avatar className={classNames(classes.avatar, avatarProps)}>
<NoPhoto />
</Avatar>
) : (
- <Avatar className={classNames(avatarSize)} src={thumbnail} />
+ <Avatar
+ className={classNames(classes.avatar, avatarProps)}
+ src={thumbnail}
+ />
)}
</TableCell>
)
diff --git a/saleor/static/dashboard-next/home/components/HomeProductListCard/HomeProductListCard.tsx b/saleor/static/dashboard-next/home/components/HomeProductListCard/HomeProductListCard.tsx
index 5a3e844888..c837f44aa7 100644
--- a/saleor/static/dashboard-next/home/components/HomeProductListCard/HomeProductListCard.tsx
+++ b/saleor/static/dashboard-next/home/components/HomeProductListCard/HomeProductListCard.tsx
@@ -33,7 +33,7 @@ interface HomeProductListProps {
}
const decorate = withStyles(theme => ({
- avatarSize: {
+ avatarProps: {
height: "64px",
width: "64px"
},
@@ -66,7 +66,7 @@ export const HomeProductList = decorate<HomeProductListProps>(
<TableCellAvatar
className={classes.avatarSpacing}
thumbnail={product && product.thumbnailUrl}
- avatarSize={classes.avatarSize}
+ avatarProps={classes.avatarProps}
/>
<TableCell>
diff --git a/saleor/static/dashboard-next/theme.ts b/saleor/static/dashboard-next/theme.ts
index ba1b76eef8..5c110abd93 100644
--- a/saleor/static/dashboard-next/theme.ts
+++ b/saleor/static/dashboard-next/theme.ts
@@ -1,5 +1,4 @@
import { createMuiTheme } from "@material-ui/core/styles";
-import spacing from "@material-ui/core/styles/spacing";
const createShadow = (pv, pb, ps, uv, ub, us, av, ab, as) =>
[
@@ -17,17 +16,6 @@ export const ICONBUTTON_SIZE = 48;
export default createMuiTheme({
overrides: {
- MuiAvatar: {
- colorDefault: {
- backgroundColor: "none",
- color: "#bdbdbd"
- },
- root: {
- border: "1px solid #eaeaea",
- borderRadius: 2,
- padding: spacing.unit / 2
- }
- },
MuiButton: {
label: {
fontWeight: 600