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 }
|
||||
});
|
||||
|
||||
const { availableChannels, channel } = useAppChannel();
|
||||
const { availableChannels, channel } = useAppChannel(false);
|
||||
|
||||
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();
|
||||
|
||||
|
|
|
@ -137,8 +137,6 @@ const AppLayout: React.FC<AppLayoutProps> = ({ 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<AppLayoutProps> = ({ children }) => {
|
|||
.includes("mac")}
|
||||
onClick={() => setNavigatorVisibility(true)}
|
||||
/>
|
||||
{channel && isHomepage && (
|
||||
{channel && (
|
||||
<AppChannelSelect
|
||||
channels={availableChannels}
|
||||
disabled={!isPickerActive}
|
||||
|
|
|
@ -63,7 +63,7 @@ export const SaleList: React.FC<SaleListProps> = ({ params }) => {
|
|||
ListViews.SALES_LIST
|
||||
);
|
||||
const intl = useIntl();
|
||||
const { channel } = useAppChannel();
|
||||
const { channel } = useAppChannel(false);
|
||||
|
||||
const [openModal, closeModal] = createDialogActionHandlers<
|
||||
SaleListUrlDialog,
|
||||
|
|
|
@ -119,7 +119,7 @@ export const VoucherDetails: React.FC<VoucherDetailsProps> = ({
|
|||
VoucherUrlQueryParams
|
||||
>(navigate, params => voucherUrl(id, params), params);
|
||||
|
||||
const { channel, availableChannels } = useAppChannel();
|
||||
const { channel, availableChannels } = useAppChannel(false);
|
||||
|
||||
const allChannels: ChannelVoucherData[] = createChannelsDataWithDiscountPrice(
|
||||
data?.voucher,
|
||||
|
|
|
@ -64,7 +64,7 @@ export const VoucherList: React.FC<VoucherListProps> = ({ params }) => {
|
|||
);
|
||||
const intl = useIntl();
|
||||
|
||||
const { channel } = useAppChannel();
|
||||
const { channel } = useAppChannel(false);
|
||||
|
||||
const [openModal, closeModal] = createDialogActionHandlers<
|
||||
VoucherListUrlDialog,
|
||||
|
|
|
@ -80,7 +80,7 @@ export const OrderDraftList: React.FC<OrderDraftListProps> = ({ params }) => {
|
|||
onCompleted: handleCreateOrderCreateSuccess
|
||||
});
|
||||
|
||||
const { channel, availableChannels } = useAppChannel();
|
||||
const { channel, availableChannels } = useAppChannel(false);
|
||||
|
||||
const tabs = getFilterTabs();
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ export const OrderList: React.FC<OrderListProps> = ({ params }) => {
|
|||
onCompleted: handleCreateOrderCreateSuccess
|
||||
});
|
||||
|
||||
const { channel, availableChannels } = useAppChannel();
|
||||
const { channel, availableChannels } = useAppChannel(false);
|
||||
const limitOpts = useShopLimitsQuery({
|
||||
variables: {
|
||||
orders: true
|
||||
|
|
|
@ -154,7 +154,7 @@ export const ProductList: React.FC<ProductListProps> = ({ params }) => {
|
|||
},
|
||||
skip: params.action !== "export"
|
||||
});
|
||||
const { availableChannels, channel } = useAppChannel();
|
||||
const { availableChannels, channel } = useAppChannel(false);
|
||||
const limitOpts = useShopLimitsQuery({
|
||||
variables: {
|
||||
productVariants: true
|
||||
|
|
|
@ -170,7 +170,7 @@ export const ProductUpdate: React.FC<ProductUpdateProps> = ({ id, params }) => {
|
|||
productVariantCreateOpts
|
||||
] = useVariantCreateMutation({});
|
||||
|
||||
const { availableChannels, channel } = useAppChannel();
|
||||
const { availableChannels, channel } = useAppChannel(false);
|
||||
const { data, loading, refetch } = useProductDetails({
|
||||
displayLoader: true,
|
||||
variables: {
|
||||
|
|
|
@ -73,7 +73,7 @@ const ShippingZoneDetails: React.FC<ShippingZoneDetailsProps> = ({
|
|||
displayLoader: true,
|
||||
variables: { id, ...paginationState }
|
||||
});
|
||||
const { availableChannels, channel } = useAppChannel();
|
||||
const { availableChannels, channel } = useAppChannel(false);
|
||||
|
||||
const [openModal, closeModal] = createDialogActionHandlers<
|
||||
ShippingZoneUrlDialog,
|
||||
|
|
Loading…
Reference in a new issue