feat(cashflow): add ExchangeRateMutedField.

This commit is contained in:
elforjani13
2022-03-06 20:20:25 +02:00
parent 5c52f80536
commit 7467b63e54
20 changed files with 382 additions and 58 deletions

View File

@@ -2,6 +2,8 @@ import React from 'react';
import { DialogContent } from 'components';
import {
useAccounts,
useAccount,
useBranches,
useCreateCashflowTransaction,
useCashflowAccounts,
useSettingCashFlow,
@@ -16,6 +18,17 @@ function MoneyOutProvider({ accountId, accountType, dialogName, ...props }) {
// Fetches accounts list.
const { isLoading: isAccountsLoading, data: accounts } = useAccounts();
// Fetches the specific account details.
const { data: account, isLoading: isAccountLoading } = useAccount(accountId, {
enabled: !!accountId,
});
// Fetches the branches list.
const {
data: branches,
isLoading: isBranchesLoading,
isSuccess: isBranchesSuccess,
} = useBranches();
// Fetch cash flow list .
const { data: cashflowAccounts, isLoading: isCashFlowAccountsLoading } =
useCashflowAccounts({}, { keepPreviousData: true });
@@ -32,9 +45,12 @@ function MoneyOutProvider({ accountId, accountType, dialogName, ...props }) {
// provider.
const provider = {
accounts,
account,
accountId,
accountType,
branches,
isAccountsLoading,
isBranchesSuccess,
cashflowAccounts,
@@ -48,7 +64,10 @@ function MoneyOutProvider({ accountId, accountType, dialogName, ...props }) {
return (
<DialogContent
isLoading={
isAccountsLoading || isCashFlowAccountsLoading || isSettingsLoading
isAccountsLoading ||
isCashFlowAccountsLoading ||
isBranchesLoading ||
isSettingsLoading
}
>
<MoneyInDialogContent.Provider value={provider} {...props} />