Skip to content

Commit

Permalink
address pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
UncleSamtoshi committed Mar 14, 2023
1 parent 1bc4050 commit fb9c829
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
10 changes: 7 additions & 3 deletions app/hooks/use-display-currency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,13 @@ export const useDisplayCurrency = () => {
walletAmount,
})

return `${formatMoneyAmount(primaryAmountWithDefault)}${
secondaryAmount ? ` (${formatMoneyAmount(secondaryAmount)})` : ""
}`
if (secondaryAmount) {
return `${formatMoneyAmount(primaryAmountWithDefault)} (${formatMoneyAmount(
secondaryAmount,
)})`
}

return formatMoneyAmount(primaryAmountWithDefault)
},
[getSecondaryAmountIfCurrencyIsDifferent, formatMoneyAmount],
)
Expand Down
10 changes: 2 additions & 8 deletions app/screens/send-bitcoin-screen/send-bitcoin-details-screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,7 @@ const SendBitcoinDetailsScreen: React.FC<Props> = ({ route }) => {
let validAmount = true
let invalidAmountErrorMessage = ""

if (
moneyAmountIsCurrencyType(settlementAmount, WalletCurrency.Btc) &&
btcBalanceMoneyAmount
) {
if (moneyAmountIsCurrencyType(settlementAmount, WalletCurrency.Btc)) {
validAmount = lessThanOrEqualTo({
value: settlementAmount,
lessThanOrEqualTo: btcBalanceMoneyAmount,
Expand All @@ -362,10 +359,7 @@ const SendBitcoinDetailsScreen: React.FC<Props> = ({ route }) => {
}
}

if (
moneyAmountIsCurrencyType(settlementAmount, WalletCurrency.Usd) &&
usdBalanceMoneyAmount
) {
if (moneyAmountIsCurrencyType(settlementAmount, WalletCurrency.Usd)) {
validAmount = lessThanOrEqualTo({
value: settlementAmount,
lessThanOrEqualTo: usdBalanceMoneyAmount,
Expand Down
4 changes: 2 additions & 2 deletions app/types/amounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export const addMoneyAmounts = <T extends WalletOrDisplayCurrency>({
}: {
a: MoneyAmount<T>
b: MoneyAmount<T>
}) => {
}): MoneyAmount<T> => {
return {
amount: a.amount + b.amount,
currency: a.currency,
Expand All @@ -113,7 +113,7 @@ export const subtractMoneyAmounts = <T extends WalletOrDisplayCurrency>({
}: {
a: MoneyAmount<T>
b: MoneyAmount<T>
}) => {
}): MoneyAmount<T> => {
return {
amount: a.amount - b.amount,
currency: a.currency,
Expand Down
2 changes: 2 additions & 0 deletions e2e/config/wdio.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ const baseSpec = {
},
}

exports.baseSpec = baseSpec

exports.config = {
...baseSpec,
capabilities: [capabilities],
Expand Down

0 comments on commit fb9c829

Please sign in to comment.