Commit d6e24f8b authored by Spark's avatar Spark
Browse files

edit routes

parent cf553154
...@@ -14,6 +14,7 @@ function EueSuggest() { ...@@ -14,6 +14,7 @@ function EueSuggest() {
borderColor: 'rgb(110, 189, 142)', borderColor: 'rgb(110, 189, 142)',
color: '#04AB70' color: '#04AB70'
} }
const airUsing = localStorage.getItem('using-aircondition') const airUsing = localStorage.getItem('using-aircondition')
......
...@@ -22,9 +22,11 @@ function LocCodeChange() { ...@@ -22,9 +22,11 @@ function LocCodeChange() {
const inboxstyled = { const inboxstyled = {
display: 'flex', display: 'flex',
flexDirection: 'column', flexDirection: 'column',
maxWidth: '80%',
justifyContent: 'center', justifyContent: 'center',
margin: 'auto', margin: 'auto',
padding: '10px' padding: '0.5em',
color: 'black'
} }
const btnstyled2 = { const btnstyled2 = {
...@@ -117,10 +119,10 @@ function LocCodeChange() { ...@@ -117,10 +119,10 @@ function LocCodeChange() {
<Row className='text-center w-100 my-2'> <Row className='text-center w-100 my-2'>
<Card style={cardstyled}> <Card style={cardstyled}>
<Card.Title id='impactTitle'> <Card.Title id='impactTitle'>
Local Code 지역 코드
</Card.Title> </Card.Title>
<Card.Subtitle style={{ fontWeight: 'lighter' }}> <Card.Subtitle style={{ fontWeight: 'lighter' }}>
Please select a your region 본인의 지역을 선택해주세요
</Card.Subtitle> </Card.Subtitle>
<hr /> <hr />
<Card.Text className='m-0'> <Card.Text className='m-0'>
......
import React, { useState } from 'react'; import React, { useState } from 'react';
import '../App.css' import '../App.css'
import { Form, Button, Row, Col, Card, Alert } from 'react-bootstrap'; import { Form, Button, Row, Col, Card, Alert, FloatingLabel } from 'react-bootstrap';
import { LoginWithKakao } from '../utils/Oauth'; import { LoginWithKakao } from '../utils/Oauth';
function LoginComp() { function LoginComp() {
...@@ -23,7 +23,8 @@ function LoginComp() { ...@@ -23,7 +23,8 @@ function LoginComp() {
maxWidth: '80%', maxWidth: '80%',
justifyContent: 'center', justifyContent: 'center',
margin: 'auto', margin: 'auto',
padding: '10px' padding: '0.5em',
color: 'black'
} }
const [emailSentAlert, setEmailSentAlert] = useState(false) const [emailSentAlert, setEmailSentAlert] = useState(false)
...@@ -34,7 +35,7 @@ function LoginComp() { ...@@ -34,7 +35,7 @@ function LoginComp() {
function CheckEmailSend() { function CheckEmailSend() {
localStorage.setItem('login_email_Address', emailAddress) localStorage.setItem('login_email_Address', emailAddress)
const emailIs = localStorage.getItem('login_email_Address').split('@')[1] const emailIs = localStorage.getItem('login_email_Address').split('@')[1]
if(emailIs) { if (emailIs) {
setAlertShow(true) setAlertShow(true)
setEmailSentAlert(false) setEmailSentAlert(false)
} }
...@@ -89,9 +90,13 @@ function LoginComp() { ...@@ -89,9 +90,13 @@ function LoginComp() {
</Row> </Row>
<Form style={inboxstyled}> <Form style={inboxstyled}>
<Form.Group controlId="formBasicEmail"> <FloatingLabel
controlId="floatingInput"
label="Email"
>
<Form.Control type="email" placeholder="Email" onChange={handleChange} /> <Form.Control type="email" placeholder="Email" onChange={handleChange} />
</Form.Group>
</FloatingLabel>
<Button variant='light' className='mt-3' id='formbtn' onClick={CheckEmailSend}> <Button variant='light' className='mt-3' id='formbtn' onClick={CheckEmailSend}>
LOGIN LOGIN
</Button> </Button>
......
import React, { useEffect } from 'react'
import { Row, Card, Col, Form, Button, FloatingLabel } from 'react-bootstrap';
function NicknameChange() {
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 exNick = localStorage.getItem('nickname')
console.log(exNick)
function handleChange ({ target: { value } }) {
localStorage.setItem('nickname', value)
}
function handleSubmit(event) {
event.preventDefault();
window.location.reload();
};
return (
<Row className='text-center w-100 my-2'>
<Card style={cardstyled}>
<Card.Title id='impactTitle'>
닉네임 변경
</Card.Title>
<Card.Subtitle style={{ fontWeight: 'lighter' }}>
새로운 닉네임으로 변경해보세요
</Card.Subtitle>
<hr />
<Card.Text className='m-0'>
<Form style={inboxstyled} onSubmit={handleSubmit}>
<FloatingLabel
controlId="floatingInput"
label="Nickname"
>
<Form.Control type="text" placeholder="닉네임 변경" id='nickname' onChange={handleChange} />
</FloatingLabel>
<Button variant='light' className='mt-3' id='formbtn' type='submit'>
</Button>
</Form>
</Card.Text>
</Card>
</Row>
)
}
export default NicknameChange;
\ No newline at end of file
import React, { useState } from 'react' import React, { useState } from 'react'
import '../App.css' import '../App.css'
import { Form, Button, Row, Col, Card, Alert } from 'react-bootstrap'; import { Form, Button, Row, Col, Card, Alert, FloatingLabel } from 'react-bootstrap';
import { LoginWithKakao } from '../utils/Oauth'; import { LoginWithKakao } from '../utils/Oauth';
function SignupComp() { function SignupComp() {
...@@ -23,7 +23,8 @@ function SignupComp() { ...@@ -23,7 +23,8 @@ function SignupComp() {
maxWidth: '80%', maxWidth: '80%',
justifyContent: 'center', justifyContent: 'center',
margin: 'auto', margin: 'auto',
padding: '1rem' padding: '0.5em',
color: 'black'
} }
const initValues = { const initValues = {
...@@ -125,35 +126,36 @@ function SignupComp() { ...@@ -125,35 +126,36 @@ function SignupComp() {
} }
</Row> </Row>
<Form style={inboxstyled} <Form style={inboxstyled} onSubmit={handleSubmit}>
onSubmit={handleSubmit}> <FloatingLabel
<Form.Group controlId="username"> controlId="floatingInput"
<Row className='m-auto mb-1 d-flex justify-content-center'> label="Name"
<Form.Control className='mb-3'
type="text" >
name="name" <Form.Control
placeholder="Name" type="text"
value={formValues.name} name="name"
onChange={handleChange} placeholder="Name"
required value={formValues.name}
/> onChange={handleChange}
</Row> required
<Row> />
<p></p> </FloatingLabel>
</Row> <FloatingLabel
<Row className='m-auto d-flex justify-content-center'> controlId="floatingInput"
<Form.Control label="Email Address"
type="email" >
name="email" <Form.Control
placeholder="Email Address" type="email"
value={formValues.email} name="email"
onChange={handleChange} placeholder="Email Address"
required value={formValues.email}
/> onChange={handleChange}
</Row> required
</Form.Group> />
</FloatingLabel>
<Button variant='light' className='mt-3' id='formbtn' onClick={CheckUserExist}>
<Button variant='light' className='mt-3' id='formbtn' type='submit' onClick={CheckUserExist}>
{/* type="submit" */} {/* type="submit" */}
Sign Up Sign Up
</Button> </Button>
......
...@@ -8,7 +8,6 @@ import ChartLine from '../components/ChartLine'; ...@@ -8,7 +8,6 @@ import ChartLine from '../components/ChartLine';
import ChartDoughnut from '../components/ChartDoughnut'; import ChartDoughnut from '../components/ChartDoughnut';
import Donation from '../components/Donation'; import Donation from '../components/Donation';
import axios from 'axios'; import axios from 'axios';
import Footer from '../components/Footer';
function Home() { function Home() {
...@@ -33,12 +32,8 @@ function Home() { ...@@ -33,12 +32,8 @@ function Home() {
padding: '0' padding: '0'
} }
axios({ const getusername = axios.get(`/api/user`)
method: 'get', console.log(getusername)
url: 'localhost:4500/loccode/doe'
}).then((res) => {
console.log(res)
})
return ( return (
......
...@@ -3,6 +3,7 @@ import { Container, Row, Col } from 'react-bootstrap'; ...@@ -3,6 +3,7 @@ import { Container, Row, Col } from 'react-bootstrap';
import MainLayer from '../components/MainLayer'; import MainLayer from '../components/MainLayer';
import '../App.css' import '../App.css'
import LocCodeChange from '../components/LocCodeChange'; import LocCodeChange from '../components/LocCodeChange';
import NicknameChange from '../components/NicknameChange';
function SignupPage() { function SignupPage() {
const constyled = { const constyled = {
...@@ -39,6 +40,7 @@ function SignupPage() { ...@@ -39,6 +40,7 @@ function SignupPage() {
</Col> </Col>
<Col md={6} style={col2sty}> <Col md={6} style={col2sty}>
<NicknameChange />
<LocCodeChange /> <LocCodeChange />
</Col> </Col>
</Row> </Row>
......
...@@ -4,3 +4,11 @@ export const routes = { ...@@ -4,3 +4,11 @@ export const routes = {
login: 'login', login: 'login',
localcode: '/local_code', localcode: '/local_code',
} }
// post, put { body }
// email :
// nick_name :
// using_aircon :
// created_at :
// loc_code
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