Skip to content

Commit

Permalink
fix: textField 파라미터 타입 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
easyhz committed Jul 19, 2024
1 parent 27abcad commit cc0e90f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import com.easyhz.noffice.core.design_system.util.textField.getTextFieldState
@Composable
fun MainTextField(
modifier: Modifier = Modifier,
value: TextFieldValue,
onValueChange: (TextFieldValue) -> Unit,
value: String,
onValueChange: (String) -> Unit,
title: String?,
placeholder: String,
isFilled: Boolean,
Expand All @@ -32,7 +32,7 @@ fun MainTextField(
keyboardOptions: KeyboardOptions = KeyboardOptions.Default,
keyboardActions: KeyboardActions = KeyboardActions.Default,
) {
val state = getTextFieldState(text = value.text, isFilled = isFilled)
val state = getTextFieldState(text = value, isFilled = isFilled)

BasicTextField(
value = value,
Expand All @@ -57,7 +57,7 @@ fun MainTextField(
onClickIcon = {
onClickIcon()
},
textCount = value.text.length,
textCount = value.length,
maxCount = maxCount,
innerTextField = innerTextField
)
Expand All @@ -69,7 +69,7 @@ fun MainTextField(
@Composable
private fun MainTextFieldPrev() {
MainTextField(
value = TextFieldValue("내용이 잇음"),
value = "내용이 잇음",
onValueChange = { },
title = null,
placeholder = "내용으 입력",
Expand All @@ -83,7 +83,7 @@ private fun MainTextFieldPrev() {
@Composable
private fun MainTextFieldPlaceholderPrev() {
MainTextField(
value = TextFieldValue(""),
value = "",
onValueChange = { },
title = null,
placeholder = "내용dmf dlqfur 입력",
Expand All @@ -97,7 +97,7 @@ private fun MainTextFieldPlaceholderPrev() {
@Composable
private fun MainTextFieldTitlePrev() {
MainTextField(
value = TextFieldValue(""),
value = "",
onValueChange = { },
title = "내용",
placeholder = "내용dmf dlqfur 입력",
Expand All @@ -111,7 +111,7 @@ private fun MainTextFieldTitlePrev() {
@Composable
private fun MainTextFieldMaxCountPrev() {
MainTextField(
value = TextFieldValue(""),
value = "",
onValueChange = { },
title = null,
placeholder = "내용dmf dlqfur 입력",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ sealed class SignUpIntent: UiIntent() {
data object ClickTermsAllCheck: SignUpIntent()
data class ClickTermsCheck(val terms: Terms): SignUpIntent()
data class ClickTermsDetail(val terms: Terms): SignUpIntent()
data class ChangeNameTextValue(val text: TextFieldValue): SignUpIntent()
data class ChangeNameTextValue(val text: String): SignUpIntent()
data object ClearFocus: SignUpIntent()
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ data class SignUpState(
val enabledStepButton: EnumMap<SignUpStep, Boolean>,
val isCheckedAllTerms: Boolean,
val termsStatusMap: EnumMap<Terms, Boolean>,
val name: TextFieldValue,
val name: String,
) : UiState() {
companion object {
fun init() = SignUpState(
step = Step(currentStep = SignUpStep.TERMS, previousStep = null),
enabledStepButton = SignUpStep.entries.toEnabledStepButton(),
isCheckedAllTerms = false,
termsStatusMap = Terms.entries.toTermsMap(),
name = TextFieldValue("")
name = ""
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ class SignUpViewModel @Inject constructor(
reduce { updateTermsCheck(terms) }
}

private fun onChangeNameTextValue(newText: TextFieldValue) {
val isEnabledButton = newText.text.isNotBlank()
private fun onChangeNameTextValue(newText: String) {
val isEnabledButton = newText.isNotBlank()
reduce { copy(name = newText, enabledStepButton = enabledStepButton.updateStepButton(step.currentStep, isEnabledButton)) }
}

Expand Down

0 comments on commit cc0e90f

Please sign in to comment.