@@ -19,6 +19,7 @@ import androidx.compose.foundation.layout.padding
1919import androidx.compose.foundation.layout.windowInsetsPadding
2020import androidx.compose.foundation.layout.wrapContentHeight
2121import androidx.compose.foundation.shape.RoundedCornerShape
22+ import androidx.compose.foundation.shape.ZeroCornerSize
2223import androidx.compose.material.Text
2324import androidx.compose.material.TextButton
2425import androidx.compose.material.minimumInteractiveComponentSize
@@ -31,6 +32,7 @@ import androidx.compose.runtime.remember
3132import androidx.compose.runtime.setValue
3233import androidx.compose.ui.Alignment
3334import androidx.compose.ui.Modifier
35+ import androidx.compose.ui.draw.clip
3436import androidx.compose.ui.graphics.Color
3537import androidx.compose.ui.res.stringResource
3638import androidx.compose.ui.tooling.preview.Preview
@@ -45,11 +47,13 @@ import com.getcode.model.Kind
4547import com.getcode.model.Rate
4648import com.getcode.models.PaymentConfirmation
4749import com.getcode.models.PaymentState
50+ import com.getcode.theme.Brand
4851import com.getcode.theme.CodeTheme
4952import com.getcode.theme.White50
5053import com.getcode.view.components.ButtonState
5154import com.getcode.view.components.CodeButton
5255import com.getcode.view.components.SlideToConfirm
56+ import com.getcode.view.components.SlideToConfirmDefaults
5357import kotlinx.coroutines.delay
5458
5559@Composable
@@ -77,15 +81,25 @@ internal fun PaymentConfirmation(
7781 modifier = modifier
7882 .fillMaxWidth()
7983 .wrapContentHeight()
80- .background(Color .Black )
84+ .clip(
85+ CodeTheme .shapes.medium.copy(
86+ bottomStart = ZeroCornerSize ,
87+ bottomEnd = ZeroCornerSize
88+ )
89+ )
90+ .background(Brand )
8191 .padding(horizontal = 20 .dp, vertical = 30 .dp)
8292 .windowInsetsPadding(WindowInsets .navigationBars),
8393 horizontalAlignment = Alignment .CenterHorizontally ,
8494 verticalArrangement = Arrangement .spacedBy(15 .dp)
8595 ) {
8696 val amount = requestedAmount
8797 if (state != null && amount != null && balance != null ) {
88- if (balance.kin >= amount.kin) {
98+ val balanceAmount = remember {
99+ balance.kin
100+ }
101+
102+ if (balanceAmount >= amount.kin) {
89103 PaymentConfirmationContent (
90104 amount = amount,
91105 isSending = isSending,
@@ -297,6 +311,7 @@ private fun PaymentConfirmationContent(
297311 }
298312 SlideToConfirm (
299313 isLoading = isSending,
314+ trackColor = SlideToConfirmDefaults .BlueTrackColor ,
300315 isSuccess = state is PaymentState .Sent ,
301316 onConfirm = { onApproved() },
302317 )
0 commit comments