refactoring(*): paper drawer.

This commit is contained in:
elforjani3
2021-04-28 20:39:14 +02:00
parent 1fbfd7693f
commit 279dfb012c
8 changed files with 18 additions and 41 deletions

View File

@@ -1,7 +1,6 @@
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';
@@ -15,15 +14,9 @@ function EstimateDrawer({
//#withDrawer
isOpen,
payload: { estimateId },
closeDrawer,
}) {
// handle close Drawer
const handleDrawerClose = () => {
closeDrawer(name);
};
return (
<Drawer isOpen={isOpen} isClose={handleDrawerClose}>
<Drawer isOpen={isOpen} name={name}>
<DrawerSuspense>
<EstimateDrawerContent estimateId={estimateId} />
</DrawerSuspense>
@@ -31,4 +24,4 @@ function EstimateDrawer({
);
}
export default compose(withDrawers(), withDrawerActions)(EstimateDrawer);
export default compose(withDrawers())(EstimateDrawer);

View File

@@ -1,6 +1,6 @@
import React, { createContext } from 'react';
import { useEstimate } from 'hooks/query';
import DashboardInsider from 'components/Dashboard/DashboardInsider';
import { DrawerHeaderContent, DashboardInsider } from 'components';
const EstimateDrawerContext = createContext();
@@ -24,6 +24,7 @@ function EstimateDrawerProvider({ estimateId, ...props }) {
return (
<DashboardInsider loading={isEstimateLoading}>
<DrawerHeaderContent name={'estimate-drawer'} />
<EstimateDrawerContext.Provider value={provider} {...props} />
</DashboardInsider>
);