Skip to content

Commit 9cbb943

Browse files
feat : Client Profile UI (#2462)
1 parent 15ec646 commit 9cbb943

20 files changed

Lines changed: 775 additions & 14 deletions

File tree

core/designsystem/src/commonMain/kotlin/com/mifos/core/designsystem/icon/MifosIcons.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ import androidx.compose.material.icons.rounded.Translate
111111
import androidx.compose.ui.graphics.vector.ImageVector
112112
import fluent.ui.system.icons.FluentIcons
113113
import fluent.ui.system.icons.filled.ChevronRight
114-
import fluent.ui.system.icons.filled.Person
115114
import fluent.ui.system.icons.regular.ChevronLeft
116115

117116
object MifosIcons {
@@ -215,8 +214,6 @@ object MifosIcons {
215214

216215
val ChevronLeft = FluentIcons.Regular.ChevronLeft
217216
val ChevronRight = FluentIcons.Filled.ChevronRight
218-
val ProfileSet = FluentIcons.Filled.Person
219-
220217
val ViewAccount = Icons.Outlined.Savings
221218
val ViewDocument = Icons.Outlined.DocumentScanner
222219
val ApproveAccount = Icons.Outlined.CheckCircle

core/designsystem/src/commonMain/kotlin/com/mifos/core/designsystem/theme/DesignToken.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ data class AppPadding(
136136
val medium: Dp = 12.dp,
137137
val large: Dp = 16.dp,
138138
val largeIncreased: Dp = 20.dp,
139+
val largeIncreasedExtra: Dp = 24.dp,
139140
val extraLarge: Dp = 28.dp,
140141
val extraLargeIncreased: Dp = 32.dp,
141142
val extraExtraLarge: Dp = 48.dp,
@@ -280,6 +281,7 @@ data class AppElevation(
280281
*/
281282
@Immutable
282283
data class AppSizes(
284+
val iconMinyMiny: Dp = 8.dp,
283285
val iconMiny: Dp = 12.dp,
284286
val iconSmall: Dp = 16.dp,
285287
val iconAverage: Dp = 20.dp,

core/ui/src/commonMain/kotlin/com/mifos/core/ui/components/MifosRowCard.kt

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010
package com.mifos.core.ui.components
1111

12+
import androidx.compose.foundation.background
1213
import androidx.compose.foundation.clickable
1314
import androidx.compose.foundation.layout.Arrangement
1415
import androidx.compose.foundation.layout.Column
@@ -18,6 +19,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
1819
import androidx.compose.foundation.layout.padding
1920
import androidx.compose.foundation.layout.size
2021
import androidx.compose.foundation.layout.width
22+
import androidx.compose.foundation.shape.CircleShape
2123
import androidx.compose.material3.ExperimentalMaterial3Api
2224
import androidx.compose.material3.Icon
2325
import androidx.compose.material3.MaterialTheme
@@ -33,6 +35,8 @@ import com.mifos.core.designsystem.theme.DesignToken
3335
import com.mifos.core.designsystem.theme.MifosTheme
3436
import com.mifos.core.designsystem.theme.MifosTypography
3537
import com.mifos.core.ui.util.TextUtil
38+
import org.jetbrains.compose.resources.DrawableResource
39+
import org.jetbrains.compose.resources.painterResource
3640
import org.jetbrains.compose.ui.tooling.preview.Preview
3741

3842
@OptIn(ExperimentalMaterial3Api::class)
@@ -89,7 +93,8 @@ fun MifosRowCard(
8993
fun MifosRowCard(
9094
modifier: Modifier = Modifier,
9195
title: String,
92-
byteArray: ByteArray?,
96+
byteArray: ByteArray? = null,
97+
imageVector: DrawableResource? = null,
9398
leftValues: List<TextUtil>,
9499
rightValues: List<TextUtil>,
95100
) {
@@ -98,10 +103,24 @@ fun MifosRowCard(
98103
.fillMaxWidth(),
99104
verticalAlignment = Alignment.CenterVertically,
100105
) {
101-
MifosUserImage(
102-
bitmap = byteArray,
103-
modifier = Modifier.size(DesignToken.sizes.iconExtraLarge),
104-
)
106+
if (imageVector == null) {
107+
MifosUserImage(
108+
bitmap = byteArray,
109+
modifier = Modifier.size(DesignToken.sizes.iconExtraLarge),
110+
)
111+
} else {
112+
Icon(
113+
painter = painterResource(imageVector),
114+
modifier = Modifier
115+
.size(DesignToken.sizes.iconExtraLarge)
116+
.background(
117+
color = Color.LightGray.copy(alpha = 0.15f),
118+
shape = CircleShape,
119+
)
120+
.padding(DesignToken.padding.small),
121+
contentDescription = null,
122+
)
123+
}
105124
Spacer(Modifier.width(DesignToken.padding.medium))
106125
Column(
107126
modifier = Modifier.weight(1f),
@@ -132,7 +151,7 @@ fun MifosRowCard(
132151
Icon(
133152
imageVector = MifosIcons.ChevronRight,
134153
contentDescription = null,
135-
modifier = Modifier.size(DesignToken.sizes.iconSmall),
154+
modifier = Modifier.size(DesignToken.sizes.iconMiny),
136155
)
137156
}
138157
}

feature/client/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010
plugins {
1111
alias(libs.plugins.mifos.cmp.feature)
12+
alias(libs.plugins.kotlin.serialization)
1213
}
1314

1415
android {
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright 2025 Mifos Initiative
4+
5+
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
6+
If a copy of the MPL was not distributed with this file,
7+
You can obtain one at https://mozilla.org/MPL/2.0/.
8+
9+
See https://github.com/openMF/android-client/blob/master/LICENSE.md
10+
-->
11+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
12+
android:width="20dp"
13+
android:height="20dp"
14+
android:viewportWidth="20"
15+
android:viewportHeight="20">
16+
<path
17+
android:pathData="M18.333,2.5H1.667C0.75,2.5 0,3.25 0,4.167V15.833C0,16.75 0.75,17.5 1.667,17.5H18.333C19.25,17.5 19.992,16.75 19.992,15.833L20,4.167C20,3.25 19.25,2.5 18.333,2.5ZM7.5,6.667C8.875,6.667 10,7.792 10,9.167C10,10.542 8.875,11.667 7.5,11.667C6.125,11.667 5,10.542 5,9.167C5,7.792 6.125,6.667 7.5,6.667ZM1.733,15.833C2.883,13.842 5.033,12.5 7.5,12.5C9.967,12.5 12.117,13.842 13.267,15.833H1.733ZM17.475,8.208L16.85,9.292L15.625,8.583V10H14.375V8.583L13.15,9.292L12.525,8.208L13.75,7.5L12.525,6.792L13.15,5.708L14.375,6.417V5H15.625V6.417L16.85,5.708L17.475,6.792L16.25,7.5L17.475,8.208Z"
18+
android:strokeAlpha="0.2"
19+
android:fillColor="#191C20"
20+
android:fillAlpha="0.2"/>
21+
</vector>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright 2025 Mifos Initiative
4+
5+
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
6+
If a copy of the MPL was not distributed with this file,
7+
You can obtain one at https://mozilla.org/MPL/2.0/.
8+
9+
See https://github.com/openMF/android-client/blob/master/LICENSE.md
10+
-->
11+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
12+
android:width="20dp"
13+
android:height="20dp"
14+
android:viewportWidth="20"
15+
android:viewportHeight="20">
16+
<path
17+
android:pathData="M13.532,9.591L14.841,8.283L11.716,5.158L10.407,6.466L6.957,3.025C6.307,2.375 5.249,2.375 4.599,3.025L3.016,4.608C2.366,5.258 2.366,6.316 3.016,6.966L6.457,10.408L2.499,14.375V17.5H5.624L9.591,13.533L13.032,16.975C13.824,17.766 14.891,17.475 15.391,16.975L16.974,15.391C17.624,14.741 17.624,13.683 16.974,13.033L13.532,9.591ZM7.649,9.225L4.199,5.783L5.774,4.2L6.832,5.258L5.849,6.25L7.024,7.425L8.016,6.433L9.224,7.641L7.649,9.225ZM14.216,15.8L10.774,12.358L12.357,10.775L13.566,11.983L12.574,12.975L13.749,14.15L14.741,13.158L15.799,14.216L14.216,15.8Z"
18+
android:strokeAlpha="0.2"
19+
android:fillColor="#191C20"
20+
android:fillAlpha="0.2"/>
21+
<path
22+
android:pathData="M17.257,5.866C17.582,5.541 17.582,5.016 17.257,4.691L15.307,2.741C14.916,2.35 14.374,2.5 14.132,2.741L12.607,4.266L15.732,7.391L17.257,5.866Z"
23+
android:strokeAlpha="0.2"
24+
android:fillColor="#191C20"
25+
android:fillAlpha="0.2"/>
26+
</vector>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright 2025 Mifos Initiative
4+
5+
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
6+
If a copy of the MPL was not distributed with this file,
7+
You can obtain one at https://mozilla.org/MPL/2.0/.
8+
9+
See https://github.com/openMF/android-client/blob/master/LICENSE.md
10+
-->
11+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
12+
android:width="20dp"
13+
android:height="20dp"
14+
android:viewportWidth="20"
15+
android:viewportHeight="20">
16+
<path
17+
android:pathData="M11.667,1.666H5C4.083,1.666 3.342,2.417 3.342,3.333L3.333,16.667C3.333,17.583 4.075,18.333 4.992,18.333H15C15.917,18.333 16.667,17.583 16.667,16.667V6.667L11.667,1.666ZM13.333,13.333H10.833V15.833H9.167V13.333H6.667V11.667H9.167V9.167H10.833V11.667H13.333V13.333ZM10.833,7.5V2.917L15.417,7.5H10.833Z"
18+
android:strokeAlpha="0.2"
19+
android:fillColor="#191C20"
20+
android:fillAlpha="0.2"/>
21+
</vector>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright 2025 Mifos Initiative
4+
5+
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
6+
If a copy of the MPL was not distributed with this file,
7+
You can obtain one at https://mozilla.org/MPL/2.0/.
8+
9+
See https://github.com/openMF/android-client/blob/master/LICENSE.md
10+
-->
11+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
12+
android:width="20dp"
13+
android:height="20dp"
14+
android:viewportWidth="20"
15+
android:viewportHeight="20">
16+
<path
17+
android:pathData="M15.833,3.333H12.35C12,2.366 11.083,1.666 10,1.666C8.917,1.666 8,2.366 7.65,3.333H4.167C3.25,3.333 2.5,4.083 2.5,5V16.667C2.5,17.583 3.25,18.333 4.167,18.333H15.833C16.75,18.333 17.5,17.583 17.5,16.667V5C17.5,4.083 16.75,3.333 15.833,3.333ZM10,3.125C10.342,3.125 10.625,3.408 10.625,3.75C10.625,4.091 10.342,4.375 10,4.375C9.658,4.375 9.375,4.091 9.375,3.75C9.375,3.408 9.658,3.125 10,3.125ZM7.583,15H5.833V13.217L10.8,8.25L12.567,10.017L7.583,15ZM14.042,8.558L13.158,9.441L11.392,7.675L12.275,6.792C12.442,6.625 12.7,6.625 12.867,6.792L14.042,7.966C14.208,8.133 14.208,8.392 14.042,8.558Z"
18+
android:strokeAlpha="0.2"
19+
android:fillColor="#191C20"
20+
android:fillAlpha="0.2"/>
21+
</vector>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright 2025 Mifos Initiative
4+
5+
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
6+
If a copy of the MPL was not distributed with this file,
7+
You can obtain one at https://mozilla.org/MPL/2.0/.
8+
9+
See https://github.com/openMF/android-client/blob/master/LICENSE.md
10+
-->
11+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
12+
android:width="20dp"
13+
android:height="20dp"
14+
android:viewportWidth="20"
15+
android:viewportHeight="20">
16+
<path
17+
android:pathData="M13.333,9.167C14.717,9.167 15.825,8.05 15.825,6.667C15.825,5.283 14.717,4.167 13.333,4.167C11.95,4.167 10.833,5.283 10.833,6.667C10.833,8.05 11.95,9.167 13.333,9.167ZM6.667,9.167C8.05,9.167 9.158,8.05 9.158,6.667C9.158,5.283 8.05,4.167 6.667,4.167C5.283,4.167 4.167,5.283 4.167,6.667C4.167,8.05 5.283,9.167 6.667,9.167ZM6.667,10.833C4.725,10.833 0.833,11.808 0.833,13.75V15.833H12.5V13.75C12.5,11.808 8.608,10.833 6.667,10.833ZM13.333,10.833C13.092,10.833 12.817,10.85 12.525,10.875C13.492,11.575 14.167,12.517 14.167,13.75V15.833H19.167V13.75C19.167,11.808 15.275,10.833 13.333,10.833Z"
18+
android:strokeAlpha="0.2"
19+
android:fillColor="#191C20"
20+
android:fillAlpha="0.2"/>
21+
</vector>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright 2025 Mifos Initiative
4+
5+
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
6+
If a copy of the MPL was not distributed with this file,
7+
You can obtain one at https://mozilla.org/MPL/2.0/.
8+
9+
See https://github.com/openMF/android-client/blob/master/LICENSE.md
10+
-->
11+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
12+
android:width="20dp"
13+
android:height="20dp"
14+
android:viewportWidth="20"
15+
android:viewportHeight="20">
16+
<group>
17+
<clip-path
18+
android:pathData="M0,0h20v20h-20z"/>
19+
<path
20+
android:pathData="M10.408,10.834L9.633,9.284C9.325,8.668 9.575,7.918 10.192,7.609L10.408,7.501L15.183,12.051C15.6,12.443 15.833,12.993 15.833,13.559V17.918C15.833,19.068 14.9,20.001 13.75,20.001H4.583C4.125,20.001 3.75,19.626 3.75,19.168C3.75,18.709 4.125,18.334 4.583,18.334H8.333V17.501H3.333C2.875,17.501 2.5,17.126 2.5,16.668C2.5,16.209 2.875,15.834 3.333,15.834H8.333V15.001H2.5C2.042,15.001 1.667,14.626 1.667,14.168C1.667,13.709 2.042,13.334 2.5,13.334H8.333V12.501H3.75C3.292,12.501 2.917,12.126 2.917,11.668C2.917,11.209 3.292,10.834 3.75,10.834H10.408ZM9.817,5.934C9.117,6.268 8.842,6.451 8.458,6.926L6.208,4.551C5.892,4.218 5.908,3.693 6.242,3.376C6.575,3.059 7.1,3.076 7.417,3.409L9.817,5.934ZM8.033,7.676C7.842,8.134 7.792,8.709 7.867,9.168H7.15L5.258,7.176C4.942,6.843 4.95,6.318 5.292,6.001C5.625,5.684 6.15,5.701 6.467,6.034L8.033,7.676ZM16.942,11.593L17.675,10.901C18.092,10.509 18.333,9.959 18.333,9.384V2.793L18.108,2.709C17.458,2.476 16.742,2.809 16.508,3.459L15.917,5.093L11.333,0.259C11.017,-0.074 10.492,-0.091 10.158,0.226C9.825,0.543 9.808,1.068 10.125,1.401L13.283,4.726L12.675,5.301L8.658,1.068C8.342,0.734 7.817,0.718 7.483,1.034C7.15,1.351 7.133,1.876 7.45,2.209L10.6,5.526L12.817,7.501L16.333,10.843C16.575,11.068 16.775,11.318 16.942,11.593Z"
21+
android:strokeAlpha="0.2"
22+
android:fillColor="#191C20"
23+
android:fillAlpha="0.2"/>
24+
</group>
25+
</vector>

0 commit comments

Comments
 (0)