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/#19 SignIn page #49

Merged
merged 4 commits into from Feb 26, 2023
Merged

Feature/#19 SignIn page #49

merged 4 commits into from Feb 26, 2023

Conversation

StarryPro
Copy link
Collaborator

@StarryPro StarryPro commented Feb 24, 2023

๐Ÿ”— ISSUE NUMBER

๐Ÿ™Œ ๊ตฌํ˜„ ์‚ฌํ•ญ

  • SearchPassword component ๊ตฌํ˜„

๐Ÿ“ ๊ตฌํ˜„ ์„ค๋ช…

๋น„๋ฐ€๋ฒˆํ˜ธ ์ฐพ๊ธฐ ๊ธฐ๋Šฅ ๊ตฌํ˜„ (SearchPassword component)

function SearchPassword() {
  const { isOpen, toggle } = useModal();
  const { mutate } = useMutation(authService.getTempPassword);
  const onSubmit: SubmitHandler<Pick<UserInfo, 'email'>> = async (emailObj) => {
    const { email } = emailObj;
    mutate(email, {
      onSuccess(data) {
        if (data) {
          toast.success('์ž„์‹œ ๋น„๋ฐ€๋ฒˆํ˜ธ๊ฐ€ ๋ฐœ์†ก๋˜์—ˆ์Šต๋‹ˆ๋‹ค.');
        }
      },
    });
  };

  const {
    register,
    handleSubmit,
    formState: { errors },
  } = useForm<UserInfo>();

  return (
    <>
      <SSearchPw onClick={toggle}>๋น„๋ฐ€๋ฒˆํ˜ธ ์ฐพ๊ธฐ</SSearchPw>
      <Modal isOpen={isOpen} closeModal={toggle}>
        <Sform onSubmit={handleSubmit(onSubmit)}>
          <div>์ด๋ฉ”์ผ ์ฃผ์†Œ๋ฅผ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”</div>
          <SignInput
            id="email"
            type="email"
            placeholder="์ด๋ฉ”์ผ"
            errMessage="์ด๋ฉ”์ผ ํ˜•์‹์— ๋งž๊ฒŒ ์ž‘์„ฑํ•ด์ฃผ์„ธ์š”."
            pattern={EMAIL_REGEX}
            register={register}
            errors={errors}
            required
          />
          <Button styleType="neutral" size="small">
            ์ž„์‹œ ๋น„๋ฐ€๋ฒˆํ˜ธ ์š”์ฒญ
          </Button>
        </Sform>
      </Modal>
    </>
  );
}

export default SearchPassword;

@StarryPro StarryPro self-assigned this Feb 24, 2023
@StarryPro StarryPro merged commit 5bc81c8 into dev Feb 26, 2023
@StarryPro StarryPro changed the title Feature/#19 sign in page Feature/#19 signIn page Feb 27, 2023
@StarryPro StarryPro changed the title Feature/#19 signIn page Feature/#19 SignIn page Feb 27, 2023
@seul-dev
Copy link
Collaborator

seul-dev commented Feb 27, 2023

แ„‡แ…ตแ„†แ…ตแ†ฏแ„‡แ…ฅแ†ซแ„’แ…ฉแ„Žแ…กแ†ฝแ„€แ…ต1

๋ชจ๋‹ฌ ์ปดํฌ๋„ŒํŠธ ๋‚ด์—์„œ ํผ ์ œ์ถœ ์ด๋ฒคํŠธ๊ฐ€ ๋ฐœ์ƒํ•˜๋ฉด, signIn ํŽ˜์ด์ง€ ๋‚ด์˜ ํผ ์ด๋ฒคํŠธ๋„ ํ•จ๊ป˜ ์ œ์ถœ๋˜๋Š” ๋ฌธ์ œ๊ฐ€ ์žˆ์–ด์š”. ์ด ๋งํฌ์—์„œ ๋ณด๊ณ ๋œ ์ด์Šˆ์™€ ๊ฐ™์•„๋ณด์—ฌ์š”.

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.

โœจ feat: ๋น„๋ฐ€๋ฒˆํ˜ธ ์ฐพ๊ธฐ ๊ธฐ๋Šฅ ๊ตฌํ˜„
2 participants