Login.js 3.23 KB
Newer Older
Kim, Subin's avatar
Kim, Subin committed
1
2
3
import React, { useState, useEffect, useRef } from 'react';
import Nav1 from '../Components/MainNav';
import Nav2 from '../Components/SubNav';
이재연's avatar
logsign    
이재연 committed
4
import { Form, Col, Container, Button, Row } from 'react-bootstrap'
이재연's avatar
이재연 committed
5
import { Link, Redirect } from 'react-router-dom'
이재연's avatar
logsign    
이재연 committed
6

이재연's avatar
이재연 committed
7
8
9
10
11
12
13
14
15
16
17
18
19
function Login(){

    const [validated,setValidated]=useState(false);

    const handleSubmit=(e)=>{
        const form =e.currentTarget;
        console.log(form)
        if(form.checkValidity() === false){
            e.preventDefault();
            e.stopPropagation();
        }
        setValidated(true);
    }
Kim, Subin's avatar
Kim, Subin committed
20
    return (
이재연's avatar
logsign    
이재연 committed
21
        <div>
Kim, Subin's avatar
Kim, Subin committed
22
23
            <Nav1 />
            <Nav2 />
이재연's avatar
logsign    
이재연 committed
24
            <Container className="my-5">
이재연's avatar
이재연 committed
25

이재연's avatar
logsign    
이재연 committed
26
27
                <Row className="justify-content-center">

이재연's avatar
이재연 committed
28
                    <Col md={5} xs={10} className="border" style={{ background: '#F7F3F3' }}>
이재연's avatar
logsign    
이재연 committed
29
                        <h3 className="text-center mt-5">Login</h3>
이재연's avatar
이재연 committed
30
                        <Form  noValidate validated={validated} onSubmit={handleSubmit} className="p-5">
이재연's avatar
logsign    
이재연 committed
31
32
33
34


                            <Form.Group controlId="formBasicId">
                                <Form.Row>
이재연's avatar
이재연 committed
35
36
37
                                    <Col sm={4} xs={6} as={Form.Label} for="id"> 아이디</Col>
                                        <Col sm={8} xs={12} as={Form.Control}
                                            required
이재연's avatar
이재연 committed
38
39
                                            type="text"
                                            id="id"
이재연's avatar
이재연 committed
40
41
42
43
                                            placeholder="ID"
                                            style={{ width: '160px' }}>
                                        </Col>
                                        <Form.Control.Feedback className="text-center" type="invalid"> 아이디를 입력하세요.</Form.Control.Feedback>
이재연's avatar
logsign    
이재연 committed
44
45
46
47
48
                                </Form.Row>
                            </Form.Group>

                            <Form.Group controlId="formBasicPassword">
                                <Form.Row>
이재연's avatar
이재연 committed
49
50
                                    <Col sm={4} xs={6} as={Form.Label} for="password">비밀번호</Col>
                                        <Col sm={8} xs={12} as={Form.Control}
이재연's avatar
이재연 committed
51
52
                                            type="password"
                                            id="password"
이재연's avatar
이재연 committed
53
54
55
56
57
58
                                            placeholder="Password"
                                            style={{ width: '160px' }}
                                            required />
                                    <Form.Control.Feedback className="text-center" type="invalid">
                                        비밀번호를 입력하세요.
                                    </Form.Control.Feedback>
이재연's avatar
logsign    
이재연 committed
59
60
                                </Form.Row>
                            </Form.Group>
이재연's avatar
이재연 committed
61
                            <Button style={{ background: '#91877F', borderColor: '#91877F' }} type="submit" block>Login</Button>
이재연's avatar
logsign    
이재연 committed
62
                            <div className="loginLine">
이재연's avatar
이재연 committed
63
                                <Link to="/signup" style={{ color: '#91877F' }}>회원이 아니십니까?</Link>
이재연's avatar
logsign    
이재연 committed
64
65
66
67
68
69
70
71
72
73
74
                            </div>
                        </Form>
                    </Col>
                </Row>




            </Container>
        </div>

이재연's avatar
2    
이재연 committed
75

Kim, Subin's avatar
Kim, Subin committed
76
77
78
79
    )
}

export default Login