Commit c0c48149 authored by 이재연's avatar 이재연
Browse files

기능하려다가 지움..

parent 4f2429b3
This diff is collapsed.
...@@ -7,5 +7,4 @@ export function signIn({id,password}){ ...@@ -7,5 +7,4 @@ export function signIn({id,password}){
const user=users.find(user=>user.id===id && user.password===password); const user=users.find(user=>user.id===id && user.password===password);
if (user===undefined) throw new Error(); if (user===undefined) throw new Error();
return user; return user;
} }
\ No newline at end of file
...@@ -2,23 +2,9 @@ import React, { useState, useEffect, useRef } from 'react'; ...@@ -2,23 +2,9 @@ import React, { useState, useEffect, useRef } from 'react';
import Nav1 from '../Components/MainNav'; import Nav1 from '../Components/MainNav';
import Nav2 from '../Components/SubNav'; import Nav2 from '../Components/SubNav';
import { Form, Col, Container, Button, Row } from 'react-bootstrap' import { Form, Col, Container, Button, Row } from 'react-bootstrap'
import { Link , Redirect} from 'react-router-dom' import { Link, Redirect } from 'react-router-dom'
function Login(authenticated,login,location) {
const [id, setId] = useState("");
const [password,setPassword]= useState("");
const handleClick =() => {
try {
Login({id,password})
} catch(e) {
alert("Failed to login")
setId("")
setPassword("")
}
}
function login(){
return ( return (
<div> <div>
<Nav1 /> <Nav1 />
...@@ -26,20 +12,21 @@ function Login(authenticated,login,location) { ...@@ -26,20 +12,21 @@ function Login(authenticated,login,location) {
<Container className="my-5"> <Container className="my-5">
<Row className="justify-content-center"> <Row className="justify-content-center">
<Col md={5} xs={10} className="border"> <Col md={5} xs={10} className="border" style={{ background: '#F7F3F3' }}>
<h3 className="text-center mt-5">Login</h3> <h3 className="text-center mt-5">Login</h3>
<Form className="p-5"> <Form className="p-5">
<Form.Group controlId="formBasicId"> <Form.Group controlId="formBasicId">
<Form.Row> <Form.Row>
<Form.Label for="id">User Name</Form.Label> <Form.Label for="id">아이디</Form.Label>
<Col> <Col>
<Form.Control <Form.Control
type="text" type="text"
id="id"
value={id} value={id}
onChange={({target:{value}})=>setId(value)} onChange={({ target: { value } }) => user.d(value)}
className="mx-sm-3" size="sm" placeholder="User Name"> className="mx-sm-3" size="sm" placeholder="ID">
</Form.Control> </Form.Control>
</Col> </Col>
</Form.Row> </Form.Row>
...@@ -47,19 +34,20 @@ function Login(authenticated,login,location) { ...@@ -47,19 +34,20 @@ function Login(authenticated,login,location) {
<Form.Group controlId="formBasicPassword"> <Form.Group controlId="formBasicPassword">
<Form.Row> <Form.Row>
<Form.Label for="password">Password</Form.Label> <Form.Label for="password">비밀번호</Form.Label>
<Col> <Col>
<Form.Control <Form.Control
type="password" type="password"
id="password"
value={password} value={password}
onChange={({target:{value}})=>setPassword(value)} onChange={({ target: { value } }) => user.password(value)}
className="mx-sm-3" size="sm" placeholder="Password"></Form.Control> className="mx-sm-3" size="sm" placeholder="Password"></Form.Control>
</Col> </Col>
</Form.Row> </Form.Row>
</Form.Group> </Form.Group>
<Button variant="outline-dark" type="submit" onClick={handleClick} block>Login</Button> <Button style={{ background: '#91877F', borderColor: '#91877F' }} type="submit" block>Login</Button>
<div className="loginLine"> <div className="loginLine">
<Link to="/signup">SignUp?</Link> <Link to="/signup" style={{ color: '#91877F' }} onClick={handleClick}>회원이 아니십니까?</Link>
</div> </div>
</Form> </Form>
</Col> </Col>
......
...@@ -15,87 +15,88 @@ function Signup() { ...@@ -15,87 +15,88 @@ function Signup() {
<Nav2 /> <Nav2 />
<Container className="my-5"> <Container className="my-5">
<Row className="justify-content-center"> <Row className="justify-content-center">
<Col md={6} xs={10} className="border"> <Col md={6} xs={10} className="border" style={{background:'#F7F3F3'}}>
<h2 className="text-center mt-5">Sign Up</h2> <h2 className="text-center mt-5">Sign Up</h2>
<Form className="p-5"> <Form className="p-5">
<Form.Group controlId="formBasicId">
<Form.Row>
<Form.Label for="id">User Name</Form.Label>
<Col>
<Form.Control type="text" id="id" size="sm" placeholder="UserName" className="mx-sm-3"></Form.Control>
</Col>
</Form.Row>
</Form.Group>
<Form.Group controlId="formBasicName"> <Form.Group controlId="formBasicName">
<Form.Row> <Form.Row>
<Form.Label for="name">Real Name</Form.Label> <Form.Label for="name"> </Form.Label>
<Col> <Col>
<Form.Control type="text" id="name" size="sm" placeholder="Enter your Real Name" className="mx-sm-3"></Form.Control> <Form.Control type="text" id="name" size="sm" placeholder="" className="mx-sm-3"></Form.Control>
</Col> </Col>
</Form.Row> </Form.Row>
</Form.Group> </Form.Group>
<Form.Group controlId="formBasicNumber"> <Form.Group controlId="formBasicNumber">
<Form.Row> <Form.Row>
<Form.Label for="number">Resident registration number</Form.Label> <Form.Label for="number">주민등록번호</Form.Label>
<Col as={Row}> <Col as={Row}>
<Form.Control type="text" id="number1" size="sm" maxlength="6" className="mx-sm-3" style={{width:'120px'}}></Form.Control> <Form.Control type="text" id="number1" size="sm" maxlength="6" className="mx-sm-3" style={{ width: '120px' }}></Form.Control>
- -
<Form.Control type="text" id="number2" size="sm" maxlength="1" className="mx-sm-3" style={{width:'25px'}}></Form.Control> <Form.Control type="text" id="number2" size="sm" maxlength="1" className="mx-sm-3" style={{ width: '25px' }}></Form.Control>
****** ******
</Col> </Col>
</Form.Row> </Form.Row>
</Form.Group> </Form.Group>
<Form.Group controlId="formBasicId">
<Form.Row>
<Form.Label for="id">아이디</Form.Label>
<Col>
<Form.Control type="text" id="id" size="sm" placeholder="ID" className="mx-sm-3"></Form.Control>
</Col>
</Form.Row>
</Form.Group>
<Form.Group controlId="formBasicPassword"> <Form.Group controlId="formBasicPassword">
<Form.Row> <Form.Row>
<Form.Label for="password">Password</Form.Label> <Form.Label for="password">비밀번호</Form.Label>
<Col> <Col>
<Form.Control type="password" id="password" size="sm" aria-describedby="passwordHelpBlock" className="mx-sm-3"></Form.Control> <Form.Control type="password" id="password" size="sm" placeholder="Password"aria-describedby="passwordHelpBlock" className="mx-sm-3"></Form.Control>
<Form.Text id="password" muted>Must be 8-20 characters long.</Form.Text> <Form.Text id="password" muted> 8-15자로 입력해주세요.</Form.Text>
</Col> </Col>
</Form.Row> </Form.Row>
</Form.Group> </Form.Group>
<Form.Group controlId="formBasicPassword2"> <Form.Group controlId="formBasicPassword2">
<Form.Row> <Form.Row>
<Form.Label for="password2">Confirm Password</Form.Label> <Form.Label for="password2">비밀번호 확인</Form.Label>
<Col> <Col>
<Form.Control type="password" id="password2" size="sm" placeholder="Confirm Password" className="mx-sm-3"></Form.Control> <Form.Control type="password" id="password2" size="sm" placeholder="" className="mx-sm-3"></Form.Control>
</Col> </Col>
</Form.Row> </Form.Row>
</Form.Group> </Form.Group>
<Form.Group controlId="formBasicTel"> <Form.Group controlId="formBasicTel">
<Form.Row> <Form.Row>
<Form.Label for="tel">Phone Number</Form.Label> <Form.Label for="tel">휴대전화</Form.Label>
<Col> <Col>
<Form.Control type="text" id="tel" size="sm" placeholder="Enter your Phone Number" className="mx-sm-3"></Form.Control> <Form.Control type="text" id="tel" size="sm" placeholder="" className="mx-sm-3"></Form.Control>
</Col> </Col>
</Form.Row> </Form.Row>
</Form.Group> </Form.Group>
<Form.Group controlId="formBasicAdd"> <Form.Group controlId="formBasicAdd">
<Form.Row> <Form.Row>
<Form.Label>Address</Form.Label> <Form.Label> </Form.Label>
<Col> <Col>
<Form.Control type="text" id="add" size="sm" placeholder="Enter your Address" className="mx-sm-3"></Form.Control> <Form.Control type="text" id="add" size="sm" placeholder="상세주소" className="mx-sm-3"></Form.Control>
</Col> </Col>
</Form.Row> </Form.Row>
</Form.Group> </Form.Group>
<Button variant="outline-dark" type="submit" block>Sign Up</Button> <Button style={{background:'#91877F', borderColor:'#91877F'}} type="submit" block>Sign Up</Button>
</Form> </Form>
</Col> </Col>
......
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