@@ -51,6 +51,7 @@ fun NoostakTextField(
51
51
focusedBorderColor : Color = NoostakTheme .colors.blue600,
52
52
unfocusedWithInputBorderColor : Color = NoostakTheme .colors.gray700,
53
53
unfocusedBorderColor : Color = NoostakTheme .colors.gray500,
54
+ errorBorderColor : Color = NoostakTheme .colors.red02,
54
55
maxLength : Int = 30,
55
56
modifier : Modifier = Modifier ,
56
57
visualTransformation : VisualTransformation = VisualTransformation .None ,
@@ -61,6 +62,7 @@ fun NoostakTextField(
61
62
var hasInvalidInput by remember { mutableStateOf(false ) }
62
63
63
64
val validInputRegex = " ^[a-zA-Z0-9가-힣]*$" .toRegex()
65
+ val isEmptyError = textFieldType == TextFieldType .EDITPROFILE && value.isBlank()
64
66
65
67
Column {
66
68
Box (
@@ -69,7 +71,8 @@ fun NoostakTextField(
69
71
.border(
70
72
width = 1 .dp,
71
73
color = when {
72
- hasInvalidInput -> NoostakTheme .colors.red02
74
+ isEmptyError -> errorBorderColor
75
+ hasInvalidInput -> errorBorderColor
73
76
isFocused -> focusedBorderColor // 포커스된 경우
74
77
value.isNotEmpty() -> unfocusedWithInputBorderColor // 텍스트가 입력되고 포커스 안된 경우
75
78
else -> unfocusedBorderColor // 포커스되지 않은 경우
@@ -84,7 +87,7 @@ fun NoostakTextField(
84
87
value = value,
85
88
textStyle = textStyle,
86
89
onValueChange = { newValue ->
87
- if (textFieldType != TextFieldType .SIGNUP ) {
90
+ if (textFieldType != TextFieldType .SIGNUP && textFieldType != TextFieldType . EDITPROFILE ) {
88
91
if (newValue.replace(" " , " " ).length <= maxLength) {
89
92
onValueChange(newValue)
90
93
}
@@ -148,14 +151,36 @@ fun NoostakTextField(
148
151
) {
149
152
if (textFieldType == TextFieldType .SIGNUP && hasInvalidInput) {
150
153
Text (
151
- text = stringResource(R .string.text_noostak_text_field_sign_up_condition ),
154
+ text = stringResource(R .string.text_noostak_text_field_condition ),
152
155
color = NoostakTheme .colors.red02,
153
156
style = NoostakTheme .typography.c3SemiBold,
154
157
modifier = modifier.padding(top = 6 .dp),
155
158
maxLines = 1
156
159
)
157
160
}
158
161
162
+ if (textFieldType == TextFieldType .EDITPROFILE ) {
163
+ when {
164
+ value.isBlank() ->
165
+ Text (
166
+ text = stringResource(R .string.text_noostak_text_field_edit_profile_empty),
167
+ color = NoostakTheme .colors.red02,
168
+ style = NoostakTheme .typography.c3SemiBold,
169
+ modifier = modifier.padding(top = 6 .dp),
170
+ maxLines = 1
171
+ )
172
+
173
+ hasInvalidInput ->
174
+ Text (
175
+ text = stringResource(R .string.text_noostak_text_field_condition),
176
+ color = NoostakTheme .colors.red02,
177
+ style = NoostakTheme .typography.c3SemiBold,
178
+ modifier = modifier.padding(top = 6 .dp),
179
+ maxLines = 1
180
+ )
181
+ }
182
+ }
183
+
159
184
Spacer (modifier = Modifier .weight(1f ))
160
185
Text (
161
186
text = stringResource(
0 commit comments