1+ package com.getcode.view.main.home.components
2+
3+ import androidx.compose.foundation.background
4+ import androidx.compose.foundation.layout.Column
5+ import androidx.compose.foundation.layout.Row
6+ import androidx.compose.foundation.layout.WindowInsets
7+ import androidx.compose.foundation.layout.fillMaxWidth
8+ import androidx.compose.foundation.layout.navigationBars
9+ import androidx.compose.foundation.layout.padding
10+ import androidx.compose.foundation.layout.windowInsetsPadding
11+ import androidx.compose.foundation.shape.ZeroCornerSize
12+ import androidx.compose.material.Text
13+ import androidx.compose.runtime.Composable
14+ import androidx.compose.ui.Alignment
15+ import androidx.compose.ui.Modifier
16+ import androidx.compose.ui.draw.clip
17+ import androidx.compose.ui.res.stringResource
18+ import androidx.compose.ui.text.font.FontWeight
19+ import com.getcode.R
20+ import com.getcode.models.Bill
21+ import com.getcode.theme.Brand
22+ import com.getcode.theme.CodeTheme
23+ import com.getcode.util.flagResId
24+ import com.getcode.util.formatted
25+ import com.getcode.view.components.ButtonState
26+ import com.getcode.view.components.CodeButton
27+ import com.getcode.view.main.giveKin.AmountArea
28+
29+ @Composable
30+ internal fun ReceivedKinConfirmation (
31+ bill : Bill .Cash ,
32+ onClaim : () -> Unit ,
33+ ) {
34+ Column (
35+ modifier = Modifier
36+ .clip(
37+ CodeTheme .shapes.medium.copy(
38+ bottomStart = ZeroCornerSize ,
39+ bottomEnd = ZeroCornerSize
40+ )
41+ )
42+ .background(Brand )
43+ .padding(
44+ horizontal = CodeTheme .dimens.inset,
45+ vertical = CodeTheme .dimens.grid.x3
46+ )
47+ .windowInsetsPadding(WindowInsets .navigationBars),
48+ horizontalAlignment = Alignment .CenterHorizontally
49+ ) {
50+ Text (
51+ modifier = Modifier .padding(top = CodeTheme .dimens.grid.x3),
52+ style = CodeTheme .typography.subtitle1.copy(
53+ fontWeight = FontWeight .Bold
54+ ),
55+ text = stringResource(id = R .string.subtitle_youReceived)
56+ )
57+
58+ Row {
59+ AmountArea (
60+ amountText = bill.amount.formatted(),
61+ currencyResId = bill.amount.rate.currency.flagResId,
62+ isClickable = false
63+ )
64+
65+ }
66+ CodeButton (
67+ modifier = Modifier .fillMaxWidth(),
68+ onClick = onClaim,
69+ buttonState = ButtonState .Filled ,
70+ text = stringResource(id = R .string.action_putInWallet)
71+ )
72+ }
73+ }
0 commit comments