diff --git a/src/attributes/components/AttributeValues/AttributeValues.tsx b/src/attributes/components/AttributeValues/AttributeValues.tsx index 57546189e..959c2d824 100644 --- a/src/attributes/components/AttributeValues/AttributeValues.tsx +++ b/src/attributes/components/AttributeValues/AttributeValues.tsx @@ -16,6 +16,7 @@ import { import TablePagination from "@saleor/components/TablePagination"; import { AttributeInputTypeEnum, + AttributeValueFragment, AttributeValueListFragment, } from "@saleor/graphql"; import { DeleteIcon, IconButton, makeStyles } from "@saleor/macaw-ui"; @@ -75,6 +76,15 @@ const useStyles = makeStyles( { name: "AttributeValues" }, ); +const getSwatchCellStyle = (value: AttributeValueFragment) => { + if (!value) { + return; + } + return value.file + ? { backgroundImage: `url(${value.file.url})` } + : { backgroundColor: value.value }; +}; + const AttributeValues: React.FC = ({ disabled, onValueAdd, @@ -179,11 +189,7 @@ const AttributeValues: React.FC = ({
)}