Skip to content

Commit ef69dcb

Browse files
committed
feat(home): add empty state and account creation flow
This commit introduces an empty state for the home screen when the user has no accounts. It also adds a bottom sheet for account creation and refactors the `MifosDashboardCard` to support this new flow. The `MifosProgressIndicator` now loops indefinitely. The registration flow now includes the middle name.
1 parent 5c3920b commit ef69dcb

File tree

13 files changed

+514
-151
lines changed

13 files changed

+514
-151
lines changed

core/data/src/commonMain/kotlin/org/mifos/mobile/core/data/repository/UserAuthRepository.kt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,12 @@ package org.mifos.mobile.core.data.repository
1111

1212
import org.mifos.mobile.core.common.DataState
1313
import org.mifos.mobile.core.model.entity.User
14+
import org.mifos.mobile.core.model.entity.register.RegisterPayload
1415

1516
interface UserAuthRepository {
1617

1718
suspend fun registerUser(
18-
accountNumber: String?,
19-
authenticationMode: String?,
20-
email: String?,
21-
firstName: String?,
22-
lastName: String?,
23-
mobileNumber: String?,
24-
password: String?,
25-
username: String?,
19+
registerPayload: RegisterPayload,
2620
): DataState<String>
2721

2822
suspend fun login(username: String, password: String): DataState<User>

core/data/src/commonMain/kotlin/org/mifos/mobile/core/data/repositoryImpl/UserAuthRepositoryImp.kt

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,8 @@ class UserAuthRepositoryImp(
3131
) : UserAuthRepository {
3232

3333
override suspend fun registerUser(
34-
accountNumber: String?,
35-
authenticationMode: String?,
36-
email: String?,
37-
firstName: String?,
38-
lastName: String?,
39-
mobileNumber: String?,
40-
password: String?,
41-
username: String?,
34+
registerPayload: RegisterPayload,
4235
): DataState<String> {
43-
val registerPayload = RegisterPayload(
44-
accountNumber = accountNumber,
45-
authenticationMode = authenticationMode,
46-
email = email,
47-
firstName = firstName,
48-
lastName = lastName,
49-
mobileNumber = mobileNumber,
50-
password = password,
51-
username = username,
52-
)
5336
return withContext(ioDispatcher) {
5437
try {
5538
val response = dataManager.registrationApi.registerUser(registerPayload)

core/designsystem/src/commonMain/kotlin/org/mifos/mobile/core/designsystem/icon/MifosIcons.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ import androidx.compose.material.icons.rounded.Home
5454
import androidx.compose.material.icons.rounded.SwapHoriz
5555
import androidx.compose.ui.graphics.vector.ImageVector
5656
import fluent.ui.system.icons.FluentIcons
57+
import fluent.ui.system.icons.colored.AddCircle
5758
import fluent.ui.system.icons.colored.Alert
59+
import fluent.ui.system.icons.colored.CoinMultiple
60+
import fluent.ui.system.icons.colored.Savings
5861
import fluent.ui.system.icons.colored.Warning
5962
import fluent.ui.system.icons.filled.AppRecent
6063
import fluent.ui.system.icons.filled.ArchiveSettings
@@ -192,7 +195,9 @@ object MifosIcons {
192195
val SearchNew = FluentIcons.Regular.Search
193196

194197
val SavingsAccount = FluentIcons.Filled.Wallet
198+
val SavingsAccountColor = FluentIcons.Colored.Savings
195199
val LoanAccount = FluentIcons.Filled.CoinMultiple
200+
val LoanAccountColor = FluentIcons.Colored.CoinMultiple
196201
val ShareAccount = FluentIcons.Filled.DataWhisker
197202
val ApplyForLoan = FluentIcons.Filled.Receipt
198203
val ApplyForSavings = FluentIcons.Filled.Savings
@@ -255,4 +260,6 @@ object MifosIcons {
255260
val Signature = FluentIcons.Regular.DrawShape
256261
val Camera = FluentIcons.Regular.Camera
257262
val Attach = FluentIcons.Regular.Attach
263+
264+
val AddColor = FluentIcons.Colored.AddCircle
258265
}

core/model/src/commonMain/kotlin/org/mifos/mobile/core/model/entity/register/RegisterPayload.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ data class RegisterPayload(
1818

1919
val firstName: String? = null,
2020

21+
val middleName: String? = null,
22+
2123
val lastName: String? = null,
2224

2325
val email: String? = null,

core/ui/src/commonMain/composeResources/values/strings.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@
120120
<string name="pay_from">Pay from</string>
121121
<string name="available_balance_formatted">Available Balance - %1$s</string>
122122

123+
<string name="feature_dashboard_welcome_back">Welcome back to Mifos</string>
124+
<string name="feature_dashboard_no_accounts_title">No Accounts Yet</string>
125+
<string name="feature_dashboard_no_accounts_description">Start your financial journey by opening your first account with us.</string>
126+
<string name="feature_dashboard_open_account">Open Account</string>
127+
123128
<string name="feature_savings_filter">Filters</string>
124129
<string name="feature_savings_reset">Reset</string>
125130
<string name="feature_savings_apply">Apply</string>

0 commit comments

Comments
 (0)