LogInPage.js 2.53 KB
Newer Older
우지원's avatar
ul    
우지원 committed
1
import React, { useState } from 'react';
2
import { Button, Form, Container, Navbar } from 'react-bootstrap';
우지원's avatar
ul    
우지원 committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { Link } from 'react-router-dom';

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

    const handleSubmit = (event) => {
        const form = event.currentTarget;
        if (form.checkValidity() === false) {
            event.preventDefault();
            event.stopPropagation();
        }

        setValidated(true);
    };

    return (
19
        <>
우지원's avatar
병합    
우지원 committed
20
21
22
23
            <Navbar bg="dark" variant="dark">
                <Navbar.Brand>YDK Messenger</Navbar.Brand>
            </Navbar>

24
25
26
27
28
29
30
31
32
33
            <Form noValidate validated={validated} onSubmit={handleSubmit}>
                <Container className="d-flex justify-content-center">
                    <div className="mt-5 p-5 shadow w-75">

                        <h2 className="text-center ">로그인</h2>

                        <Form.Group controlId="formGroupEmail">
                            <Form.Label>이메일</Form.Label>
                            <Form.Control
                                required
우지원's avatar
a    
우지원 committed
34
                                type="email"
35
36
37
                                placeholder="이메일을 입력해주세요" />
                            <Form.Control.Feedback type="invalid">
                                필수 정보입니다! 이메일을 입력해주세요!
우지원's avatar
ul    
우지원 committed
38
                        </Form.Control.Feedback>
39
40
41
42
43
44
                        </Form.Group>

                        <Form.Group controlId="formGroupPassword">
                            <Form.Label>비밀번호</Form.Label>
                            <Form.Control
                                required
우지원's avatar
a    
우지원 committed
45
                                type="password"
46
47
48
                                placeholder="비밀번호를 입력해주세요" />
                            <Form.Control.Feedback type="invalid">
                                필수 정보입니다! 비밀번호를 입력해주세요!
우지원's avatar
ul    
우지원 committed
49
                        </Form.Control.Feedback>
50
51
                        </Form.Group>

우지원's avatar
a    
우지원 committed
52
                        <Link to="./home">
53
54
55
                            <Button type="submit" variant="outline-success" size="lg" className="mr-4" block>로그인</Button>
                        </Link>

우지원's avatar
a    
우지원 committed
56
                        <Link to="./signup">
57
58
59
60
61
62
                            <h6 type="button" className="text-right mt-2" style={{ cursor: 'pointer' }}>회원가입</h6>
                        </Link>
                    </div>
                </Container>
            </Form>
        </>
우지원's avatar
ul    
우지원 committed
63
64
65
66
    );
}

export default LogIn