-
Notifications
You must be signed in to change notification settings - Fork 1
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/email page #28
Conversation
โฆfeature/email-page
useEffect(() => { | ||
if (email) handleCountdown(); | ||
}, [email]); |
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.
email ๊ฐ์ด ์์ ๋๋ง countdown์ด ์คํ๋๋๋ก ๊ตฌํํ์ต๋๋ค
<Input name="authCode" placeholder="์ธ์ฆ๋ฒํธ" maxLength={8} onChange={handleChange} /> | ||
{errors.email && <ErrorMessage>{errors.email}</ErrorMessage>} | ||
<StyledButton disabled={!!errors.authCode}>ํ์ธ</StyledButton> |
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.
์๋ฌ ๋ฉ์ธ์ง ๊ดํ ์์์ด ์์ง ์์ด์ ์์๋ก ๋ฃ์ด๋์์ต๋๋ค
src/components/base/Input.tsx
Outdated
} | ||
}, []); | ||
// FIXME: ref ๊ณ ์น๊ธฐ | ||
return <InputStyled ref={ref} {...rest} height={height} width={width} focusColor={focusColor} isFocus={isFocus} />; |
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.
ref ํ์ ์๋ฌ๊ฐ ๋๋๋ฐ ์์ธ์ ๋ชจ๋ฅด๊ฒ ์ด์ใ ใ ์๊ฐ๋ ๋ ํ์ธ ๊ฐ๋ฅํ์๋ฉด ๊ฐ์ฌํ๊ฒ ์ต๋๋ค
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.
25๋ฒ์งธ์ค ref์ ํ์
์
ref: React.ForwardedRef<HTMLInputElement>
๋ก ํ๋ฉด ์๋ฌ ์ฌ๋ผ์ง๋๋ค!
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.
์๋ ํฌ์ปค์ค ๋๋ฌธ์ ๊ณ ๋ฏผ์ด์๋ฉด ์ ๊ฐ ์ด๋ฏธ ๊ตฌํํด๋๊ฑฐ๋ผ ๋ ์ฝ๊ฒ ๊ฐ๋ฅ ํ ๊ฑฐ ๊ฐ์์!
ref={ref} ๋ฅผ ref={inputRef} ๋ก ํ์๋ฉด ๋ฐ๋ก ref๋ฅผ ๋ฐ์ ํ์๊ฐ ์์ด์ 25๋ฒ์งธ ์ค์ด ํต์ผ๋ก ์์ด์ง๊ณ ,
30 ๋ฒ์งธ์ค if๋ฌธ์
if (inputRef.current && isFocus === true ) inputRef.current.focus();
์ด๋ ๊ฒ ํ์ ๋ค์ EamilForm ์ชฝ์ผ๋ก ์ค์๋ฉด
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.
@leejiho9898 ์ฐ์ ๊ฐ์ฌํฉ๋๋ค!!!!
|
||
const AuthMail = () => { | ||
const [canMoveNext, setCanMoveNext] = useState(true); | ||
const [cantMoveNext, setCantMoveNext] = useState(true); |
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.
disable๊ณผ canMoveNext ์ด๋ฆ์ด ์์ถฉํด cant๋ก ๋ณ๊ฒฝํ์์ต๋๋ค. ๋ ์ข์ ์์ด๋์ด ์์ผ๋ฉด ์์ ํด์ฃผ์ธ์!
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.
์๊ณ ๋ง์ผ์ จ์ต๋๋ค!
src/hooks/common/useForm.ts
Outdated
authCode?: string; | ||
} | ||
|
||
interface useFormProps { |
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.
interface useFormProps { | |
interface UseFormProps { |
์ผ์ด์ค ์คํ์ธ๊ฒ ๊ฐ์์!
src/hooks/common/useForm.ts
Outdated
validate: (arg: InitialValues) => InitialValues; | ||
} | ||
|
||
const useForm = ({ initialValues, onSubmit, validate }: useFormProps) => { |
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.
๋ช๊ฐ์ง ๊ตฌํํ ๊ธฐ๋ฅ์ด ์ค๋ณต๋๋๊ฑฐ ๊ฐ์์ ์ด๊ฒ๋ง ์์ ํด์ฃผ์๋ฉด ์ข์๊ฑฐ ๊ฐ์์!
|
||
interface useFormProps { | ||
initialValues: InitialValues; | ||
onSubmit: () => void; |
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.
useform์ onSubmit๊น์ง ๋ฌ๋ ค์๋๊ฑฐ๋ ์ฒ์ ๋ดค๋๋ฐ ์ข์๊ฑฐ๊ฐ์์ ๋ฐฐ์ฐ๊ณ ๊ฐ๋๋ค ใ ใ
src/components/base/Input.tsx
Outdated
} | ||
}, []); | ||
// FIXME: ref ๊ณ ์น๊ธฐ | ||
return <InputStyled ref={ref} {...rest} height={height} width={width} focusColor={focusColor} isFocus={isFocus} />; |
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.
25๋ฒ์งธ์ค ref์ ํ์
์
ref: React.ForwardedRef<HTMLInputElement>
๋ก ํ๋ฉด ์๋ฌ ์ฌ๋ผ์ง๋๋ค!
src/components/base/Input.tsx
Outdated
} | ||
}, []); | ||
// FIXME: ref ๊ณ ์น๊ธฐ | ||
return <InputStyled ref={ref} {...rest} height={height} width={width} focusColor={focusColor} isFocus={isFocus} />; |
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.
์๋ ํฌ์ปค์ค ๋๋ฌธ์ ๊ณ ๋ฏผ์ด์๋ฉด ์ ๊ฐ ์ด๋ฏธ ๊ตฌํํด๋๊ฑฐ๋ผ ๋ ์ฝ๊ฒ ๊ฐ๋ฅ ํ ๊ฑฐ ๊ฐ์์!
ref={ref} ๋ฅผ ref={inputRef} ๋ก ํ์๋ฉด ๋ฐ๋ก ref๋ฅผ ๋ฐ์ ํ์๊ฐ ์์ด์ 25๋ฒ์งธ ์ค์ด ํต์ผ๋ก ์์ด์ง๊ณ ,
30 ๋ฒ์งธ์ค if๋ฌธ์
if (inputRef.current && isFocus === true ) inputRef.current.focus();
์ด๋ ๊ฒ ํ์ ๋ค์ EamilForm ์ชฝ์ผ๋ก ์ค์๋ฉด
useEffect(() => { | ||
if (emailInputRef.current) emailInputRef.current.focus(); | ||
}, []); | ||
|
||
return ( | ||
<form onSubmit={handleSubmit}> | ||
<InputsWrapper> | ||
<Input name="email" placeholder="์ด๋ฉ์ผ" maxLength={50} onChange={handleChange} ref={emailInputRef} /> |
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.
์ ๊ฐ input ์ปดํฌ๋ํธ์ focus ์์ฑ์ ๋ฃ์ด๋จ์ด์ ๊ทธ๋์ ๋ฐ๋ก ์๋ง๋์๊ณ ๋ฐ๋ก isFocus๋ง ๋ฃ์ด์ฃผ์๋ฉด ๋ฉ๋๋ค.
<Input name="email" placeholder="์ด๋ฉ์ผ" maxLength={50} onChange={handleChange} isFocus />
src/pages/AuthMail.tsx
Outdated
|
||
return ( | ||
<SurveyTemplate disableNext={canMoveNext} hasProgressBar={false}> | ||
<Button onClick={() => setCanMoveNext((prev) => !prev)}>ํด๋ฆญ</Button> | ||
<SurveyTemplate disableNext={cantMoveNext} currStep={3} totalStep={10}> |
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.
์ง์๋ ์ธ์ฆ๋ฉ์ผ ์ชฝ์ hasProgressBar={false} ๋๊ฒจ์ฃผ์๋ฉด ํ๋ก๊ทธ๋์ค๋ฐ ์๋์ฌ๊ฑฐ์์!
๐งโ๐ป PR ๋ด์ฉ
Closes Feat: ํ๊ต ์ธ์ฆ ํ์ด์ง ๊ตฌํย #26
์์ฑํ์ง ์์์ ๋
ํ์์ด ์ ๋ง์ ๋
์ด๋ฉ์ผ ํ์์ด ๋ง์ ๋ && ์ธ์ฆ๋ฒํธ ๋ณด๋ด๊ธฐ submit
์ธ์ฆ๋ฒํธ submit ์ฑ๊ณต์
๐ง ๋ ผ์
๐ธ ์คํฌ๋ฆฐ์ท