feat: expense drawer.

This commit is contained in:
elforjani3
2021-04-27 16:16:31 +02:00
parent 571d9eb2fd
commit 61e0ad969f
10 changed files with 325 additions and 11 deletions

View 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);