Skip to content
Closed
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
78 changes: 78 additions & 0 deletions app/src/main/java/to/bitkit/ui/sheets/ComingSoonSheetContent.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
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.navigationBarsPadding
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
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.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import to.bitkit.R
import to.bitkit.ui.components.BodyM
import to.bitkit.ui.components.BottomSheetPreview
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.shared.modifiers.sheetHeight
import to.bitkit.ui.shared.util.gradientBackground
import to.bitkit.ui.theme.AppThemeSurface
import to.bitkit.ui.theme.Colors
import to.bitkit.ui.utils.withAccent

@Composable
fun ComingSoonSheetContent(
onBack: () -> Unit,
modifier: Modifier = Modifier,
) {
Column(
modifier = modifier
.fillMaxSize()
.gradientBackground()
.navigationBarsPadding()
.testTag("ComingSoonSheet")
) {
SheetTopBar(titleText = stringResource(R.string.coming_soon__title), onBack = onBack)
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 = onBack,
)
}
}
}

@Preview(showSystemUi = true)
@Composable
private fun Preview() {
AppThemeSurface {
BottomSheetPreview {
ComingSoonSheetContent(
onBack = {},
modifier = Modifier.sheetHeight(),
)
}
}
}
9 changes: 9 additions & 0 deletions app/src/main/java/to/bitkit/ui/sheets/SendSheet.kt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,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 +267,11 @@ fun SendSheet(
}
)
}
composableWithDefaultTransitions<SendRoute.ComingSoon> {
ComingSoonSheetContent(
onBack = { navController.popBackStack() }
)
}
composableWithDefaultTransitions<SendRoute.Error> {
val route = it.toRoute<SendRoute.Error>()
SendErrorScreen(
Expand Down Expand Up @@ -337,6 +343,9 @@ sealed interface SendRoute {
@Serializable
data object Success : SendRoute

@Serializable
data object ComingSoon : SendRoute

@Serializable
data class Error(val errorMessage: String) : SendRoute
}
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