mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 06:40:31 +00:00
feat: optimize style of account drawer.
This commit is contained in:
@@ -7,7 +7,7 @@ const AccountDrawerContext = React.createContext();
|
||||
/**
|
||||
* Account drawer provider.
|
||||
*/
|
||||
function AccountDrawerProvider({ accountId, ...props }) {
|
||||
function AccountDrawerProvider({ accountId, name, ...props }) {
|
||||
// Fetches the specific account details.
|
||||
const { data: account, isLoading: isAccountLoading } = useAccount(accountId, {
|
||||
enabled: !!accountId,
|
||||
@@ -20,18 +20,19 @@ function AccountDrawerProvider({ accountId, ...props }) {
|
||||
} = useAccountTransactions(accountId, {
|
||||
enabled: !!accountId,
|
||||
});
|
||||
const name = `${account.name} ${account.code}`;
|
||||
const drawerTitle = `${account.name} ${account.code}`;
|
||||
|
||||
// provider.
|
||||
const provider = {
|
||||
accountId,
|
||||
account,
|
||||
accounts,
|
||||
drawerName: name,
|
||||
};
|
||||
|
||||
return (
|
||||
<DashboardInsider loading={isAccountLoading || isAccountsLoading}>
|
||||
<DrawerHeaderContent name={'account-drawer'} title={name} />
|
||||
<DrawerHeaderContent name={'account-drawer'} title={drawerTitle} />
|
||||
<AccountDrawerContext.Provider value={provider} {...props} />
|
||||
</DashboardInsider>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user