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

feat: 회원가입 구현 #1 #4 #11

Merged
merged 3 commits into from
Jan 9, 2023
Merged

feat: 회원가입 구현 #1 #4 #11

merged 3 commits into from
Jan 9, 2023

Conversation

no-pla
Copy link
Collaborator

@no-pla no-pla commented Jan 9, 2023

firebase와 연동하여 회원가입 기능 구현했습니다. 유효성 검사까지 완료했습니다.

firebase와 연동하여 회원가입 기능 구현했습니다. 유효성 검사까지 완료했습니다.
@no-pla no-pla self-assigned this Jan 9, 2023
Comment on lines 6 to 19
export const handleSignUp = async (email, password) => {
Keyboard.dismiss(); // 버튼 클릭 시 키보드 접기
return createUserWithEmailAndPassword(auth, email, password);
// .then()
// .catch((error) => {
// if (error.message.includes('email-already-in-use')) {
// alert(
// '이미 가입된 이메일입니다. 로그인을 시도하거나 다른 이메일을 사용해 주세요.',
// );
// }
// console.log(error);
// });
};
useMutation(() => handleSignUp(email, password));
Copy link
Collaborator

Choose a reason for hiding this comment

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

  const getUID = () => {
    return getAuth();
  };

  const { data: uid } = useQuery('uid', getUID, {
    select: (data) => {
      return data?.currentUser?.uid;
    },
  });

Copy link
Collaborator

Choose a reason for hiding this comment

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

uid 쿼리를 접근할 수 있어야 합니다.

Comment on lines +19 to +23
const [email, setEmail] = useState(''); // 이메일 값 저장
const [password, setPassword] = useState(''); // 비밀번호 값 저장
const [correctEmail, setCorrectEmail] = useState(true); // 이메일 유효성 검사
const [correctPassword, setCorrectPassword] = useState(true); // 비밀번호 유효성 검사
const [visablePassword, setVisablePassword] = useState(false); // 비밀번호 보이게
Copy link
Collaborator

Choose a reason for hiding this comment

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

const useInput = () => {
  const [inputValue, setInputValue] = useState("")
  
  const reset = () => {
    setInputValue("")
  }
  return {inputValue, setInputValue, reset}
}
const {inputValeu: email, } = useInput()

Copy link
Collaborator

Choose a reason for hiding this comment

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

이분은 반영 안 해도 괜찮습니다.

useUID 커스텀 훅 생성
Copy link
Collaborator

@arch-spatula arch-spatula left a comment

Choose a reason for hiding this comment

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

TL; DR

@no-pla no-pla merged commit f458df0 into dev Jan 9, 2023
@no-pla no-pla deleted the feature/signup branch January 9, 2023 03:56
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.

2 participants