MainLayer.js 2.8 KB
Newer Older
Spark's avatar
layout    
Spark committed
1
2
3
import React from 'react'
import { useState } from 'react';
import { Button, Form, Image, Row, ButtonGroup, Modal, Dropdown, Col } from 'react-bootstrap';
Spark's avatar
Spark committed
4
import { Link, useHistory } from 'react-router-dom';
Spark's avatar
layout    
Spark committed
5
import '../App.css'
Spark's avatar
Spark committed
6
import LoginComp from './LoginComp';
7
import LocalCode from '../components/LocalCode';
Spark's avatar
Spark committed
8
// import { isOauthChecked } from './../utils/Auth';
Spark's avatar
client    
Spark committed
9
import { kakaoLogout } from '../utils/Oauth';
10

Spark's avatar
layout    
Spark committed
11
12

function MainLayer() {
Spark's avatar
Spark committed
13
    const history = useHistory()
Spark's avatar
layout    
Spark committed
14
15
16
17
18

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

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

Spark's avatar
Spark committed
41
    const logined = localStorage.getItem('nickname')
Spark's avatar
layout    
Spark committed
42
43
44
45

    return (
        <>
            <Row className='d-flex align-items-center m-auto w-100'>
46
47
48
                <Link to='/' className=' m-auto'>
                    <Image src='/images/EUE11.jpg' alt='EUE' style={boxstyled} />
                </Link>
Spark's avatar
layout    
Spark committed
49
50
            </Row>

51
52
53
54
55
            <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' }}>
Spark's avatar
Spark committed
56
                    {logined ?
Spark's avatar
Spark committed
57
58
                        //true
                        <Button variant='light' style={btnstyled} onClick={kakaoLogout}>
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>
                    }
Spark's avatar
Spark committed
69
                    {!logined &&
Spark's avatar
Spark committed
70
71
72
73
74
75
                        <Button variant='light' style={btnstyled}>
                            <Link to='/signup' id='btnlink'>
                                회원가입
                            </Link>
                        </Button>
                    }
Spark's avatar
Spark committed
76

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

export default MainLayer