fix(account drawer): acconut drawer.

This commit is contained in:
elforjani3
2021-04-28 20:34:22 +02:00
parent efaa7e04c1
commit c11e3f97bd
4 changed files with 9 additions and 14 deletions

View File

@@ -1,6 +1,6 @@
import React from 'react';
import { useAccount, useAccountTransactions } from 'hooks/query';
import DashboardInsider from 'components/Dashboard/DashboardInsider';
import { DrawerHeaderContent, DashboardInsider } from 'components';
const AccountDrawerContext = React.createContext();
@@ -20,6 +20,7 @@ function AccountDrawerProvider({ accountId, ...props }) {
} = useAccountTransactions(accountId, {
enabled: !!accountId,
});
const name = `${account.name} ${account.code}`;
// provider.
const provider = {
@@ -30,6 +31,7 @@ function AccountDrawerProvider({ accountId, ...props }) {
return (
<DashboardInsider loading={isAccountLoading || isAccountsLoading}>
<DrawerHeaderContent name={'account-drawer'} title={name} />
<AccountDrawerContext.Provider value={provider} {...props} />
</DashboardInsider>
);