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/email page #28

Merged
merged 17 commits into from
Jun 1, 2022
Merged

Feature/email page #28

merged 17 commits into from
Jun 1, 2022

Conversation

Jeong-jeong
Copy link
Contributor

@Jeong-jeong Jeong-jeong commented May 30, 2022

๐Ÿง‘โ€๐Ÿ’ป PR ๋‚ด์šฉ

๐Ÿง ๋…ผ์˜

  • width๋ฅผ 100%๋กœ ์„ค์ •ํ•ด๋†จ๋Š”๋ฐ ๊ณ ์ •๋œ ๊ฐ’์œผ๋กœ ํ•ด์•ผ๋ ์ง€ ๊ถ๊ธˆํ•ฉ๋‹ˆ๋‹ค.

๐Ÿ“ธ ์Šคํฌ๋ฆฐ์ƒท

@Jeong-jeong Jeong-jeong self-assigned this Jun 1, 2022
@Jeong-jeong Jeong-jeong added the Feat ์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ ์ถ”๊ฐ€ label Jun 1, 2022
Comment on lines +43 to +45
useEffect(() => {
if (email) handleCountdown();
}, [email]);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

email ๊ฐ’์ด ์žˆ์„ ๋•Œ๋งŒ countdown์ด ์‹คํ–‰๋˜๋„๋ก ๊ตฌํ˜„ํ–ˆ์Šต๋‹ˆ๋‹ค

Comment on lines 50 to 52
<Input name="authCode" placeholder="์ธ์ฆ๋ฒˆํ˜ธ" maxLength={8} onChange={handleChange} />
{errors.email && <ErrorMessage>{errors.email}</ErrorMessage>}
<StyledButton disabled={!!errors.authCode}>ํ™•์ธ</StyledButton>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

์—๋Ÿฌ ๋ฉ”์„ธ์ง€ ๊ด€ํ•œ ์‹œ์•ˆ์ด ์•„์ง ์—†์–ด์„œ ์ž„์‹œ๋กœ ๋„ฃ์–ด๋‘์—ˆ์Šต๋‹ˆ๋‹ค

}
}, []);
// FIXME: ref ๊ณ ์น˜๊ธฐ
return <InputStyled ref={ref} {...rest} height={height} width={width} focusColor={focusColor} isFocus={isFocus} />;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ref ํƒ€์ž… ์—๋Ÿฌ๊ฐ€ ๋‚˜๋Š”๋ฐ ์›์ธ์„ ๋ชจ๋ฅด๊ฒ ์–ด์„œใ… ใ…  ์‹œ๊ฐ„๋‚  ๋•Œ ํ™•์ธ ๊ฐ€๋Šฅํ•˜์‹œ๋ฉด ๊ฐ์‚ฌํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค

Copy link
Member

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>
๋กœ ํ•˜๋ฉด ์—๋Ÿฌ ์‚ฌ๋ผ์ง‘๋‹ˆ๋‹ค!

Copy link
Member

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 ์ชฝ์œผ๋กœ ์˜ค์‹œ๋ฉด

Copy link
Contributor Author

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);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

disable๊ณผ canMoveNext ์ด๋ฆ„์ด ์ƒ์ถฉํ•ด cant๋กœ ๋ณ€๊ฒฝํ•˜์˜€์Šต๋‹ˆ๋‹ค. ๋” ์ข‹์€ ์•„์ด๋””์–ด ์žˆ์œผ๋ฉด ์ˆ˜์ •ํ•ด์ฃผ์„ธ์š”!

@Jeong-jeong Jeong-jeong marked this pull request as ready for review June 1, 2022 06:41
Copy link
Member

@choisohyun choisohyun left a comment

Choose a reason for hiding this comment

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

์ˆ˜๊ณ ๋งŽ์œผ์…จ์Šต๋‹ˆ๋‹ค!

authCode?: string;
}

interface useFormProps {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
interface useFormProps {
interface UseFormProps {

์ผ€์ด์Šค ์˜คํƒ€์ธ๊ฒƒ ๊ฐ™์•„์š”!

validate: (arg: InitialValues) => InitialValues;
}

const useForm = ({ initialValues, onSubmit, validate }: useFormProps) => {
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
Member

@leejiho9898 leejiho9898 left a 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;
Copy link
Member

Choose a reason for hiding this comment

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

useform์— onSubmit๊นŒ์ง€ ๋‹ฌ๋ ค์žˆ๋Š”๊ฑฐ๋Š” ์ฒ˜์Œ ๋ดค๋Š”๋ฐ ์ข‹์€๊ฑฐ๊ฐ™์•„์š” ๋ฐฐ์šฐ๊ณ  ๊ฐ‘๋‹ˆ๋‹ค ใ…Žใ…Ž

}
}, []);
// FIXME: ref ๊ณ ์น˜๊ธฐ
return <InputStyled ref={ref} {...rest} height={height} width={width} focusColor={focusColor} isFocus={isFocus} />;
Copy link
Member

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>
๋กœ ํ•˜๋ฉด ์—๋Ÿฌ ์‚ฌ๋ผ์ง‘๋‹ˆ๋‹ค!

}
}, []);
// FIXME: ref ๊ณ ์น˜๊ธฐ
return <InputStyled ref={ref} {...rest} height={height} width={width} focusColor={focusColor} isFocus={isFocus} />;
Copy link
Member

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 ์ชฝ์œผ๋กœ ์˜ค์‹œ๋ฉด

Comment on lines 38 to 45
useEffect(() => {
if (emailInputRef.current) emailInputRef.current.focus();
}, []);

return (
<form onSubmit={handleSubmit}>
<InputsWrapper>
<Input name="email" placeholder="์ด๋ฉ”์ผ" maxLength={50} onChange={handleChange} ref={emailInputRef} />
Copy link
Member

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 />


return (
<SurveyTemplate disableNext={canMoveNext} hasProgressBar={false}>
<Button onClick={() => setCanMoveNext((prev) => !prev)}>ํด๋ฆญ</Button>
<SurveyTemplate disableNext={cantMoveNext} currStep={3} totalStep={10}>
Copy link
Member

Choose a reason for hiding this comment

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

์ง€์˜๋‹˜ ์ธ์ฆ๋ฉ”์ผ ์ชฝ์€ hasProgressBar={false} ๋„˜๊ฒจ์ฃผ์‹œ๋ฉด ํ”„๋กœ๊ทธ๋ž˜์Šค๋ฐ” ์•ˆ๋‚˜์˜ฌ๊ฑฐ์—์š”!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feat ์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ ์ถ”๊ฐ€
Projects
Development

Successfully merging this pull request may close these issues.

Feat: ํ•™๊ต ์ธ์ฆ ํŽ˜์ด์ง€ ๊ตฌํ˜„
3 participants