MainLayer.js 3.49 KB
Newer Older
Spark's avatar
layout    
Spark committed
1
2
3
4
5
import React from 'react'
import { useState } from 'react';
import { Button, Form, Image, Row, ButtonGroup, Modal, Dropdown, Col } from 'react-bootstrap';
import { Link } from 'react-router-dom';
import '../App.css'
Spark's avatar
Spark committed
6
7
import SignUp from '../pages/SignUp'
import LoginwithSocial from '../pages/LoginwithSocial';
8
9
10
import { isLogined } from './../Utils/Auth';
import LocalCode from '../components/LocalCode';

Spark's avatar
layout    
Spark committed
11
12
13
14
15
16
17

function MainLayer() {

    const boxstyled = {
        border: 'solid',
        color: 'rgba(195, 195, 195, 0.753)',
        borderRadius: '20px',
18
        borderWidth: '3px',
Spark's avatar
layout    
Spark committed
19
20
21
        marginBottom: '1em',
        width: '100%',
        backgroundSize: 'contain',
22
23
        margin: 'auto',
        textDecorationColor: 'none'
Spark's avatar
layout    
Spark committed
24
25
26
27
28
29
30
31
32
33
34
    }

    const btnstyled = {
        background: 'rgb(110, 189, 142)',
        margin: '1px',
        display: 'flex',
        justifyContent: 'center',
        maxWidth: '100%',
        borderWidth: '2px',
        borderColor: 'rgba(195, 195, 195, 0.753)',
        borderRadius: '20px',
35
36
        textDecorationColor: 'none',
        color: 'white'
Spark's avatar
layout    
Spark committed
37
38
    }

39
40
41
42
43
44
45
    // const loginstyled = {
    //     margin: 'auto',
    //     padding: '2px',
    //     diplay: 'flex',
    //     justifyContent: 'center',
    //     borderRadius: '20px'
    // }
Spark's avatar
layout    
Spark committed
46

47
48
49
50
51
52
    // const titlesty = {
    //     display: 'flex',
    //     justifyContent: 'center',
    //     background: 'rgb(110, 189, 142)',
    //     text: 'center'
    // }
Spark's avatar
layout    
Spark committed
53
54
55
56

    const [logshow, setLogshow] = useState(false);
    const [signshow, setSignshow] = useState(false);

57
    const user = isLogined()
Spark's avatar
layout    
Spark committed
58
59
60
61

    return (
        <>
            <Row className='d-flex align-items-center m-auto w-100'>
62
63
64
                <Link to='/' className=' m-auto'>
                    <Image src='/images/EUE11.jpg' alt='EUE' style={boxstyled} />
                </Link>
Spark's avatar
layout    
Spark committed
65
66
            </Row>

67
68
69
70
71
72
73
74
75
76
77
78
79
80
            <Row className='m-auto d-flex justify-content-center w-100'>
                <LocalCode />
            </Row>
            <Row className='d-flex justify-content-center align-items-center my-2 mx-auto w-100'>
                <ButtonGroup vertical className='m-auto' style={{ width: '100%', flexDirection: 'column' }}>
                    {user ?
                        <Button variant='light' style={btnstyled} onClick={() => setLogshow(true)}>
                            로그아웃
                        </Button>
                        :
                        <Button variant='light' style={btnstyled} onClick={() => setLogshow(true)}>
                            로그인
                        </Button>
                    }
Spark's avatar
layout    
Spark committed
81
82
83
84
85
86
                    <Modal
                        size="sm"
                        show={logshow}
                        onHide={() => setLogshow(false)}
                        aria-labelledby="example-modal-sizes-title-sm"
                    >
Spark's avatar
Spark committed
87
                        <LoginwithSocial />
Spark's avatar
layout    
Spark committed
88
                    </Modal>
89
                    <Button variant='light' style={btnstyled} onClick={() => setSignshow(true)}>회원가입</Button>
Spark's avatar
layout    
Spark committed
90
91
92
93
94
95
                    <Modal
                        size="md"
                        show={signshow}
                        onHide={() => setSignshow(false)}
                        aria-labelledby="example-modal-sizes-title-sm"
                    >
Spark's avatar
Spark committed
96
97
                        <SignUp />

Spark's avatar
layout    
Spark committed
98
99
100
                    </Modal>
                </ButtonGroup>
            </Row>
101
102
103
            <Row className='m-auto justify-content-center w-100' id='contour'>
                |
            </Row>
Spark's avatar
layout    
Spark committed
104
105
106
107
108
        </>
    );
}

export default MainLayer