Commit 40581228 authored by Spark's avatar Spark
Browse files

0721 commit

parent 07a9f48d
......@@ -20,6 +20,7 @@
#DB
src/db
src/data
npm-debug.log*
yarn-debug.log*
......
......@@ -39,3 +39,20 @@ export function isOauth(value) {
const TFoauth = value
return TFoauth;
}
// export async function doeCode() {
// const response = await axios.get('http://175.125.254.72:8090/api/data/loccode')
// // console.log('res::', response.data.locCodes)
// const resData = response.data.locCodes
// const doe = resData.DOE
// // console.log('dd', doe) //object
// // console.log('dd::', doe[doe.length-1])
// // console.log('values::', Object.values(doe))
// const doeValue = Object.values(doe)
// // console.log('@@@11', doeValue[0]['code_doe'], typeof(doeValue[0]['code_doe']))
// // console.log('@@@22', doeValue[0]['name_doe'], typeof(doeValue[0]['name_doe']))
// return doeValue
// }
\ No newline at end of file
......@@ -16,8 +16,6 @@ export function LoginWithKakao() {
console.log(JSON.stringify(authObj))
console.log('accT ;;', authObj.access_token)
console.log(typeof (localStorage))
console.log(Object.keys(localStorage)[0])
Kakao.API.request({
// 현재 로그인한 사용자의 카카오계정 정보 불러오기
......
......@@ -2,6 +2,8 @@ import React from 'react'
import '../App.css'
import { Form, Button, Row, Col, Card, DropdownButton, Dropdown, ButtonGroup } from 'react-bootstrap';
import { useState } from 'react';
import axios from 'axios';
// import { doeCode } from '../utils/Auth';
function LocCodeChange() {
......@@ -45,14 +47,40 @@ function LocCodeChange() {
auth.style.visibility = 'visible'
}
// console.log(typeof (locCode()))
// console.log(locCode())
// const [ddoe, setDdoe] = useState([])
// async function DoeCode() {
// await doeCode().then((res) => {
// // // // for (let i = 0; i < res.length; i++) {
// // // console.log(res[0]['code_doe'])
// // // console.log(0, res[0]['name_doe'])
// ddoe.push(res[0]['name_doe'])
// ddoe.push(res[1]['name_doe'])
// console.log(ddoe)
// console.log(typeof(ddoe))
// // // }
// })
// }
const res = axios.get("localhost:4500/d/loccode");
// const does = res.data["locCodes"]["DOE"] // object
return (
<Row className='text-center w-100 my-2'>
{/* {DoeCode()} */}
{/* {data} */}
asd
<Card style={cardstyled}>
<Card.Title id='impactTitle'>
Local Code
</Card.Title>
<Card.Subtitle style={{ fontWeight: 'lighter' }}>
Please select a region name
Please select a your region
</Card.Subtitle>
<hr />
<Card.Text>
......@@ -66,11 +94,10 @@ function LocCodeChange() {
title='지역코드'
as={ButtonGroup}
title={` ${localname} `}>
<Dropdown.Item>Action</Dropdown.Item>
<Dropdown.Item></Dropdown.Item>
<Dropdown.Item>Another action</Dropdown.Item>
<Dropdown.Item>Something else here</Dropdown.Item>
<Dropdown.Divider />
<Dropdown.Item>Separated link</Dropdown.Item>
</DropdownButton>
))}
<Button variant='light' style={btnstyled2} onClick={!locCodeShow && handleClickLoc}>확인</Button>
......
import React from 'react'
import React, { useState } from 'react';
import '../App.css'
import { Form, Button, Row, Col, Card } from 'react-bootstrap';
import { Form, Button, Row, Col, Card, Alert } from 'react-bootstrap';
import { LoginWithKakao } from '../utils/Oauth';
function LoginComp() {
......@@ -26,6 +26,12 @@ function LoginComp() {
padding: '10px'
}
const [emailSent, setEmailSent] = useState(false)
const [alertShow, setAlertShow] = useState(true)
function CheckEmailSend() {
setEmailSent(!emailSent)
}
return (
<Row className='text-center w-100 my-2'>
......@@ -38,12 +44,32 @@ function LoginComp() {
</Card.Subtitle>
<hr />
<Card.Text>
<Row className='m-auto d-flex justify-content-center' style={{ width: '80%' }}>
{!emailSent ?
<Alert show={alertShow} variant={'success'}>
<Col>
😍 이메일 전송이 완료 되었습니다.
</Col>
<Alert.Link href='/' style={{ fontSize: '0.8em' }}>
이메일 확인 하러가기
</Alert.Link>
</Alert>
:
<Alert show={alertShow} variant={'danger'}>
<Col>
😭 이메일을 정확하게 적어주세요.
</Col>
</Alert>
}
<Button onClick={() => setAlertShow(true)}>보여주고</Button>
<Button onClick={() => setAlertShow(false)}>안보여주고</Button>
</Row>
<Form style={inboxstyled}>
<Form.Group controlId="formBasicEmail">
<Form.Control type="email" placeholder="Email" />
</Form.Group>
<Button variant='light' type="submit" id='formbtn'>
<Button variant='light' type="submit" id='formbtn' onClick={CheckEmailSend}>
LOGIN
</Button>
......
import React, { useState } from 'react'
import '../App.css'
import { Form, Button, Row, Col, Card } from 'react-bootstrap';
import { Form, Button, Row, Col, Card, Alert } from 'react-bootstrap';
import { LoginWithKakao } from '../utils/Oauth';
function SignupComp() {
......@@ -17,7 +17,6 @@ function SignupComp() {
color: '#04AB70'
}
const inboxstyled = {
display: 'flex',
flexDirection: 'column',
......@@ -67,7 +66,12 @@ function SignupComp() {
}
// console.log(emailSubm);
const [userExist, setUserExist] = useState(false)
const [alertShow, setAlertShow] = useState(true)
function CheckUserExist() {
setUserExist(!userExist)
}
return (
......@@ -82,6 +86,30 @@ function SignupComp() {
</Card.Subtitle>
<hr />
<Card.Text>
<Row className='m-auto d-flex justify-content-center' style={{ width: '80%' }}>
{!userExist ?
<Alert show={alertShow} variant={'success'}>
<Col>
😊 계정 생성이 완료 되었습니다.
</Col>
<Alert.Link href='/login' style={{ fontSize: '0.8em' }}>
로그인 하러가기
</Alert.Link>
</Alert>
:
<Alert show={alertShow} variant={'danger'}>
<Col>
🤔 이미 존재하는 계정입니다.
</Col>
<Alert.Link href='/login' style={{ fontSize: '0.8em' }}>
로그인 하러가기
</Alert.Link>
</Alert>
}
<Button onClick={() => setAlertShow(true)}>보여주고</Button>
<Button onClick={() => setAlertShow(false)}>안보여주고</Button>
</Row>
<Form style={inboxstyled}
onSubmit={handleSubmit}>
<Form.Group controlId="userEmail">
......@@ -92,7 +120,6 @@ function SignupComp() {
placeholder="Name"
value={formValues.name}
onChange={handleChange}
// readOnly={emailSubm}
required
/>
</Row>
......@@ -106,49 +133,12 @@ function SignupComp() {
placeholder="Email Address"
value={formValues.email}
onChange={handleChange}
readOnly={emailSubm}
required
/>
</Row>
</Form.Group>
{/*
<Row className='m-auto w-100 d-flex justify-content-center'>
<Col md={12} xs={12} style={{ padding: '0', display: 'flex', justifyContent: 'center', width: '100%' }}>
{['도', '시군구', '읍면동'].map((localname) => (
<DropdownButton
variant='light'
style={btnstyled2}
title='지역코드'
as={ButtonGroup}
title={` ${localname} `}
>
<Dropdown.Item>Action</Dropdown.Item>
<Dropdown.Item>Another action</Dropdown.Item>
<Dropdown.Item>Something else here</Dropdown.Item>
<Dropdown.Divider />
<Dropdown.Item>Separated link</Dropdown.Item>
</DropdownButton>
))}
<Button variant='light' style={btnstyled2} onClick={!locCodeShow && handleClickLoc}>확인</Button>
</Col>
<Col md={6} xs={4} id='loc-code' style={{
margin: '5px',
border: 'solid',
borderColor: 'rgb(110, 189, 142)',
display: 'flex',
justifyContent: 'center',
padding: '2px',
visibility: 'hidden',
transition: 'all 4s'
}}>
지역코드
</Col>
</Row> */}
<Button variant='light' className='mt-2' type="submit" id='formbtn'>
<Button variant='light' className='mt-2' type="submit" id='formbtn' onClick={CheckUserExist}>
Sign Up
</Button>
</Form>
......@@ -165,7 +155,6 @@ function SignupComp() {
<Row style={{ margin: 'auto', marginBottom: '5px', display: 'flex', justifyContent: 'center' }}>
<a href="#;" onClick={LoginWithKakao} id='socialLink' >
{/* 세미콜론이 붙으면 최상단 이동 x */}
<img src='http://image.kmib.co.kr/online_image/2020/0626/611514110014734788_1.jpg' id='logpng' alt='KAKAO' />
</a>
</Row>
......
......@@ -40,8 +40,6 @@ function Home() {
})
return (
<Container fluid className='m-auto d-flex justify-content-center position-relative'>
<Row style={constyled} className='m-auto'>
......
......@@ -4,7 +4,7 @@
"description": "",
"main": "init.js",
"scripts": {
"dev:server": "nodemon --exec babel-node src/init.js --delay 2",
"dev:server": "nodemon --exec \"npx babel-node src/init.js\" --delay 2",
"start": "babel-node src/init.js"
},
"repository": {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment