Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

๐Ÿš€ 3๋‹จ๊ณ„ - ํšŒ์›๊ฐ€์ž…(์œ ํšจ์„ฑ ๊ฒ€์‚ฌ) #92

Open
wants to merge 14 commits into
base: hyunjung-choi
Choose a base branch
from

Conversation

hyunjung-choi
Copy link

@hyunjung-choi hyunjung-choi commented Sep 6, 2024

๐Ÿš€ 3๋‹จ๊ณ„ - ํšŒ์›๊ฐ€์ž…(์œ ํšจ์„ฑ ๊ฒ€์‚ฌ)

โœ… ๊ตฌํ˜„ํ•  ๊ธฐ๋Šฅ ๋ชฉ๋ก

  • 2๋‹จ๊ณ„ ํ”ผ๋“œ๋ฐฑ ๋ฐ˜์˜
  • ์—๋Ÿฌ ๋ฉ”์‹œ์ง€ ์ถ”๊ฐ€
  • SignupTextField ๋ถ„๋ฆฌ
    • UsernameTextField
    • EmailTextField
    • PasswordTextField
  • Username ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ
  • Email ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ
  • Password ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ
  • Password Confirm ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ
  • UI ํ…Œ์ŠคํŠธ ์ž‘์„ฑ
    • UsernameTextField
    • EmailTextField
    • PasswordTextField

๐Ÿ™Œ ํ”ผ๋“œ๋ฐฑ

  • ์ปดํฌ๋„ŒํŠธ ๋‹จ์œ„๋กœ ํ…Œ์ŠคํŠธ ํŒŒ์ผ ๋ถ„๋ฆฌ
  • mutableStateOf ๋Œ€์‹  setContent ํ™œ์šฉ
  • ์žฌํ™œ์šฉ ๊ฐ€๋Šฅํ•œ ์ปดํฌ๋„ŒํŠธ ๋งŒ๋“ค๊ธฐ
  • Regex ๊ฐ์ฒด๋Š” ์ƒ์„ฑ ๋น„์šฉ์ด ๋†’๋‹ค โ†’ ํ•œ ๋ฒˆ๋งŒ ์ƒ์„ฑํ•˜๊ณ  ์žฌํ™œ์šฉ
  • TextField ๊ตฌํ˜„์ฒด๊ฐ€ ํ…์ŠคํŠธ๋ฅผ ๋‹ค๋ฃจ๋Š” ๋ฐฉ๋ฒ• ํ•™์Šต ํ›„ ์ ์šฉ

์ปดํฌ์ฆˆ๋„ ์ฒ˜์Œ, ํ…Œ์ŠคํŠธ ์ฝ”๋“œ๋„ ์ฒ˜์Œ์ด๋ผ์„œ ๋„ˆ๋ฌด๋„ˆ๋ฌด ์–ด๋ ต๋„ค์š”..๐Ÿ˜ญ
์•„์ง ๋‹ค ๊ตฌํ˜„ํ•˜์ง€๋Š” ๋ชปํ–ˆ์ง€๋งŒ, ํ”ผ๋“œ๋ฐฑ ๋ถ€ํƒ ๋“œ๋ฆฝ๋‹ˆ๋‹ค!

Copy link
Member

@malibinYun malibinYun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3๋‹จ๊ณ„ ๋ฏธ์…˜ ๊ณ ์ƒ ๋งŽ์œผ์…จ์–ด์š”!
ํฌ๊ธฐํ•˜์ง€ ์•Š๊ณ  ๋๊นŒ์ง€ ๋ฏธ์…˜ ์ง„ํ–‰ํ•˜์‹œ๋Š” ๋ชจ์Šต์ด ๋น›๋‚˜์š” ๐Ÿ˜€
์—ฌ๋Ÿฌ ์ฝ”๋ฉ˜ํŠธ ๋‚จ๊ฒจ๋‘์—ˆ์œผ๋‹ˆ ํ™•์ธํ•ด์ฃผ์„ธ์š”!
์•„์ง ๊ตฌํ˜„ํ•˜์ง€ ๋ชปํ•œ ๊ฒƒ๋“ค๊ณผ ํ”ผ๋“œ๋ฐฑ ๋ฐ˜์˜ ํ›„ ๋‹ค์‹œ ๋ฆฌ๋ทฐ ์š”์ฒญ ๋ถ€ํƒ๋“œ๋ ค์š” :)

Comment on lines +18 to +20
val composeTestRule = createComposeRule()
private val username = mutableStateOf("")
private val email = mutableStateOf("")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mutableStateOf๋ฅผ ํ™œ์šฉํ•ด์„œ ์ปดํฌ๋„ŒํŠธ์˜ ๊ฐ’์„ ๋ณ€๊ฒฝํ•ด์ฃผ๊ธฐ๋ณด๋‹ค,
๋งค ํ…Œ์ŠคํŠธ๋งˆ๋‹ค ์ƒˆ ์ปดํฌ๋„ŒํŠธ๋ฅผ setContentํ•ด์„œ, ๊ฑฐ๊ธฐ์— ํ•„์š”ํ•œ ๊ฐ’์„ ์ง์ ‘ ๋„ฃ์–ด์ฃผ๋Š” ํ˜•ํƒœ๋Š” ์–ด๋–จ๊นŒ์š”?

Comment on lines +41 to +64
TextField(
value = email.value,
onValueChange = {
email.value = it
isError = it.isNotEmpty() && !it.matches(Regex(EMAIL_REGEX))
},
isError = isError,
label = {
Text(text = stringResource(id = R.string.signup_email))
},
modifier = Modifier
.fillMaxWidth(1.0F)
.testTag("emailTextField"),
singleLine = true,
keyboardOptions = KeyboardOptions(
autoCorrect = false,
keyboardType = KeyboardType.Email
),
keyboardActions = KeyboardActions(
onDone = {
focusManager.moveFocus(FocusDirection.Next)
}
)
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ด์ „ ๋ฏธ์…˜์— TextFieldComponent ์ฒ˜๋Ÿผ ์žฌํ™œ์šฉ ๊ฐ€๋Šฅํ•œ ์ปดํฌ๋„ŒํŠธ๋ฅผ ๋งŒ๋“ค์—ˆ๋“ฏ์ด,
์ด ์ปดํฌ๋„ŒํŠธ ๋‚ด์—๋„ ์žฌํ™œ์šฉ ๊ฐ€๋Šฅํ•œ ์ปดํฌ๋„ŒํŠธ๋ฅผ ํ™œ์šฉํ•ด์„œ ์ด๋ฉ”์ผ ๋“ฑ์˜ ๊ธฐ๋Šฅ์„ ์ถ”๊ฐ€ํ•ด๋ณด๋Š” ๊ฑด ์–ด๋–จ๊นŒ์š”?

Comment on lines +45 to +46
isError = it.isNotEmpty() && !it.matches(Regex(EMAIL_REGEX))
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regex๊ฐ์ฒด๋Š” ์ƒ์„ฑ ๋น„์šฉ์ด ๋†’์œผ๋‹ˆ, ํ•œ ๋ฒˆ๋งŒ ์ƒ์„ฑํ•˜๊ณ  ์žฌํ™œ์šฉํ•ด๋ณด๋Š” ๊ฑด ์–ด๋–จ๊นŒ์š”?

Comment on lines +31 to +33

@Composable
fun EmailTextField(email: MutableState<String>) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋จธํ„ฐ๋ฆฌ์–ผ์˜ TextField์˜ ๊ตฌํ˜„์ฒด๋Š” ์–ด๋–ป๊ฒŒ ํ…์ŠคํŠธ๋ฅผ ์ฃผ๊ณ  ๋ฐ›๋Š”์ง€ ์ฐธ๊ณ ํ•˜์…”์„œ ๋ฐ˜์˜ํ•ด๋ณด์…”๋„ ์ข‹๊ฒ ์–ด์š” :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants