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

Feature/signup kkm #69

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions components/signup/SignupForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import LocalStorage from "../../core/localStorage";
import { IcSignupChecking } from "../../public/assets/icons";
import { UseFormDataType } from "../../types/signup";
import { errorPatterns } from "../../util/check";
import referralLinkLIst from "../../util/referralLinkList";
import { AlertLabel } from "../common";
import { DefaultButton } from "../common/styled/Button";
import { Input } from "../common/styled/Input";
Expand Down Expand Up @@ -35,10 +36,14 @@ export default function SignupForm(props: SignupFormProps) {
</>
);

const linkOfCondition = referralLinkLIst[0].href;
Copy link
Member

Choose a reason for hiding this comment

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

μ•„ ~~~ λ³€μˆ˜ 생성 μ’‹λ„€μš”! !!

Copy link
Contributor

Choose a reason for hiding this comment

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

μ•„ ~~~ λ³€μˆ˜ 생성 μ’‹λ„€μš”! !!


const AgreeConditionBox = (
<StAgreeConditionBox htmlFor="signupAgree" onClick={onToggleIsAgreeCondition}>
<StIcSignupChecking isagree={isAgree} />
<p>κ°œμΈμ •λ³΄ μˆ˜μ§‘ 및 이용 약관에 λ™μ˜ν•©λ‹ˆλ‹€.</p>
<a href={linkOfCondition} target="_blank" rel="noopener noreferrer">
κ°œμΈμ •λ³΄ μˆ˜μ§‘ 및 이용 약관에 λ™μ˜ν•©λ‹ˆλ‹€.
</a>
</StAgreeConditionBox>
);

Expand All @@ -54,7 +59,7 @@ export default function SignupForm(props: SignupFormProps) {

{keyIndex === "email" && AgreeConditionBox}

<StNextStepBtn disabled={!isDirty} type="submit">
<StNextStepBtn disabled={!isDirty || !isAgree} type="submit">
λ‹€μŒ 계단
</StNextStepBtn>
</>
Expand Down Expand Up @@ -87,6 +92,10 @@ const StAgreeConditionBox = styled.label`

margin: 1.7rem 0 0 0;

& > a {
text-decoration: underline;
}
Comment on lines +93 to +95
Copy link
Contributor

Choose a reason for hiding this comment

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

μ œκ°€ ν”Όκ·Έλ§ˆλ₯Ό ν™•μΈν•˜μ§€λŠ” λͺ»ν–ˆλŠ”데, ν˜Ήμ‹œ 이 ν‘œμ‹œκ°€ κ°œμΈμ •λ³΄ μˆ˜μ§‘ 및 이용 약관에 λ™μ˜ν•©λ‹ˆλ‹€. 전체가 μ•„λ‹Œ κ°œμΈμ •λ³΄ μˆ˜μ§‘ 및 이용 μ•½κ΄€μ—λ§Œ ν•΄λ‹Ήλ˜λŠ” 것은 μ•„λ‹Œκ°€μš₯?


${({ theme }) => theme.fonts.body6}
`;

Expand Down
28 changes: 10 additions & 18 deletions pages/signup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,25 +112,17 @@ export default function Signup() {
setError("password", { type: "server", message: "λΉ„λ°€λ²ˆν˜Έκ°€ μΌμΉ˜ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€." });
}
} else {
// 이메일 μž…λ ₯μ‹œ κ°œμΈμ •λ³΄ μ·¨κΈ‰ λ°©μΉ¨ λ™μ˜λ₯Ό λ¨Όμ € μœ λ„
if (formDataKeyIndex === "email" && !isAgreeCondition) {
setError(formDataKeyIndex, {
type: "agreeCondition",
message: "κ°œμΈμ •λ³΄ μˆ˜μ§‘ 및 이용 약관에 λ™μ˜ν•΄μ£Όμ‹œκΈ° λ°”λžλ‹ˆλ‹€.",
});
} 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 });
// μ„œλ²„λ‘œ 데이터λ₯Ό λ³΄λ‚΄μ„œ μœ νš¨μ„± 검사
// 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 });
Copy link
Member

Choose a reason for hiding this comment

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

(μ œμ•ˆ) 저희 "email", "server" string을 const μƒμˆ˜λ‘œ ν‘œν˜„ν•¨μ€ μ–΄λ–¨κΉŒμš”??

Copy link
Contributor

Choose a reason for hiding this comment

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

μœ λ‹ˆμ˜¨ νƒ€μž…μœΌλ‘œ μ •μ˜ν•΄λ‘λŠ” 것도 쒋닀ꡬ μƒκ°ν•©λ‹ˆλ‹Ή~

Copy link
Member

@joohaem joohaem Jan 31, 2023

Choose a reason for hiding this comment

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

(ꢌμž₯) else ꡬ문을 μ΅œλŒ€ν•œ ν”Όν•΄μ•Ό 가독성이 쒋아진닀고 μƒκ°ν•΄μš”

!isValid 둜 μ—λŸ¬ 처리λ₯Ό ν•œ 후에 return μ‹œν‚€κ³ , κ·Έ μ•„λž˜μ— λ‘œμ§μ„ ꡬ성함은 μ–΄λ–¨κΉŒμš”??

}
}
};
Expand Down