Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,7 @@ fun SendRecipientScreen(
galleryLauncher.launch("image/*")
}
},
onClickContact = {
app?.toast(AppError("Coming soon: Contact"))
},
onClickContact = { onEvent(SendEvent.Contacts) },
onClickPaste = { onEvent(SendEvent.Paste) },
onClickManual = { onEvent(SendEvent.EnterManually) },
cameraPermissionGranted = cameraPermissionState.status.isGranted,
Expand Down
64 changes: 64 additions & 0 deletions app/src/main/java/to/bitkit/ui/sheets/SendSheet.kt
Original file line number Diff line number Diff line change
@@ -1,25 +1,36 @@
package to.bitkit.ui.sheets

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.imePadding
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.rememberNavController
import androidx.navigation.toRoute
import kotlinx.serialization.Serializable
import to.bitkit.R
import to.bitkit.models.NewTransactionSheetDetails
import to.bitkit.models.NewTransactionSheetDirection
import to.bitkit.models.NewTransactionSheetType
import to.bitkit.ui.components.BodyM
import to.bitkit.ui.components.Display
import to.bitkit.ui.components.PrimaryButton
import to.bitkit.ui.components.VerticalSpacer
import to.bitkit.ui.scaffold.SheetTopBar
import to.bitkit.ui.screens.scanner.QrScanningScreen
import to.bitkit.ui.screens.wallets.send.AddTagScreen
import to.bitkit.ui.screens.wallets.send.PIN_CHECK_RESULT_KEY
Expand All @@ -39,8 +50,10 @@ import to.bitkit.ui.screens.wallets.withdraw.WithdrawErrorScreen
import to.bitkit.ui.settings.support.SupportScreen
import to.bitkit.ui.shared.modifiers.sheetHeight
import to.bitkit.ui.shared.util.gradientBackground
import to.bitkit.ui.theme.Colors
import to.bitkit.ui.utils.composableWithDefaultTransitions
import to.bitkit.ui.utils.navigationWithDefaultTransitions
import to.bitkit.ui.utils.withAccent
import to.bitkit.viewmodels.AppViewModel
import to.bitkit.viewmodels.SendEffect
import to.bitkit.viewmodels.SendEvent
Expand Down Expand Up @@ -88,6 +101,7 @@ fun SendSheet(
is SendEffect.NavigateToWithdrawError -> navController.navigate(SendRoute.WithdrawError)
is SendEffect.NavigateToFee -> navController.navigate(SendRoute.FeeRate)
is SendEffect.NavigateToFeeCustom -> navController.navigate(SendRoute.FeeCustom)
is SendEffect.NavigateToComingSoon -> navController.navigate(SendRoute.ComingSoon)
}
}
}
Expand Down Expand Up @@ -266,6 +280,11 @@ fun SendSheet(
}
)
}
composableWithDefaultTransitions<SendRoute.ComingSoon> {
ComingSoonSheetContent(
onBackClick = { navController.popBackStack() }
)
}
composableWithDefaultTransitions<SendRoute.Error> {
val route = it.toRoute<SendRoute.Error>()
SendErrorScreen(
Expand Down Expand Up @@ -337,6 +356,51 @@ sealed interface SendRoute {
@Serializable
data object Success : SendRoute

@Serializable
data object ComingSoon : SendRoute

@Serializable
data class Error(val errorMessage: String) : SendRoute
}

@Composable
private fun ComingSoonSheetContent(
onBackClick: () -> Unit,
) {
Column(
modifier = Modifier
.fillMaxSize()
.gradientBackground()
.navigationBarsPadding()
) {
SheetTopBar(
titleText = stringResource(R.string.coming_soon__title),
onBack = onBackClick
)

Column(
modifier = Modifier.padding(horizontal = 32.dp)
) {
Image(
painter = painterResource(R.drawable.img_cronometer),
contentDescription = null,
modifier = Modifier
.fillMaxWidth()
.weight(1f)
)

Display(
text = stringResource(R.string.coming_soon__headline).withAccent(accentColor = Colors.Brand),
color = Colors.White
)
VerticalSpacer(8.dp)
BodyM(text = stringResource(R.string.coming_soon__description), color = Colors.White64)
VerticalSpacer(54.dp)
PrimaryButton(
text = stringResource(R.string.coming_soon__button),
onClick = onBackClick,
)
VerticalSpacer(16.dp)
}
}
}
3 changes: 3 additions & 0 deletions app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,7 @@ class AppViewModel @Inject constructor(
SendEvent.ClearPayConfirmation -> _sendUiState.update { s -> s.copy(shouldConfirmPay = false) }
SendEvent.BackToAmount -> setSendEffect(SendEffect.PopBack(SendRoute.Amount))
SendEvent.NavToAddress -> setSendEffect(SendEffect.NavigateToAddress)
SendEvent.Contacts -> setSendEffect(SendEffect.NavigateToComingSoon)
}
}
}
Expand Down Expand Up @@ -2084,6 +2085,7 @@ sealed class SendEffect {
data object NavigateToQuickPay : SendEffect()
data object NavigateToFee : SendEffect()
data object NavigateToFeeCustom : SendEffect()
data object NavigateToComingSoon : SendEffect()
data class PaymentSuccess(val sheet: NewTransactionSheetDetails? = null) : SendEffect()
}

Expand Down Expand Up @@ -2124,6 +2126,7 @@ sealed interface SendEvent {
data object ClearPayConfirmation : SendEvent
data object BackToAmount : SendEvent
data object NavToAddress : SendEvent
data object Contacts : SendEvent
}

sealed interface LnurlParams {
Expand Down
Loading