MainLayer.js 2.69 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
8
import UsingAircon from './UsingAircon';
import { isLogined } 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
    }

Spark's avatar
Spark committed
37
38


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

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

52
53
            {isLogined() &&
                <UsingAircon/>
Spark's avatar
Spark committed
54
            }
Spark's avatar
Spark committed
55

56
57
            <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' }}>
58

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

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

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

export default MainLayer