Skip to content

Commit

Permalink
fix component remount in shipping zone settings
Browse files Browse the repository at this point in the history
  • Loading branch information
SektorDV committed Aug 23, 2021
1 parent 8ee2392 commit 3ebca42
Showing 1 changed file with 22 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,38 +51,28 @@ export const ShippingZoneSettingsCard: React.FC<ShippingZoneSettingsCardProps> =
return (
<Card>
<CardTitle title={intl.formatMessage(messages.title)} />
{loading && (
<CardContent>
<Skeleton />
</CardContent>
)}

{!loading && (
<>
<CardContent>
<ChannelsSection
channelsDisplayValues={channelsDisplayValues}
onChange={onChannelChange}
allChannels={allChannels}
selectedChannels={formData.channels}
/>
</CardContent>
<Divider />
<CardContent>
<WarehousesSection
onAdd={onWarehouseAdd}
onSearchChange={onWarehousesSearchChange}
onChange={onWarehouseChange}
onFetchMore={onFetchMoreWarehouses}
displayValues={warehousesDisplayValues}
choices={warehousesChoices}
selectedWarehouses={formData.warehouses}
hasMore={hasMoreWarehouses}
loading={false}
/>
</CardContent>
</>
)}
<CardContent>
<ChannelsSection
channelsDisplayValues={channelsDisplayValues}
onChange={onChannelChange}
allChannels={allChannels}
selectedChannels={formData.channels}
/>
</CardContent>
<Divider />
<CardContent>
<WarehousesSection
onAdd={onWarehouseAdd}
onSearchChange={onWarehousesSearchChange}
onChange={onWarehouseChange}
onFetchMore={onFetchMoreWarehouses}
displayValues={warehousesDisplayValues}
choices={warehousesChoices}
selectedWarehouses={formData.warehouses}
hasMore={hasMoreWarehouses}
loading={loading}
/>
</CardContent>
</Card>
);
};
Expand Down

0 comments on commit 3ebca42

Please sign in to comment.