import React, { useEffect, useState } from 'react' import '../App.css' import { Form, Button, Row, Col, Card, Alert, FloatingLabel } from 'react-bootstrap'; import { LoginWithKakao } from '../utils/Oauth'; import axios from 'axios'; import { callUserInfo } from '../utils/CheckDB'; function SignupComp() { const cardstyled = { margin: 'auto', padding: '1em', display: 'flex', justifyContent: 'center', width: '100%', borderWidth: '3px', borderRadius: '20px', borderColor: 'rgb(110, 189, 142)', color: '#04AB70' } const inboxstyled = { display: 'flex', flexDirection: 'column', maxWidth: '80%', justifyContent: 'center', margin: 'auto', padding: '0.5em', color: 'black' } const initValues = { nick_name: '', email: '' } const [formValues, setFormValues] = useState(initValues) const [userExist, setUserExist] = useState(false) const [alertShow, setAlertShow] = useState(false) function handleChange(event) { const { name, value } = event.target setFormValues({ ...formValues, [name]: value }) } // console.log('???', formValues) async function handleSubmit(event) { event.preventDefault(); await axios.post("/api/signup", formValues) } const [userInfo, setUserInfo] = useState([]) function CheckUserExist() { setUserInfo(callUserInfo()) setAlertShow(true) if (userInfo) { setUserExist(true) // 기존회원 } if (callUserInfo() === undefined) { setUserExist(false) // 신규회원 } } console.log(callUserInfo()) console.log(userExist) return ( Create an Account Sign up with your social media account or email address
{!userExist ? 😊 계정 생성이 완료 되었습니다. 로그인 하러가기 ➞ : 🤔 이미 존재하는 계정입니다. 로그인 하러가기 ➞ }

OR
KAKAO
) } export default SignupComp;