MainLayer.js 2.7 KB
Newer Older
1
import React from 'react'
Spark's avatar
Spark committed
2
import { Button, Image, Row, ButtonGroup, 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';
Spark's avatar
Spark committed
9
import TimeNow from './TimeNow';
10

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
        width: '100%',
        backgroundSize: 'contain',
21
        textDecorationColor: 'none'
Spark's avatar
layout    
Spark committed
22
23
24
25
    }

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

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

Spark's avatar
layout    
Spark committed
45
46
            </Row>

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

51
            <UsingAircon />
Spark's avatar
Spark committed
52

53
54
            <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' }}>
55

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

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

Spark's avatar
layout    
Spark committed
78
                </ButtonGroup>
Spark's avatar
Spark committed
79
                <TimeNow />
Spark's avatar
Spark committed
80

Spark's avatar
layout    
Spark committed
81
            </Row>
82
83
84
            <Row className='m-auto justify-content-center w-100' id='contour'>
                |
            </Row>
Spark's avatar
Spark committed
85
        </Col>
Spark's avatar
layout    
Spark committed
86
87
88
89
    );
}

export default MainLayer