Skip to content

Commit db5198f

Browse files
feat: account label card (#2870)
Co-authored-by: Sk Niyaj Ali <[email protected]>
1 parent 08beb8c commit db5198f

File tree

2 files changed

+107
-0
lines changed
  • core
    • designsystem/src/commonMain/kotlin/org/mifos/mobile/core/designsystem/theme
    • ui/src/commonMain/kotlin/org/mifos/mobile/core/ui/component

2 files changed

+107
-0
lines changed

core/designsystem/src/commonMain/kotlin/org/mifos/mobile/core/designsystem/theme/Type.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,15 @@ object MifosTypography {
341341
fontWeight = FontWeight(400),
342342
)
343343

344+
val bodyMediumEmphasized: TextStyle
345+
@Composable get() = TextStyle(
346+
fontSize = 14.sp,
347+
lineHeight = 20.sp,
348+
fontFamily = fontFamily(),
349+
letterSpacing = 0.25.sp,
350+
fontWeight = FontWeight(500),
351+
)
352+
344353
// verified
345354
val bodySmall: TextStyle
346355
@Composable get() = TextStyle(
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
/*
2+
* Copyright 2025 Mifos Initiative
3+
*
4+
* This Source Code Form is subject to the terms of the Mozilla Public
5+
* License, v. 2.0. If a copy of the MPL was not distributed with this
6+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
7+
*
8+
* See https://github.com/openMF/mobile-mobile/blob/master/LICENSE.md
9+
*/
10+
package org.mifos.mobile.core.ui.component
11+
12+
import androidx.compose.foundation.border
13+
import androidx.compose.foundation.layout.Arrangement
14+
import androidx.compose.foundation.layout.Column
15+
import androidx.compose.foundation.layout.fillMaxSize
16+
import androidx.compose.foundation.layout.padding
17+
import androidx.compose.material3.CardDefaults
18+
import androidx.compose.material3.MaterialTheme
19+
import androidx.compose.material3.Text
20+
import androidx.compose.runtime.Composable
21+
import androidx.compose.ui.Alignment
22+
import androidx.compose.ui.Modifier
23+
import androidx.compose.ui.graphics.Color
24+
import androidx.compose.ui.unit.dp
25+
import org.jetbrains.compose.ui.tooling.preview.Preview
26+
import org.mifos.mobile.core.designsystem.component.CardVariant
27+
import org.mifos.mobile.core.designsystem.component.MifosCustomCard
28+
import org.mifos.mobile.core.designsystem.theme.AppColors
29+
import org.mifos.mobile.core.designsystem.theme.DesignToken
30+
import org.mifos.mobile.core.designsystem.theme.MifosMobileTheme
31+
import org.mifos.mobile.core.designsystem.theme.MifosTypography
32+
33+
@Composable
34+
fun MifosLabelValueCard(
35+
label: String,
36+
value: String,
37+
color: Color,
38+
modifier: Modifier = Modifier,
39+
) {
40+
MifosCustomCard(
41+
variant = CardVariant.OUTLINED,
42+
modifier = modifier
43+
.border(
44+
1.dp,
45+
MaterialTheme.colorScheme.secondaryContainer,
46+
DesignToken.shapes.medium,
47+
),
48+
shape = DesignToken.shapes.medium,
49+
colors = CardDefaults.outlinedCardColors(containerColor = MaterialTheme.colorScheme.onPrimary),
50+
) {
51+
Column(
52+
modifier = Modifier
53+
.padding(DesignToken.padding.medium),
54+
verticalArrangement = Arrangement.spacedBy(DesignToken.spacing.extraSmall),
55+
horizontalAlignment = Alignment.Start,
56+
) {
57+
Text(
58+
text = label,
59+
style = MifosTypography.bodySmall,
60+
color = MaterialTheme.colorScheme.secondary,
61+
62+
)
63+
64+
Text(
65+
text = value,
66+
style = MifosTypography.bodyMediumEmphasized,
67+
color = color,
68+
)
69+
}
70+
}
71+
}
72+
73+
@Preview
74+
@Composable
75+
private fun Mifos_Label_Card_Preview() {
76+
MifosMobileTheme {
77+
Column(
78+
modifier = Modifier
79+
.fillMaxSize()
80+
.padding(16.dp),
81+
verticalArrangement = Arrangement.spacedBy(16.dp),
82+
) {
83+
MifosLabelValueCard(
84+
label = "Account Number",
85+
value = "268978976666",
86+
color = MaterialTheme.colorScheme.onBackground,
87+
88+
)
89+
90+
MifosLabelValueCard(
91+
label = "Product Type",
92+
value = "Education Loan",
93+
color = AppColors.customEnable,
94+
95+
)
96+
}
97+
}
98+
}

0 commit comments

Comments
 (0)