@@ -19,6 +19,7 @@ import androidx.compose.ui.semantics.contentDescription
1919import androidx.compose.ui.semantics.semantics
2020import androidx.compose.ui.tooling.preview.Preview
2121import androidx.compose.ui.unit.dp
22+ import androidx.hilt.navigation.compose.hiltViewModel
2223import to.bitkit.ext.removeSpaces
2324import to.bitkit.ext.toLongOrDefault
2425import to.bitkit.models.BITCOIN_SYMBOL
@@ -39,6 +40,7 @@ fun NumberPadTextField(
3940 displayUnit : BitcoinDisplayUnit ,
4041 primaryDisplay : PrimaryDisplay ,
4142 modifier : Modifier = Modifier ,
43+ showSecondaryField : Boolean = true,
4244) {
4345 val isPreview = LocalInspectionMode .current
4446 if (isPreview) {
@@ -48,6 +50,7 @@ fun NumberPadTextField(
4850 unit = primaryDisplay,
4951 placeholder = " " ,
5052 showPlaceholder = true ,
53+ showSecondaryField = showSecondaryField,
5154 satoshis = 0 ,
5255 currencySymbol = if (primaryDisplay == PrimaryDisplay .BITCOIN ) BITCOIN_SYMBOL else " $"
5356 )
@@ -129,6 +132,7 @@ fun NumberPadTextField(
129132 value = value,
130133 unit = primaryDisplay,
131134 placeholder = placeholder,
135+ showSecondaryField = showSecondaryField,
132136 showPlaceholder = true ,
133137 satoshis = satoshis.toLongOrNull() ? : 0 ,
134138 currencySymbol = currency.getCurrencySymbol()
@@ -142,7 +146,7 @@ fun AmountInputHandler(
142146 displayUnit : BitcoinDisplayUnit ,
143147 onInputChanged : (String ) -> Unit ,
144148 onAmountCalculated : (String ) -> Unit ,
145- currencyVM : CurrencyViewModel ,
149+ currencyVM : CurrencyViewModel = hiltViewModel() ,
146150 overrideSats : Long? = null,
147151) {
148152 var lastDisplay by rememberSaveable { mutableStateOf(primaryDisplay) }
@@ -219,14 +223,17 @@ fun MoneyAmount(
219223 showPlaceholder : Boolean ,
220224 satoshis : Long ,
221225 currencySymbol : String ,
226+ showSecondaryField : Boolean = true,
222227) {
223228 Column (
224229 modifier = modifier.semantics { contentDescription = value },
225230 horizontalAlignment = Alignment .Start
226231 ) {
227- MoneySSB (sats = satoshis, unit = unit.not (), color = Colors .White64 )
232+ if (showSecondaryField) {
233+ MoneySSB (sats = satoshis, unit = unit.not (), color = Colors .White64 )
228234
229- Spacer (modifier = Modifier .height(12 .dp))
235+ Spacer (modifier = Modifier .height(12 .dp))
236+ }
230237
231238 Row (
232239 verticalAlignment = Alignment .CenterVertically
0 commit comments