mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-22 07:40:32 +00:00
fix(ManualJournal): manual journal drawer.
This commit is contained in:
@@ -67,10 +67,9 @@ function ManualJournalsDataTable({
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Handle view detail journal.
|
// Handle view detail journal.
|
||||||
const handleViewDetailJournal = ({ id, journal_number }) => {
|
const handleViewDetailJournal = ({ id }) => {
|
||||||
openDrawer('journal-drawer', {
|
openDrawer('journal-drawer', {
|
||||||
manualJournalId: id,
|
manualJournalId: id,
|
||||||
title: `Manual Journal ${journal_number}`,
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useJournal } from 'hooks/query';
|
import { useJournal } from 'hooks/query';
|
||||||
import { DashboardInsider } from 'components';
|
import { DashboardInsider, DrawerHeaderContent } from 'components';
|
||||||
|
|
||||||
const ManualJournalDrawerContext = React.createContext();
|
const ManualJournalDrawerContext = React.createContext();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -22,6 +23,10 @@ function ManualJournalDrawerProvider({ manualJournalId, ...props }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<DashboardInsider loading={isJournalLoading}>
|
<DashboardInsider loading={isJournalLoading}>
|
||||||
|
<DrawerHeaderContent
|
||||||
|
name={'journal-drawer'}
|
||||||
|
title={`Manual Journal ${manualJournal?.journal_number}`}
|
||||||
|
/>
|
||||||
<ManualJournalDrawerContext.Provider value={provider} {...props} />
|
<ManualJournalDrawerContext.Provider value={provider} {...props} />
|
||||||
</DashboardInsider>
|
</DashboardInsider>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import React, { lazy } from 'react';
|
import React, { lazy } from 'react';
|
||||||
import { Drawer, DrawerSuspense } from 'components';
|
import { Drawer, DrawerSuspense } from 'components';
|
||||||
import withDrawers from 'containers/Drawer/withDrawers';
|
import withDrawers from 'containers/Drawer/withDrawers';
|
||||||
import withDrawerActions from 'containers/Drawer/withDrawerActions';
|
|
||||||
|
|
||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
|
|
||||||
@@ -17,16 +16,10 @@ function ManualJournalDrawer({
|
|||||||
|
|
||||||
//#withDrawer
|
//#withDrawer
|
||||||
isOpen,
|
isOpen,
|
||||||
payload: { manualJournalId, title },
|
payload: { manualJournalId },
|
||||||
|
|
||||||
closeDrawer,
|
|
||||||
}) {
|
}) {
|
||||||
// Handle close drawer.
|
|
||||||
const handleDrawerClose = () => {
|
|
||||||
closeDrawer(name);
|
|
||||||
};
|
|
||||||
return (
|
return (
|
||||||
<Drawer isOpen={isOpen} title={title} isClose={handleDrawerClose}>
|
<Drawer isOpen={isOpen} name={name}>
|
||||||
<DrawerSuspense>
|
<DrawerSuspense>
|
||||||
<ManualJournalDrawerContent manualJournalId={manualJournalId} />
|
<ManualJournalDrawerContent manualJournalId={manualJournalId} />
|
||||||
</DrawerSuspense>
|
</DrawerSuspense>
|
||||||
@@ -34,4 +27,4 @@ function ManualJournalDrawer({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default compose(withDrawers(), withDrawerActions)(ManualJournalDrawer);
|
export default compose(withDrawers())(ManualJournalDrawer);
|
||||||
|
|||||||
Reference in New Issue
Block a user