11package to.bitkit.ui.sheets
22
3- import androidx.compose.foundation.Image
43import androidx.compose.foundation.layout.Column
5- import androidx.compose.foundation.layout.Spacer
6- import androidx.compose.foundation.layout.fillMaxSize
74import androidx.compose.foundation.layout.fillMaxWidth
85import androidx.compose.foundation.layout.imePadding
9- import androidx.compose.foundation.layout.navigationBarsPadding
10- import androidx.compose.foundation.layout.padding
11- import androidx.compose.foundation.layout.size
12- import androidx.compose.material3.Icon
136import androidx.compose.runtime.Composable
147import androidx.compose.runtime.LaunchedEffect
158import androidx.compose.runtime.getValue
16- import androidx.compose.runtime.rememberCoroutineScope
179import androidx.compose.ui.Modifier
18- import androidx.compose.ui.layout.ContentScale
19- import androidx.compose.ui.res.painterResource
20- import androidx.compose.ui.res.stringResource
21- import androidx.compose.ui.tooling.preview.Preview
22- import androidx.compose.ui.unit.dp
2310import androidx.lifecycle.compose.collectAsStateWithLifecycle
2411import androidx.navigation.compose.NavHost
2512import androidx.navigation.compose.rememberNavController
2613import androidx.navigation.toRoute
27- import kotlinx.coroutines.launch
2814import kotlinx.serialization.Serializable
29- import to.bitkit.R
3015import to.bitkit.models.NewTransactionSheetDetails
31- import to.bitkit.ui.appViewModel
32- import to.bitkit.ui.components.Caption13Up
33- import to.bitkit.ui.components.RectangleButton
34- import to.bitkit.ui.components.VerticalSpacer
35- import to.bitkit.ui.scaffold.SheetTopBar
3616import to.bitkit.ui.screens.scanner.QrScanningScreen
3717import to.bitkit.ui.screens.wallets.send.AddTagScreen
3818import to.bitkit.ui.screens.wallets.send.PIN_CHECK_RESULT_KEY
@@ -43,13 +23,11 @@ import to.bitkit.ui.screens.wallets.send.SendConfirmScreen
4323import to.bitkit.ui.screens.wallets.send.SendErrorScreen
4424import to.bitkit.ui.screens.wallets.send.SendPinCheckScreen
4525import to.bitkit.ui.screens.wallets.send.SendQuickPayScreen
26+ import to.bitkit.ui.screens.wallets.send.SendRecipientScreen
4627import to.bitkit.ui.screens.wallets.withdraw.WithDrawErrorScreen
4728import to.bitkit.ui.screens.wallets.withdraw.WithdrawConfirmScreen
4829import to.bitkit.ui.settings.support.SupportScreen
4930import to.bitkit.ui.shared.modifiers.sheetHeight
50- import to.bitkit.ui.shared.util.gradientBackground
51- import to.bitkit.ui.theme.AppThemeSurface
52- import to.bitkit.ui.theme.Colors
5331import to.bitkit.ui.utils.composableWithDefaultTransitions
5432import to.bitkit.viewmodels.AppViewModel
5533import to.bitkit.viewmodels.SendEffect
@@ -227,108 +205,6 @@ fun SendSheet(
227205 }
228206}
229207
230- @Composable
231- private fun SendRecipientScreen (
232- onEvent : (SendEvent ) -> Unit ,
233- ) {
234- val scope = rememberCoroutineScope()
235- val app = appViewModel
236- Column (
237- modifier = Modifier
238- .fillMaxSize()
239- .gradientBackground()
240- .navigationBarsPadding()
241- ) {
242- SheetTopBar (titleText = stringResource(R .string.wallet__send_bitcoin))
243- Column (
244- modifier = Modifier .padding(horizontal = 16 .dp)
245- ) {
246- VerticalSpacer (32 .dp)
247- Caption13Up (text = stringResource(R .string.wallet__send_to), color = Colors .White64 )
248- VerticalSpacer (16 .dp)
249-
250- RectangleButton (
251- label = stringResource(R .string.wallet__recipient_contact),
252- icon = {
253- Icon (
254- painter = painterResource(R .drawable.ic_users),
255- contentDescription = null ,
256- tint = Colors .Brand ,
257- modifier = Modifier .size(28 .dp),
258- )
259- },
260- modifier = Modifier .padding(bottom = 4 .dp)
261- ) {
262- scope.launch {
263- app?.toast(Exception (" Coming soon: Contact" ))
264- }
265- }
266-
267- RectangleButton (
268- label = stringResource(R .string.wallet__recipient_invoice),
269- icon = {
270- Icon (
271- painter = painterResource(R .drawable.ic_clipboard_text),
272- contentDescription = null ,
273- tint = Colors .Brand ,
274- modifier = Modifier .size(28 .dp),
275- )
276- },
277- modifier = Modifier .padding(bottom = 4 .dp)
278- ) {
279- onEvent(SendEvent .Paste )
280- }
281-
282- RectangleButton (
283- label = stringResource(R .string.wallet__recipient_manual),
284- icon = {
285- Icon (
286- painter = painterResource(R .drawable.ic_pencil_simple),
287- contentDescription = null ,
288- tint = Colors .Brand ,
289- modifier = Modifier .size(28 .dp),
290- )
291- },
292- modifier = Modifier .padding(bottom = 4 .dp)
293- ) {
294- onEvent(SendEvent .EnterManually )
295- }
296-
297- RectangleButton (
298- label = stringResource(R .string.wallet__recipient_scan),
299- icon = {
300- Icon (
301- painter = painterResource(R .drawable.ic_scan),
302- contentDescription = null ,
303- tint = Colors .Brand ,
304- modifier = Modifier .size(28 .dp),
305- )
306- },
307- ) {
308- onEvent(SendEvent .Scan )
309- }
310- Spacer (modifier = Modifier .weight(1f ))
311-
312- Image (
313- painter = painterResource(R .drawable.coin_stack_logo),
314- contentDescription = null ,
315- contentScale = ContentScale .FillWidth ,
316- modifier = Modifier .fillMaxWidth()
317- )
318- }
319- }
320- }
321-
322- @Preview(showSystemUi = true )
323- @Composable
324- private fun Preview () {
325- AppThemeSurface {
326- SendRecipientScreen (
327- onEvent = {},
328- )
329- }
330- }
331-
332208sealed interface SendRoute {
333209 @Serializable
334210 data object Recipient : SendRoute
0 commit comments