Skip to content

Commit

Permalink
[FEATURE]#217 : 프로필 수정시 로딩 중 버튼 비활성화 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
jeongjaino committed Jan 17, 2025
1 parent 3ab20b1 commit 0306dbd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -239,15 +239,11 @@ fun ProfileEditScreen(
) {
ListBottomGradient(height = 124)

val isEdited = state.isEditedState()
WSButton(
onClick = {
action(ProfileEditAction.OnProfileEditDoneButtonClicked)
},
enabled =
isEdited &&
state.hasProfanity.not() &&
state.introductionInput.length in 0..20,
enabled = state.isEditedProfile() && state.isValidIntroduce() && state.isLoading.not(),
text = stringResource(id = R.string.edit_done),
content = { it() },
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ data class ProfileEditUiState(
val profilePath: String? = null,
val changeBottomSheet: Boolean = false,
) {
fun isEditedState() = profile.introduction != introductionInput || profilePath != profile.profileCharacter.iconUrl
fun isEditedProfile() = profile.introduction != introductionInput || profilePath != profile.profileCharacter.iconUrl

fun isValidIntroduce() = hasProfanity.not() && introductionInput.length in 0..20
}

0 comments on commit 0306dbd

Please sign in to comment.