mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
feat(branch & warehouse): fix EmptyStatus.
This commit is contained in:
@@ -2,7 +2,11 @@ import React from 'react';
|
||||
import intl from 'react-intl-universal';
|
||||
|
||||
import BranchesDataTable from './BranchesDataTable';
|
||||
import BranchesEmptyStatus from './BranchesEmptyStatus';
|
||||
import { Choose } from 'components';
|
||||
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||
import { useBranchesContext } from './BranchesProvider';
|
||||
|
||||
import { compose } from 'utils';
|
||||
|
||||
@@ -10,10 +14,21 @@ function Branches({
|
||||
// #withDashboardActions
|
||||
changePreferencesPageTitle,
|
||||
}) {
|
||||
const { isEmptyStatus } = useBranchesContext();
|
||||
|
||||
React.useEffect(() => {
|
||||
changePreferencesPageTitle(intl.get('branches.label'));
|
||||
}, [changePreferencesPageTitle]);
|
||||
|
||||
return <BranchesDataTable />;
|
||||
return (
|
||||
<Choose>
|
||||
<Choose.When condition={isEmptyStatus}>
|
||||
<BranchesEmptyStatus />
|
||||
</Choose.When>
|
||||
<Choose.Otherwise>
|
||||
<BranchesDataTable />
|
||||
</Choose.Otherwise>
|
||||
</Choose>
|
||||
);
|
||||
}
|
||||
export default compose(withDashboardActions)(Branches);
|
||||
|
||||
Reference in New Issue
Block a user