mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
fix(invoice): Skeleton warehouses & branch loading & style action top bar.
This commit is contained in:
@@ -13,7 +13,7 @@ function BaseCurrency({
|
||||
organization: { base_currency },
|
||||
isForeignCustomer,
|
||||
}) {
|
||||
console.log(isForeignCustomer, 'XXXX');
|
||||
|
||||
if (isForeignCustomer) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { FastField } from 'formik';
|
||||
import { FastField, Field } from 'formik';
|
||||
import {
|
||||
Alignment,
|
||||
Navbar,
|
||||
@@ -18,7 +18,8 @@ import { useInvoiceFormContext } from './InvoiceFormProvider';
|
||||
import { Features } from 'common';
|
||||
|
||||
export default function InvoiceFormTopBar() {
|
||||
const { warehouses, branches } = useInvoiceFormContext();
|
||||
const { branches, warehouses, isWarehouesLoading, isBranchesLoading } =
|
||||
useInvoiceFormContext();
|
||||
|
||||
const { featureCan } = useFeatureCan();
|
||||
|
||||
@@ -30,42 +31,44 @@ export default function InvoiceFormTopBar() {
|
||||
<Navbar className={'navbar--dashboard-topbar'}>
|
||||
<NavbarGroup align={Alignment.LEFT}>
|
||||
<FeatureCan feature={Features.Warehouses}>
|
||||
<FastField name={'branch_id'}>
|
||||
<Field name={'branch_id'}>
|
||||
{({ form, field: { value }, meta: { error, touched } }) => (
|
||||
<CustomSelectList
|
||||
items={branches}
|
||||
text={'Branch'}
|
||||
loading={isBranchesLoading}
|
||||
defaultSelectText={'Branch'}
|
||||
onItemSelected={({ id }) => {
|
||||
form.setFieldValue('branch_id', id);
|
||||
}}
|
||||
selectedItemId={value}
|
||||
buttonProps={{
|
||||
icon: <Icon icon={'branch-16'} iconSize={20} />,
|
||||
icon: <Icon icon={'branch-16'} iconSize={16} />,
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</FastField>
|
||||
</Field>
|
||||
</FeatureCan>
|
||||
|
||||
{featureCan(Features.Warehouses) && featureCan(Features.Branches) && (
|
||||
<NavbarDivider />
|
||||
)}
|
||||
<FeatureCan feature={Features.Warehouses}>
|
||||
<FastField name={'warehouse_id'}>
|
||||
<Field name={'warehouse_id'}>
|
||||
{({ form, field: { value }, meta: { error, touched } }) => (
|
||||
<CustomSelectList
|
||||
items={warehouses}
|
||||
text={'Warehosue'}
|
||||
loading={isWarehouesLoading}
|
||||
defaultSelectText={'Warehosue'}
|
||||
onItemSelected={({ id }) => {
|
||||
form.setFieldValue('warehouse_id', id);
|
||||
}}
|
||||
selectedItemId={value}
|
||||
buttonProps={{
|
||||
icon: <Icon icon={'warehouse-16'} iconSize={20} />,
|
||||
icon: <Icon icon={'warehouse-16'} iconSize={16} />,
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</FastField>
|
||||
</Field>
|
||||
</FeatureCan>
|
||||
</NavbarGroup>
|
||||
</Navbar>
|
||||
|
||||
Reference in New Issue
Block a user