-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/signup kkm #69
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
base: develop
Are you sure you want to change the base?
Changes from 1 commit
172015d
debe830
18b0881
837cafe
ecbc132
ecf7fd8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,13 +78,13 @@ export default function Signup() { | |
}; | ||
|
||
// λ€μ λ¨κ³λ‘ μ΄λνλ ν¨μ | ||
const setNextStep = (key: string) => { | ||
const setNextStep = (inputValue: string) => { | ||
setUserData((current) => { | ||
const formData = { ...current }; | ||
const userData = { ...current }; | ||
|
||
formData[formDataKeyIndex] = key; | ||
userData[formDataKeyIndex] = inputValue; | ||
|
||
return formData; | ||
return userData; | ||
}); | ||
|
||
setFormDataKeyIndex((current) => { | ||
|
@@ -97,34 +97,41 @@ export default function Signup() { | |
return "submit"; | ||
}); | ||
|
||
setValue(formDataKeyIndex, ""); | ||
setValue(formDataKeyIndex, "", { shouldDirty: true }); | ||
}; | ||
|
||
// νΌ μ μΆ μλ¬κ° μλμ§ νμΈ | ||
const submitForm = async (loginFormData: UseFormDataType) => { | ||
const key = loginFormData[formDataKeyIndex]; | ||
const inputValue = loginFormData[formDataKeyIndex]; | ||
|
||
console.log(inputValue); | ||
|
||
// λΉλ°λ²νΈ μ λ ₯κΉμ§ λ§μΉλ©΄ μλ λ‘κ·ΈμΈ | ||
if (formDataKeyIndex === "password") { | ||
if (loginFormData["password"] === loginFormData["password2"]) { | ||
autoLoginAfterSignup(key); | ||
} else { | ||
setError("password", { type: "server", message: "λΉλ°λ²νΈκ° μΌμΉνμ§ μμ΅λλ€." }); | ||
autoLoginAfterSignup(inputValue); | ||
|
||
return; | ||
} | ||
} else { | ||
// μλ²λ‘ λ°μ΄ν°λ₯Ό 보λ΄μ μ ν¨μ± κ²μ¬ | ||
// return: μ ν¨νμ§(isValid) && μλ¬ λ©μμ§(message) | ||
const { isValid, message } = await checkIsValid(formDataKeyIndex, key); | ||
|
||
if (isValid) { | ||
setNextStep(key); | ||
if (formDataKeyIndex === "email") { | ||
LocalStorage.setItem("booktez-email", loginFormData["email"]); | ||
} | ||
} else { | ||
setError(formDataKeyIndex, { type: "server", message }); | ||
setError("password", { type: "server", message: "λΉλ°λ²νΈκ° μΌμΉνμ§ μμ΅λλ€." }); | ||
|
||
return; | ||
} | ||
|
||
// μλ²λ‘ λ°μ΄ν°λ₯Ό 보λ΄μ μ ν¨μ± κ²μ¬ | ||
// return: μ ν¨νμ§(isValid) && μλ¬ λ©μμ§(message) | ||
const { isValid, message } = await checkIsValid(formDataKeyIndex, inputValue); | ||
|
||
if (isValid) { | ||
setNextStep(inputValue); | ||
|
||
if (formDataKeyIndex === "email") { | ||
LocalStorage.setItem("booktez-email", loginFormData["email"]); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. λ‘컬μ€ν λ¦¬μ§ ν€λ₯Ό μμλ νμ μΌλ‘ μ μν΄λλ©΄ (λμ€μ μ½λλ₯Ό κ³ μΉ λκ΅°κ°κ° νΈν΄μ§ κ² κ°μμ)μ’μ κ² κ°λ€λ μκ°μ΄ λλλ°, νμλ μλλλΉ(κ·Όλ° ν΄μ£Όλ©΄ μ’μ κ² κ°μ λλμ λ) |
||
} | ||
|
||
return; | ||
} | ||
setError(formDataKeyIndex, { type: "server", message }); | ||
Comment on lines
+123
to
+132
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. μνΈ μ΄λ κ² λμκ΅°μ!! |
||
}; | ||
|
||
const handleToggleIsAgreeCondition = () => { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ππ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ππππ