Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
itsPronay committed Sep 19, 2024
1 parent a497252 commit 691deab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ fun ProfileScreenContent(
ProfileImage(bitmap = profileState.bitmapImage)

ProfileDetailsCard(
name = profileState.name ?: "Empty name",
email = profileState.email ?: "Empty email",
name = profileState.name ?: "",
email = profileState.email ?: "",
vpa = profileState.vpa ?: "",
mobile = profileState.mobile ?: "Empty mobile number",
mobile = profileState.mobile ?: "",
)

MifosButton(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,60 +318,6 @@ private fun EditProfileScreenContent(
)
}
}

/*
Box(
modifier = Modifier
.fillMaxWidth()
.padding(start = 16.dp, end = 16.dp),
) {
val keyboardController = LocalSoftwareKeyboardController.current
if (LocalInspectionMode.current) {
Text("Placeholder for TogiCountryCodePicker")
} else {
CountryCodePicker(
modifier = Modifier,
initialPhoneNumber = " ",
autoDetectCode = true,
shape = RoundedCornerShape(3.dp),
colors = OutlinedTextFieldDefaults.colors(
focusedBorderColor = MaterialTheme.colorScheme.onSurface,
),
onValueChange = { (code, phone), isValid ->
if (isValid) {
mobile = code + phone
}
},
label = { Text(stringResource(id = R.string.feature_profile_phone_number)) },
keyboardActions = KeyboardActions { keyboardController?.hide() },
)
}
}
EditProfileSaveButton(
onClick = {
if (isDataSaveNecessary(email, initialEmail)) {
updateEmail(email)
}
if (isDataSaveNecessary(mobile, initialMobile)) {
updateMobile(mobile)
}
if (updateSuccess) {
// if user details is successfully saved then go back to Profile Activity
// same behaviour as onBackPress, hence reused the callback
onBackClick.invoke()
} else {
Toast
.makeText(
context,
R.string.feature_profile_failed_to_save_changes,
Toast.LENGTH_SHORT,
).show()
}
},
buttonText = R.string.feature_profile_save,
)
*/
}

private fun isDataSaveNecessary(
Expand Down

0 comments on commit 691deab

Please sign in to comment.