Skip to content

Commit a2c7390

Browse files
authored
MIFOSAC-506 Bug: "Create" button for creating new center is unresponsive and does not submit the form (#2547)
1 parent 01c9f37 commit a2c7390

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

core/designsystem/src/commonMain/kotlin/com/mifos/core/designsystem/component/MifosButton.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ fun MifosButton(
5858
contentPadding: PaddingValues = ButtonDefaults.ContentPadding,
5959
elevation: ButtonElevation? = ButtonDefaults.buttonElevation(),
6060
colors: ButtonColors = ButtonDefaults.buttonColors(
61-
containerColor = MaterialTheme.colorScheme.background,
61+
containerColor = MaterialTheme.colorScheme.primary,
62+
contentColor = MaterialTheme.colorScheme.onPrimary,
63+
disabledContainerColor = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.12f),
64+
disabledContentColor = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.38f),
6265
),
6366
content: @Composable RowScope.() -> Unit = {},
6467
) {

feature/center/src/commonMain/kotlin/com/mifos/feature/center/createCenter/CreateNewCenterScreen.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,16 +237,18 @@ private fun CreateNewCenterContent(
237237
value = centerName,
238238
onValueChange = { centerName = it },
239239
label = stringResource(Res.string.feature_center_center_name),
240-
error = null,
240+
error = centerNameValidator,
241241
)
242242

243243
MifosTextFieldDropdown(
244244
value = selectedOffice,
245245
onValueChanged = {
246246
selectedOffice = it
247+
selectedOfficeValidator = null
247248
},
248249
onOptionSelected = { index, value ->
249250
selectedOffice = value
251+
selectedOfficeValidator = null
250252
offices[index].id.let {
251253
officeId = it
252254
}
@@ -299,6 +301,7 @@ private fun CreateNewCenterContent(
299301
)
300302
}
301303
},
304+
enabled = validateAllFields(),
302305
modifier = Modifier
303306
.fillMaxWidth()
304307
.heightIn(44.dp)

0 commit comments

Comments
 (0)