From 9bc4c6bf1c4b4b3177af0eee736f04d560933884 Mon Sep 17 00:00:00 2001 From: sektordv Date: Mon, 14 Jun 2021 19:20:19 +0200 Subject: [PATCH] disable picker via context --- src/categories/views/CategoryDetails.tsx | 2 +- src/collections/views/CollectionList/CollectionList.tsx | 2 +- src/components/AppLayout/AppLayout.tsx | 4 +--- src/discounts/views/SaleList/SaleList.tsx | 2 +- src/discounts/views/VoucherDetails/VoucherDetails.tsx | 2 +- src/discounts/views/VoucherList/VoucherList.tsx | 2 +- src/orders/views/OrderDraftList/OrderDraftList.tsx | 2 +- src/orders/views/OrderList/OrderList.tsx | 2 +- src/products/views/ProductList/ProductList.tsx | 2 +- src/products/views/ProductUpdate/ProductUpdate.tsx | 2 +- src/shipping/views/ShippingZoneDetails/index.tsx | 2 +- 11 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/categories/views/CategoryDetails.tsx b/src/categories/views/CategoryDetails.tsx index b413a056e..834d05b03 100644 --- a/src/categories/views/CategoryDetails.tsx +++ b/src/categories/views/CategoryDetails.tsx @@ -81,7 +81,7 @@ export const CategoryDetails: React.FC = ({ variables: { ...paginationState, id } }); - const { availableChannels, channel } = useAppChannel(); + const { availableChannels, channel } = useAppChannel(false); const channelChoices = mapNodeToChoice(availableChannels); diff --git a/src/collections/views/CollectionList/CollectionList.tsx b/src/collections/views/CollectionList/CollectionList.tsx index baead7734..ed8f86a70 100644 --- a/src/collections/views/CollectionList/CollectionList.tsx +++ b/src/collections/views/CollectionList/CollectionList.tsx @@ -90,7 +90,7 @@ export const CollectionList: React.FC = ({ params }) => { } }); - const { availableChannels, channel } = useAppChannel(); + const { availableChannels, channel } = useAppChannel(false); const tabs = getFilterTabs(); diff --git a/src/components/AppLayout/AppLayout.tsx b/src/components/AppLayout/AppLayout.tsx index 0b7a162d7..7a9717637 100644 --- a/src/components/AppLayout/AppLayout.tsx +++ b/src/components/AppLayout/AppLayout.tsx @@ -137,8 +137,6 @@ const AppLayout: React.FC = ({ children }) => { setChannel } = useAppChannel(false); - const isHomepage = location.pathname === "/"; - const menuStructure = createMenuStructure(intl); const configurationMenu = createConfigurationMenu(intl); const userPermissions = user?.userPermissions || []; @@ -218,7 +216,7 @@ const AppLayout: React.FC = ({ children }) => { .includes("mac")} onClick={() => setNavigatorVisibility(true)} /> - {channel && isHomepage && ( + {channel && ( = ({ params }) => { ListViews.SALES_LIST ); const intl = useIntl(); - const { channel } = useAppChannel(); + const { channel } = useAppChannel(false); const [openModal, closeModal] = createDialogActionHandlers< SaleListUrlDialog, diff --git a/src/discounts/views/VoucherDetails/VoucherDetails.tsx b/src/discounts/views/VoucherDetails/VoucherDetails.tsx index 9db06115c..32c58f750 100644 --- a/src/discounts/views/VoucherDetails/VoucherDetails.tsx +++ b/src/discounts/views/VoucherDetails/VoucherDetails.tsx @@ -119,7 +119,7 @@ export const VoucherDetails: React.FC = ({ VoucherUrlQueryParams >(navigate, params => voucherUrl(id, params), params); - const { channel, availableChannels } = useAppChannel(); + const { channel, availableChannels } = useAppChannel(false); const allChannels: ChannelVoucherData[] = createChannelsDataWithDiscountPrice( data?.voucher, diff --git a/src/discounts/views/VoucherList/VoucherList.tsx b/src/discounts/views/VoucherList/VoucherList.tsx index 1992b6e3d..dc4a40f46 100644 --- a/src/discounts/views/VoucherList/VoucherList.tsx +++ b/src/discounts/views/VoucherList/VoucherList.tsx @@ -64,7 +64,7 @@ export const VoucherList: React.FC = ({ params }) => { ); const intl = useIntl(); - const { channel } = useAppChannel(); + const { channel } = useAppChannel(false); const [openModal, closeModal] = createDialogActionHandlers< VoucherListUrlDialog, diff --git a/src/orders/views/OrderDraftList/OrderDraftList.tsx b/src/orders/views/OrderDraftList/OrderDraftList.tsx index f6cec36be..c3808be55 100644 --- a/src/orders/views/OrderDraftList/OrderDraftList.tsx +++ b/src/orders/views/OrderDraftList/OrderDraftList.tsx @@ -80,7 +80,7 @@ export const OrderDraftList: React.FC = ({ params }) => { onCompleted: handleCreateOrderCreateSuccess }); - const { channel, availableChannels } = useAppChannel(); + const { channel, availableChannels } = useAppChannel(false); const tabs = getFilterTabs(); diff --git a/src/orders/views/OrderList/OrderList.tsx b/src/orders/views/OrderList/OrderList.tsx index e6a306b58..f2d24e907 100644 --- a/src/orders/views/OrderList/OrderList.tsx +++ b/src/orders/views/OrderList/OrderList.tsx @@ -71,7 +71,7 @@ export const OrderList: React.FC = ({ params }) => { onCompleted: handleCreateOrderCreateSuccess }); - const { channel, availableChannels } = useAppChannel(); + const { channel, availableChannels } = useAppChannel(false); const limitOpts = useShopLimitsQuery({ variables: { orders: true diff --git a/src/products/views/ProductList/ProductList.tsx b/src/products/views/ProductList/ProductList.tsx index 6c5a378af..490bcd7a6 100644 --- a/src/products/views/ProductList/ProductList.tsx +++ b/src/products/views/ProductList/ProductList.tsx @@ -154,7 +154,7 @@ export const ProductList: React.FC = ({ params }) => { }, skip: params.action !== "export" }); - const { availableChannels, channel } = useAppChannel(); + const { availableChannels, channel } = useAppChannel(false); const limitOpts = useShopLimitsQuery({ variables: { productVariants: true diff --git a/src/products/views/ProductUpdate/ProductUpdate.tsx b/src/products/views/ProductUpdate/ProductUpdate.tsx index d7118c011..04ed46c5e 100644 --- a/src/products/views/ProductUpdate/ProductUpdate.tsx +++ b/src/products/views/ProductUpdate/ProductUpdate.tsx @@ -170,7 +170,7 @@ export const ProductUpdate: React.FC = ({ id, params }) => { productVariantCreateOpts ] = useVariantCreateMutation({}); - const { availableChannels, channel } = useAppChannel(); + const { availableChannels, channel } = useAppChannel(false); const { data, loading, refetch } = useProductDetails({ displayLoader: true, variables: { diff --git a/src/shipping/views/ShippingZoneDetails/index.tsx b/src/shipping/views/ShippingZoneDetails/index.tsx index 9dc2c09fc..de33e1be3 100644 --- a/src/shipping/views/ShippingZoneDetails/index.tsx +++ b/src/shipping/views/ShippingZoneDetails/index.tsx @@ -73,7 +73,7 @@ const ShippingZoneDetails: React.FC = ({ displayLoader: true, variables: { id, ...paginationState } }); - const { availableChannels, channel } = useAppChannel(); + const { availableChannels, channel } = useAppChannel(false); const [openModal, closeModal] = createDialogActionHandlers< ShippingZoneUrlDialog,