disable picker via context
This commit is contained in:
parent
509590e400
commit
9bc4c6bf1c
11 changed files with 11 additions and 13 deletions
|
@ -81,7 +81,7 @@ export const CategoryDetails: React.FC<CategoryDetailsProps> = ({
|
||||||
variables: { ...paginationState, id }
|
variables: { ...paginationState, id }
|
||||||
});
|
});
|
||||||
|
|
||||||
const { availableChannels, channel } = useAppChannel();
|
const { availableChannels, channel } = useAppChannel(false);
|
||||||
|
|
||||||
const channelChoices = mapNodeToChoice(availableChannels);
|
const channelChoices = mapNodeToChoice(availableChannels);
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,7 @@ export const CollectionList: React.FC<CollectionListProps> = ({ params }) => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const { availableChannels, channel } = useAppChannel();
|
const { availableChannels, channel } = useAppChannel(false);
|
||||||
|
|
||||||
const tabs = getFilterTabs();
|
const tabs = getFilterTabs();
|
||||||
|
|
||||||
|
|
|
@ -137,8 +137,6 @@ const AppLayout: React.FC<AppLayoutProps> = ({ children }) => {
|
||||||
setChannel
|
setChannel
|
||||||
} = useAppChannel(false);
|
} = useAppChannel(false);
|
||||||
|
|
||||||
const isHomepage = location.pathname === "/";
|
|
||||||
|
|
||||||
const menuStructure = createMenuStructure(intl);
|
const menuStructure = createMenuStructure(intl);
|
||||||
const configurationMenu = createConfigurationMenu(intl);
|
const configurationMenu = createConfigurationMenu(intl);
|
||||||
const userPermissions = user?.userPermissions || [];
|
const userPermissions = user?.userPermissions || [];
|
||||||
|
@ -218,7 +216,7 @@ const AppLayout: React.FC<AppLayoutProps> = ({ children }) => {
|
||||||
.includes("mac")}
|
.includes("mac")}
|
||||||
onClick={() => setNavigatorVisibility(true)}
|
onClick={() => setNavigatorVisibility(true)}
|
||||||
/>
|
/>
|
||||||
{channel && isHomepage && (
|
{channel && (
|
||||||
<AppChannelSelect
|
<AppChannelSelect
|
||||||
channels={availableChannels}
|
channels={availableChannels}
|
||||||
disabled={!isPickerActive}
|
disabled={!isPickerActive}
|
||||||
|
|
|
@ -63,7 +63,7 @@ export const SaleList: React.FC<SaleListProps> = ({ params }) => {
|
||||||
ListViews.SALES_LIST
|
ListViews.SALES_LIST
|
||||||
);
|
);
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const { channel } = useAppChannel();
|
const { channel } = useAppChannel(false);
|
||||||
|
|
||||||
const [openModal, closeModal] = createDialogActionHandlers<
|
const [openModal, closeModal] = createDialogActionHandlers<
|
||||||
SaleListUrlDialog,
|
SaleListUrlDialog,
|
||||||
|
|
|
@ -119,7 +119,7 @@ export const VoucherDetails: React.FC<VoucherDetailsProps> = ({
|
||||||
VoucherUrlQueryParams
|
VoucherUrlQueryParams
|
||||||
>(navigate, params => voucherUrl(id, params), params);
|
>(navigate, params => voucherUrl(id, params), params);
|
||||||
|
|
||||||
const { channel, availableChannels } = useAppChannel();
|
const { channel, availableChannels } = useAppChannel(false);
|
||||||
|
|
||||||
const allChannels: ChannelVoucherData[] = createChannelsDataWithDiscountPrice(
|
const allChannels: ChannelVoucherData[] = createChannelsDataWithDiscountPrice(
|
||||||
data?.voucher,
|
data?.voucher,
|
||||||
|
|
|
@ -64,7 +64,7 @@ export const VoucherList: React.FC<VoucherListProps> = ({ params }) => {
|
||||||
);
|
);
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
|
|
||||||
const { channel } = useAppChannel();
|
const { channel } = useAppChannel(false);
|
||||||
|
|
||||||
const [openModal, closeModal] = createDialogActionHandlers<
|
const [openModal, closeModal] = createDialogActionHandlers<
|
||||||
VoucherListUrlDialog,
|
VoucherListUrlDialog,
|
||||||
|
|
|
@ -80,7 +80,7 @@ export const OrderDraftList: React.FC<OrderDraftListProps> = ({ params }) => {
|
||||||
onCompleted: handleCreateOrderCreateSuccess
|
onCompleted: handleCreateOrderCreateSuccess
|
||||||
});
|
});
|
||||||
|
|
||||||
const { channel, availableChannels } = useAppChannel();
|
const { channel, availableChannels } = useAppChannel(false);
|
||||||
|
|
||||||
const tabs = getFilterTabs();
|
const tabs = getFilterTabs();
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ export const OrderList: React.FC<OrderListProps> = ({ params }) => {
|
||||||
onCompleted: handleCreateOrderCreateSuccess
|
onCompleted: handleCreateOrderCreateSuccess
|
||||||
});
|
});
|
||||||
|
|
||||||
const { channel, availableChannels } = useAppChannel();
|
const { channel, availableChannels } = useAppChannel(false);
|
||||||
const limitOpts = useShopLimitsQuery({
|
const limitOpts = useShopLimitsQuery({
|
||||||
variables: {
|
variables: {
|
||||||
orders: true
|
orders: true
|
||||||
|
|
|
@ -154,7 +154,7 @@ export const ProductList: React.FC<ProductListProps> = ({ params }) => {
|
||||||
},
|
},
|
||||||
skip: params.action !== "export"
|
skip: params.action !== "export"
|
||||||
});
|
});
|
||||||
const { availableChannels, channel } = useAppChannel();
|
const { availableChannels, channel } = useAppChannel(false);
|
||||||
const limitOpts = useShopLimitsQuery({
|
const limitOpts = useShopLimitsQuery({
|
||||||
variables: {
|
variables: {
|
||||||
productVariants: true
|
productVariants: true
|
||||||
|
|
|
@ -170,7 +170,7 @@ export const ProductUpdate: React.FC<ProductUpdateProps> = ({ id, params }) => {
|
||||||
productVariantCreateOpts
|
productVariantCreateOpts
|
||||||
] = useVariantCreateMutation({});
|
] = useVariantCreateMutation({});
|
||||||
|
|
||||||
const { availableChannels, channel } = useAppChannel();
|
const { availableChannels, channel } = useAppChannel(false);
|
||||||
const { data, loading, refetch } = useProductDetails({
|
const { data, loading, refetch } = useProductDetails({
|
||||||
displayLoader: true,
|
displayLoader: true,
|
||||||
variables: {
|
variables: {
|
||||||
|
|
|
@ -73,7 +73,7 @@ const ShippingZoneDetails: React.FC<ShippingZoneDetailsProps> = ({
|
||||||
displayLoader: true,
|
displayLoader: true,
|
||||||
variables: { id, ...paginationState }
|
variables: { id, ...paginationState }
|
||||||
});
|
});
|
||||||
const { availableChannels, channel } = useAppChannel();
|
const { availableChannels, channel } = useAppChannel(false);
|
||||||
|
|
||||||
const [openModal, closeModal] = createDialogActionHandlers<
|
const [openModal, closeModal] = createDialogActionHandlers<
|
||||||
ShippingZoneUrlDialog,
|
ShippingZoneUrlDialog,
|
||||||
|
|
Loading…
Reference in a new issue