MainLayer.js 2.64 KB
Newer Older
1
import React from 'react'
Spark's avatar
Spark committed
2
import { Button, Image, Row, ButtonGroup, Form, Col } from 'react-bootstrap';
Spark's avatar
Spark committed
3
import { Link } from 'react-router-dom';
Spark's avatar
layout    
Spark committed
4
import '../App.css'
Spark's avatar
Spark committed
5
import UserInfo from './UserInfo';
Spark's avatar
client    
Spark committed
6
import { kakaoLogout } from '../utils/Oauth';
7
import UsingAircon from './UsingAircon';
8
import { isLogined, localLogout } from '../utils/Auth';
9

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

function MainLayer() {

    const boxstyled = {
        border: 'solid',
        color: 'rgba(195, 195, 195, 0.753)',
        borderRadius: '20px',
17
        borderWidth: '3px',
Spark's avatar
layout    
Spark committed
18
19
        width: '100%',
        backgroundSize: 'contain',
20
        textDecorationColor: 'none'
Spark's avatar
layout    
Spark committed
21
22
23
24
    }

    const btnstyled = {
        background: 'rgb(110, 189, 142)',
Spark's avatar
Spark committed
25
26
        margin: 'auto',
        marginBottom: '0.5em',
Spark's avatar
layout    
Spark committed
27
28
        display: 'flex',
        justifyContent: 'center',
Spark's avatar
Spark committed
29
        width: '100%',
Spark's avatar
layout    
Spark committed
30
31
32
        borderWidth: '2px',
        borderColor: 'rgba(195, 195, 195, 0.753)',
        borderRadius: '20px',
33
34
        textDecorationColor: 'none',
        color: 'white'
Spark's avatar
layout    
Spark committed
35
36
37
    }

    return (
Spark's avatar
Spark committed
38
        <Col>
Spark's avatar
Spark committed
39
40
            <Row className='d-flex align-items-center m-auto w-100 p-0'>
                <Link to='/' className='p-0 m-auto'>
41
42
                    <Image src='/images/EUE11.jpg' alt='EUE' style={boxstyled} />
                </Link>
Spark's avatar
layout    
Spark committed
43
44
            </Row>

45
            <Row className='m-auto d-flex justify-content-center w-100'>
Spark's avatar
Spark committed
46
                <UserInfo />
47
            </Row>
Spark's avatar
Spark committed
48

49
            <UsingAircon />
Spark's avatar
Spark committed
50

51
52
            <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' }}>
53

54
                    {isLogined() ?
Spark's avatar
Spark committed
55
                        //true
56
                        <Button variant='light' style={btnstyled} onClick={localLogout}>
57
58
59
                            로그아웃
                        </Button>
                        :
Spark's avatar
Spark committed
60
                        //false
Spark's avatar
Spark committed
61
62
63
64
                        <Button variant='light' style={btnstyled}>
                            <Link to='/login' id='btnlink'>
                                로그인
                            </Link>
65
66
                        </Button>
                    }
67

68
                    {!isLogined() &&
Spark's avatar
Spark committed
69
70
71
72
73
74
                        <Button variant='light' style={btnstyled}>
                            <Link to='/signup' id='btnlink'>
                                회원가입
                            </Link>
                        </Button>
                    }
Spark's avatar
Spark committed
75

Spark's avatar
layout    
Spark committed
76
77
                </ButtonGroup>
            </Row>
78
79
80
            <Row className='m-auto justify-content-center w-100' id='contour'>
                |
            </Row>
Spark's avatar
Spark committed
81
        </Col>
Spark's avatar
layout    
Spark committed
82
83
84
85
    );
}

export default MainLayer