From 7467b63e5476fd44ff3cf23fc9f3c7f81ac5f038 Mon Sep 17 00:00:00 2001 From: elforjani13 <39470382+elforjani13@users.noreply.github.com> Date: Sun, 6 Mar 2022 20:20:25 +0200 Subject: [PATCH] feat(cashflow): add ExchangeRateMutedField. --- src/components/Branches/BranchSelect.js | 2 +- .../ExchangeRate/ExchangeRateMutedField.js | 84 +++++++++++++++++++ src/components/ExchangeRate/index.js | 3 +- src/components/Warehouses/WarehouseSelect.js | 2 +- .../MoneyInDialog/MoneyInDialogProvider.js | 6 -- .../MoneyInDialog/MoneyInFloatingActions.js | 4 +- .../Dialogs/MoneyInDialog/MoneyInForm.js | 2 +- .../MoneyInDialog/MoneyInForm.schema.js | 2 + .../OtherIncome/OtherIncomeFormFields.js | 48 ++++++++++- .../OwnerContributionFormFields.js | 41 ++++----- .../TransferFromAccountFormFields.js | 47 ++++++++++- src/containers/Dialogs/MoneyInDialog/utils.js | 7 ++ .../MoneyOutDialog/MoneyOutDialogProvider.js | 21 ++++- .../MoneyOutDialog/MoneyOutFloatingActions.js | 4 +- .../Dialogs/MoneyOutDialog/MoneyOutForm.js | 1 + .../MoneyOutDialog/MoneyOutForm.schema.js | 4 +- .../OtherExpense/OtherExpnseFormFields.js | 47 ++++++++++- .../OwnerDrawings/OwnerDrawingsFormFields.js | 45 +++++++++- .../TransferToAccountFormFields.js | 46 +++++++++- .../Dialogs/MoneyOutDialog/utils.js | 24 ++++++ 20 files changed, 382 insertions(+), 58 deletions(-) create mode 100644 src/components/ExchangeRate/ExchangeRateMutedField.js diff --git a/src/components/Branches/BranchSelect.js b/src/components/Branches/BranchSelect.js index 3735af5d3..b07358ccc 100644 --- a/src/components/Branches/BranchSelect.js +++ b/src/components/Branches/BranchSelect.js @@ -35,7 +35,7 @@ const branchItemRenderer = (branch, { handleClick, modifiers, query }) => { + + + ); + + return ( + + + } + > + 1 {fromCurrency} = {exchangeRate} {toCurrency} + + + + ); +} + +const ExchangeRateFormGroup = styled(FormGroup)` + .bp3-label { + font-size: 12px !important; + opacity: 0.7; + line-height: 0.1rem; + } +`; + +const ExchangeRateButton = styled(Button)` + .bp3-button-text { + display: flex; + font-size: 13px; + font-weight: 500; + color: #0d244a; + } + padding: 0; +`; diff --git a/src/components/ExchangeRate/index.js b/src/components/ExchangeRate/index.js index ea982a466..039d6732e 100644 --- a/src/components/ExchangeRate/index.js +++ b/src/components/ExchangeRate/index.js @@ -1 +1,2 @@ -export * from './ExchangeRateInput'; \ No newline at end of file +export * from './ExchangeRateInput'; +export * from './ExchangeRateMutedField' \ No newline at end of file diff --git a/src/components/Warehouses/WarehouseSelect.js b/src/components/Warehouses/WarehouseSelect.js index dd0af73dc..cb9470d95 100644 --- a/src/components/Warehouses/WarehouseSelect.js +++ b/src/components/Warehouses/WarehouseSelect.js @@ -40,7 +40,7 @@ const warehouseItemRenderer = ( - !isEqual(toCurrency, fromCurrency) && !isUndefined(toCurrency); - // provider. const provider = { accounts, @@ -70,7 +65,6 @@ function MoneyInDialogProvider({ createCashflowTransactionMutate, setSubmitPayload, - isForeignCurrency, }; return ( diff --git a/src/containers/Dialogs/MoneyInDialog/MoneyInFloatingActions.js b/src/containers/Dialogs/MoneyInDialog/MoneyInFloatingActions.js index b33647f0f..3e786fe7b 100644 --- a/src/containers/Dialogs/MoneyInDialog/MoneyInFloatingActions.js +++ b/src/containers/Dialogs/MoneyInDialog/MoneyInFloatingActions.js @@ -48,7 +48,7 @@ function MoneyInFloatingActions({ > - + */} - + */}