saleor-dashboard/src/components/TableCellAvatar/TableCellAvatar.tsx
Dawid 158188002a
Update React to 17 and related packages (#2370)
* Update React to 17

* Update types for React 17

* Update references in useEffect cleanup functions

* Update react-error-boundary

* Update react-inlinesvg

* Update Apollo Client and Upload Link

* Update apollo-upload-client types

* Fix comment about csstypes

* Downgrade apollo-client version due to log-in bug

* Add missing apollo link

* Update package-lock version

* Fix button type

* Fix datagrid test after react update

* Fix polish language letter bug
2022-10-24 11:49:11 +02:00

44 lines
983 B
TypeScript

import { TableCell } from "@material-ui/core";
import { TableCellProps } from "@material-ui/core/TableCell";
import { makeStyles } from "@saleor/macaw-ui";
import classNames from "classnames";
import React from "react";
import Avatar, { AvatarProps } from "./Avatar";
const useStyles = makeStyles(
theme => ({
root: {
"&:not(first-child)": {
paddingLeft: 0,
},
paddingRight: theme.spacing(3),
width: "1%",
},
}),
{ name: "TableCellAvatar" },
);
interface TableCellAvatarProps
extends TableCellProps,
Omit<AvatarProps, "children"> {
className?: string;
}
const TableCellAvatar: React.FC<TableCellAvatarProps> = props => {
const { className, ...rest } = props;
const classes = useStyles(props);
return (
<TableCell
className={classNames(classes.root, className)}
data-test-id="table-cell-avatar"
{...rest}
>
<Avatar {...rest} />
</TableCell>
);
};
export default TableCellAvatar;