Skip to content

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

Remove noop code

dominik-zeglenf123c338c2bb
diff --git a/saleor/static/dashboard-next/collections/components/CollectionDetails/CollectionDetails.tsx b/saleor/static/dashboard-next/collections/components/CollectionDetails/CollectionDetails.tsx
index ea54c9dfa1..dc37485fa7 100644
--- a/saleor/static/dashboard-next/collections/components/CollectionDetails/CollectionDetails.tsx
+++ b/saleor/static/dashboard-next/collections/components/CollectionDetails/CollectionDetails.tsx
@@ -52,7 +52,7 @@ const CollectionDetails = decorate<CollectionDetailsProps>(
<Typography
variant="caption"
className={classNames({
- [classes.link]: !!onImageRemove && !disabled
+ [classes.link]: !disabled
})}
onClick={disabled ? undefined : onImageRemove}
>
diff --git a/saleor/static/dashboard-next/collections/components/CollectionList/CollectionList.tsx b/saleor/static/dashboard-next/collections/components/CollectionList/CollectionList.tsx
index 3f4a2ccf93..9f6e925f1c 100644
--- a/saleor/static/dashboard-next/collections/components/CollectionList/CollectionList.tsx
+++ b/saleor/static/dashboard-next/collections/components/CollectionList/CollectionList.tsx
@@ -83,7 +83,7 @@ const CollectionList = decorate<CollectionListProps>(
: undefined
}
className={classNames({
- [classes.link]: !!collection
+ [classes.link]: collection
})}
>
{collection ? collection.name : <Skeleton />}
diff --git a/saleor/static/dashboard-next/collections/components/CollectionProducts/CollectionProducts.tsx b/saleor/static/dashboard-next/collections/components/CollectionProducts/CollectionProducts.tsx
index ad8d7a5fd7..b35296c9f1 100644
--- a/saleor/static/dashboard-next/collections/components/CollectionProducts/CollectionProducts.tsx
+++ b/saleor/static/dashboard-next/collections/components/CollectionProducts/CollectionProducts.tsx
@@ -7,7 +7,6 @@ import TableCell from "@material-ui/core/TableCell";
import TableFooter from "@material-ui/core/TableFooter";
import TableHead from "@material-ui/core/TableHead";
import TableRow from "@material-ui/core/TableRow";
-import * as classNames from "classnames";
import * as React from "react";
import CardTitle from "../../../components/CardTitle";
@@ -103,7 +102,7 @@ const CollectionProducts = decorate<CollectionProductsProps>(
onClick={
product && onProductClick && onProductClick(product.id)
}
- className={classNames({ [classes.link]: !!product })}
+ className={classes.link}
>
{product ? product.name : <Skeleton />}
</TableCell>
diff --git a/saleor/static/dashboard-next/components/ProductList/ProductList.tsx b/saleor/static/dashboard-next/components/ProductList/ProductList.tsx
index c91ab1c1e0..5468673ec7 100644
--- a/saleor/static/dashboard-next/components/ProductList/ProductList.tsx
+++ b/saleor/static/dashboard-next/components/ProductList/ProductList.tsx
@@ -5,7 +5,6 @@ import TableCell from "@material-ui/core/TableCell";
import TableFooter from "@material-ui/core/TableFooter";
import TableHead from "@material-ui/core/TableHead";
import TableRow from "@material-ui/core/TableRow";
-import * as classNames from "classnames";
import * as React from "react";
import { ListProps } from "../..";
@@ -95,7 +94,7 @@ export const ProductList = decorate<ProductListProps>(
hover={!!product}
key={product ? product.id : "skeleton"}
onClick={product && onRowClick(product.id)}
- className={classNames({ [classes.link]: !!product })}
+ className={classes.link}
>
<TableCellAvatar thumbnail={product && product.thumbnailUrl} />
<TableCell className={classes.textLeft}>
diff --git a/saleor/static/dashboard-next/customers/components/CustomerOrders/CustomerOrders.tsx b/saleor/static/dashboard-next/customers/components/CustomerOrders/CustomerOrders.tsx
index 02d47d825d..448ff12f1e 100644
--- a/saleor/static/dashboard-next/customers/components/CustomerOrders/CustomerOrders.tsx
+++ b/saleor/static/dashboard-next/customers/components/CustomerOrders/CustomerOrders.tsx
@@ -91,7 +91,7 @@ const CustomerOrders = decorate<CustomerOrdersProps>(
<TableRow key={order ? order.id : "skeleton"}>
<TableCell
onClick={order && onRowClick && onRowClick(order.id)}
- className={classNames({ [classes.link]: !!order })}
+ className={classes.link}
>
{order ? order.number : <Skeleton />}
</TableCell>
diff --git a/saleor/static/dashboard-next/orders/components/OrderList/OrderList.tsx b/saleor/static/dashboard-next/orders/components/OrderList/OrderList.tsx
index 1b102a0366..9e68c6730b 100644
--- a/saleor/static/dashboard-next/orders/components/OrderList/OrderList.tsx
+++ b/saleor/static/dashboard-next/orders/components/OrderList/OrderList.tsx
@@ -6,7 +6,6 @@ import TableCell from "@material-ui/core/TableCell";
import TableFooter from "@material-ui/core/TableFooter";
import TableHead from "@material-ui/core/TableHead";
import TableRow from "@material-ui/core/TableRow";
-import * as classNames from "classnames";
import * as React from "react";
import { ListProps } from "../../..";
@@ -103,7 +102,7 @@ export const OrderList = decorate<OrderListProps>(
<TableRow key={order ? order.id : "skeleton"}>
<TableCell
onClick={order && onRowClick && onRowClick(order.id)}
- className={classNames({ [classes.link]: !!order })}
+ className={classes.link}
>
{order ? order.number : <Skeleton />}
</TableCell>
diff --git a/saleor/static/dashboard-next/pages/components/PageList/PageList.tsx b/saleor/static/dashboard-next/pages/components/PageList/PageList.tsx
index 7f3a0091c7..27460655b6 100644
--- a/saleor/static/dashboard-next/pages/components/PageList/PageList.tsx
+++ b/saleor/static/dashboard-next/pages/components/PageList/PageList.tsx
@@ -6,7 +6,6 @@ import TableCell from "@material-ui/core/TableCell";
import TableFooter from "@material-ui/core/TableFooter";
import TableHead from "@material-ui/core/TableHead";
import TableRow from "@material-ui/core/TableRow";
-import * as classNames from "classnames";
import * as React from "react";
import { ListProps } from "../../..";
@@ -75,7 +74,7 @@ export const PageList = decorate<PageListProps>(
<TableRow key={page ? page.id : "skeleton"}>
<TableCell
onClick={page && onRowClick(page.id)}
- className={classNames({ [classes.link]: !!page })}
+ className={classes.link}
>
{page ? page.title : <Skeleton />}
</TableCell>
diff --git a/saleor/static/dashboard-next/productTypes/components/ProductTypeList/ProductTypeList.tsx b/saleor/static/dashboard-next/productTypes/components/ProductTypeList/ProductTypeList.tsx
index fe8e74d084..a728f2c2f9 100644
--- a/saleor/static/dashboard-next/productTypes/components/ProductTypeList/ProductTypeList.tsx
+++ b/saleor/static/dashboard-next/productTypes/components/ProductTypeList/ProductTypeList.tsx
@@ -6,7 +6,6 @@ import TableCell from "@material-ui/core/TableCell";
import TableFooter from "@material-ui/core/TableFooter";
import TableHead from "@material-ui/core/TableHead";
import TableRow from "@material-ui/core/TableRow";
-import * as classNames from "classnames";
import * as React from "react";
import { ListProps } from "../../..";
@@ -88,7 +87,7 @@ const ProductTypeList = decorate<ProductTypeListProps>(
onClick={
productType && onRowClick && onRowClick(productType.id)
}
- className={classNames({ [classes.link]: !!productType })}
+ className={classes.link}
>
{productType ? productType.name : <Skeleton />}
</TableCell>
diff --git a/saleor/static/dashboard-next/products/components/ProductVariantNavigation/ProductVariantNavigation.tsx b/saleor/static/dashboard-next/products/components/ProductVariantNavigation/ProductVariantNavigation.tsx
index bead2b4cbd..ac273e45ab 100644
--- a/saleor/static/dashboard-next/products/components/ProductVariantNavigation/ProductVariantNavigation.tsx
+++ b/saleor/static/dashboard-next/products/components/ProductVariantNavigation/ProductVariantNavigation.tsx
@@ -63,15 +63,13 @@ const ProductVariantNavigation = decorate<ProductVariantNavigationProps>(
<TableRow
hover={!!variant}
key={variant ? variant.id : "skeleton"}
- className={classNames({ [classes.link]: !!variant })}
+ className={classes.link}
onClick={variant ? () => onRowClick(variant.id) : undefined}
>
<TableCellAvatar
- className={
- variant && variant.id === current
- ? classes.tabActive
- : undefined
- }
+ className={classNames({
+ [classes.tabActive]: variant && variant.id === current
+ })}
thumbnail={
variant &&
variant.image &&