Skip to content

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

Further refactoring

dominik-zeglen2bcb43b2d71f
diff --git a/saleor/static/dashboard-next/index.tsx b/saleor/static/dashboard-next/index.tsx
index a3bc741f2a..87a6b9eb15 100644
--- a/saleor/static/dashboard-next/index.tsx
+++ b/saleor/static/dashboard-next/index.tsx
@@ -88,15 +88,17 @@ export interface PartialMutationProviderOutput<
loading: boolean;
mutate: (variables: TVariables) => void;
}
-export interface PartialMutationProviderRenderProps<
+export type PartialMutationProviderRenderProps<
TData extends {} = {},
TVariables extends {} = {}
-> {
- data: TData;
- loading: boolean;
- error?: ApolloError;
- mutate: MutationFn<TData, TVariables>;
-}
+> = (
+ props: {
+ data: TData;
+ loading: boolean;
+ error?: ApolloError;
+ mutate: MutationFn<TData, TVariables>;
+ }
+) => React.ReactElement<any>;
export interface MutationProviderProps {
onError?: (error: ApolloError) => void;
diff --git a/saleor/static/dashboard-next/products/containers/ProductImagesReorder.tsx b/saleor/static/dashboard-next/products/containers/ProductImagesReorder.tsx
index 41cd0f9638..0ff70c8ae7 100644
--- a/saleor/static/dashboard-next/products/containers/ProductImagesReorder.tsx
+++ b/saleor/static/dashboard-next/products/containers/ProductImagesReorder.tsx
@@ -16,12 +16,10 @@ import { productDetailsQuery } from "../queries";
interface ProductImagesReorderProviderProps
extends PartialMutationProviderProps<ProductImageReorderMutation> {
productId: string;
- children: ((
- props: PartialMutationProviderRenderProps<
- ProductImageReorderMutation,
- ProductImageReorderMutationVariables
- >
- ) => React.ReactElement<any>);
+ children: PartialMutationProviderRenderProps<
+ ProductImageReorderMutation,
+ ProductImageReorderMutationVariables
+ >;
}
const ProductImagesReorderProvider: React.StatelessComponent<
diff --git a/saleor/static/dashboard-next/products/containers/ProductUpdate.tsx b/saleor/static/dashboard-next/products/containers/ProductUpdate.tsx
index ce9d2735b9..2c3e4fd01b 100644
--- a/saleor/static/dashboard-next/products/containers/ProductUpdate.tsx
+++ b/saleor/static/dashboard-next/products/containers/ProductUpdate.tsx
@@ -18,12 +18,10 @@ import { productDetailsQuery } from "../queries";
interface ProductUpdateProviderProps
extends PartialMutationProviderProps<ProductUpdateMutation> {
productId: string;
- children: ((
- props: PartialMutationProviderRenderProps<
- ProductUpdateMutation,
- ProductUpdateMutationVariables
- >
- ) => React.ReactElement<any>);
+ children: PartialMutationProviderRenderProps<
+ ProductUpdateMutation,
+ ProductUpdateMutationVariables
+ >;
}
const ProductUpdateProvider: React.StatelessComponent<