Skip to content

Commit 37bea88

Browse files
authored
Merge pull request #382 from synonymdev/feat/use-custom-numpad
feat: use custom numberpad in all flows
2 parents 7030d57 + 2884259 commit 37bea88

File tree

17 files changed

+336
-426
lines changed

17 files changed

+336
-426
lines changed

app/src/main/java/to/bitkit/repositories/LightningRepo.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,7 @@ class LightningRepo @Inject constructor(
512512
Result.success(paymentId)
513513
}
514514

515+
@Suppress("LongParameterList")
515516
suspend fun sendOnChain(
516517
address: Address,
517518
sats: ULong,

app/src/main/java/to/bitkit/ui/components/AmountInput.kt

Lines changed: 0 additions & 218 deletions
This file was deleted.

app/src/main/java/to/bitkit/ui/components/NumberPad.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,6 @@ private fun PreviewClassic() {
253253
currencies = CurrencyState(
254254
displayUnit = BitcoinDisplayUnit.CLASSIC,
255255
),
256-
modifier = Modifier.fillMaxWidth(),
257256
)
258257
}
259258
}
@@ -270,7 +269,6 @@ private fun PreviewFiat() {
270269
currencies = CurrencyState(
271270
primaryDisplay = PrimaryDisplay.FIAT,
272271
),
273-
modifier = Modifier.fillMaxWidth(),
274272
)
275273
}
276274
}
@@ -284,7 +282,6 @@ private fun PreviewSmall() {
284282
FillHeight()
285283
NumberPad(
286284
viewModel = previewAmountInputViewModel(),
287-
modifier = Modifier.fillMaxWidth(),
288285
)
289286
}
290287
}

app/src/main/java/to/bitkit/ui/components/UnitButton.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,15 @@ import to.bitkit.R
1212
import to.bitkit.models.PrimaryDisplay
1313
import to.bitkit.repositories.CurrencyState
1414
import to.bitkit.ui.LocalCurrencies
15-
import to.bitkit.ui.currencyViewModel
1615
import to.bitkit.ui.theme.AppThemeSurface
1716
import to.bitkit.ui.theme.Colors
18-
import to.bitkit.viewmodels.CurrencyViewModel
1917

2018
@Composable
2119
fun UnitButton(
20+
onClick: () -> Unit,
2221
modifier: Modifier = Modifier,
2322
color: Color = Colors.Brand,
2423
currencies: CurrencyState = LocalCurrencies.current,
25-
currencyVM: CurrencyViewModel? = currencyViewModel,
26-
onClick: () -> Unit = { currencyVM?.switchUnit() },
2724
) {
2825
NumberPadActionButton(
2926
text = if (currencies.primaryDisplay == PrimaryDisplay.BITCOIN) "Bitcoin" else currencies.selectedCurrency,
@@ -42,8 +39,8 @@ private fun Preview() {
4239
verticalArrangement = Arrangement.spacedBy(16.dp),
4340
modifier = Modifier.padding(16.dp)
4441
) {
45-
UnitButton(currencies = CurrencyState(primaryDisplay = PrimaryDisplay.BITCOIN))
46-
UnitButton(currencies = CurrencyState(primaryDisplay = PrimaryDisplay.FIAT))
42+
UnitButton(currencies = CurrencyState(primaryDisplay = PrimaryDisplay.BITCOIN), onClick = {})
43+
UnitButton(currencies = CurrencyState(primaryDisplay = PrimaryDisplay.FIAT), onClick = {})
4744
}
4845
}
4946
}

0 commit comments

Comments
 (0)