disable picker via context

This commit is contained in:
sektordv 2021-06-14 19:20:19 +02:00
parent 509590e400
commit 9bc4c6bf1c
11 changed files with 11 additions and 13 deletions

View file

@ -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);

View file

@ -90,7 +90,7 @@ export const CollectionList: React.FC<CollectionListProps> = ({ params }) => {
}
});
const { availableChannels, channel } = useAppChannel();
const { availableChannels, channel } = useAppChannel(false);
const tabs = getFilterTabs();

View file

@ -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}

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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();

View file

@ -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

View file

@ -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

View file

@ -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: {

View file

@ -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,