Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apps/flipcash/core/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -628,4 +628,8 @@
<string name="description_withdrawUsdfAsUsdc">Your USDF will be converted 1:1 to Solana USDC on withdrawal</string>
<string name="displayName_solanaUsdc">Solana USDC</string>
<string name="displayName_usdc">USDC</string>
<string name="label_withdrawalAmount">Withdrawal amount</string>
<string name="label_lessFee">Less fee</string>
<string name="label_netAmount">Net amount</string>
<string name="label_amountInToken">Amount in %1$s</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material.Text
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.derivedStateOf
Expand Down Expand Up @@ -126,14 +126,14 @@ private fun LineItems(
) {
ReceiptLineItem(
modifier = Modifier.fillMaxWidth(),
label = AnnotatedString("Withdrawal amount"),
label = AnnotatedString(stringResource(R.string.label_withdrawalAmount)),
amount = tokenWithBalance.balance.formatted()
)

if (fee != null) {
ReceiptLineItem(
modifier = Modifier.fillMaxWidth(),
label = AnnotatedString("Less fee"),
label = AnnotatedString(stringResource(R.string.label_lessFee)),
amount = fee.formatted(extraPrefix = "-"),
)

Expand All @@ -143,20 +143,20 @@ private fun LineItems(

ReceiptLineItem(
modifier = Modifier.fillMaxWidth(),
label = AnnotatedString("Net amount"),
label = AnnotatedString(stringResource(R.string.label_netAmount)),
amount = netAmount
)
}

if (tokenWithBalance.token.address != Mint.usdf) {
val exchange = LocalExchange.current
ReceiptLineItem(
modifier = Modifier.fillMaxWidth(),
label = AnnotatedString("Amount in ${tokenWithBalance.displayName}"),
amount = transferAmount.convertingToUsdIfNeeded(exchange.entryRate)
.estimatedTokenAmountIn(tokenWithBalance.token, fractionDigits = 2),
)
}
val exchange = LocalExchange.current
ReceiptLineItem(
modifier = Modifier.fillMaxWidth(),
label = AnnotatedString(
stringResource(R.string.label_amountInToken, tokenWithBalance.displayName)
),
amount = transferAmount.convertingToUsdIfNeeded(exchange.entryRate)
.estimatedTokenAmountIn(tokenWithBalance.token, fractionDigits = 2),
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ private fun WithdrawalConfirmationScreenContent(
tokenWithBalance = TokenWithBalance(
state.token!!.token,
balance = state.amountEntryState.selectedAmount.localFiat.nativeAmount,
displayName = state.token.displayName
),
destination = state.destinationState.textFieldState.text.toString(),
fee = state.feeInEntryCurrency,
Expand Down
Loading