mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
feat: expense drawer.
This commit is contained in:
36
client/src/containers/Drawers/ExpenseDrawer/index.js
Normal file
36
client/src/containers/Drawers/ExpenseDrawer/index.js
Normal file
@@ -0,0 +1,36 @@
|
||||
import React, { lazy } from 'react';
|
||||
import { Drawer, DrawerSuspense } from 'components';
|
||||
import withDrawers from 'containers/Drawer/withDrawers';
|
||||
import withDrawerActions from 'containers/Drawer/withDrawerActions';
|
||||
|
||||
import { compose } from 'utils';
|
||||
|
||||
const ExpenseDrawerContent = lazy(() => import('./ExpenseDrawerContent'));
|
||||
|
||||
/**
|
||||
* Expense drawer.
|
||||
*/
|
||||
function ExpenseDrawer({
|
||||
name,
|
||||
|
||||
//#withDrawer
|
||||
isOpen,
|
||||
payload: { expenseId, title },
|
||||
|
||||
closeDrawer,
|
||||
}) {
|
||||
// Handle close drawer.
|
||||
const handleDrawerClose = () => {
|
||||
closeDrawer(name);
|
||||
};
|
||||
|
||||
return (
|
||||
<Drawer isOpen={isOpen} title={title} isClose={handleDrawerClose}>
|
||||
<DrawerSuspense>
|
||||
<ExpenseDrawerContent expenseId={expenseId} />
|
||||
</DrawerSuspense>
|
||||
</Drawer>
|
||||
);
|
||||
}
|
||||
|
||||
export default compose(withDrawers(), withDrawerActions)(ExpenseDrawer);
|
||||
Reference in New Issue
Block a user