UserInfo.js 3.54 KB
Newer Older
Spark's avatar
Spark committed
1
import React, { useState } from 'react'
Spark's avatar
Spark committed
2
import { Row, Card, Button, Col, Modal } from 'react-bootstrap';
3
import '../App.css'
Spark's avatar
Spark committed
4
import { Link } from 'react-router-dom';
Spark's avatar
Spark committed
5
import { checkCookies } from './../utils/Cookies';
6
7


Spark's avatar
Spark committed
8
function UserInfo() {
Spark's avatar
Spark committed
9

Spark's avatar
Spark committed
10
11
12
13
    const nickname = localStorage.getItem('nickname')
    const localname_doe = localStorage.getItem('name_doe')
    const localname_sgg = localStorage.getItem('name_sgg')
    const localname_emd = localStorage.getItem('name_emd')
Spark's avatar
Spark committed
14

15
16
    const cardstyled = {
        margin: 'auto',
Spark's avatar
Spark committed
17
18
19
        padding: '1em 0.5em 1em 0.5em',
        // paddingTop: '1em',
        // paddingBottom: '1em',
20
21
22
23
24
25
        display: 'flex',
        justifyContent: 'center',
        width: '100%',
        borderWidth: '3px',
        borderRadius: '20px',
        borderColor: 'rgba(195, 195, 195, 0.753)',
Spark's avatar
Spark committed
26
27
28
29
        // color: '#04AB70'
        color: 'rgb(110, 189, 142)',


30
31
32
33
34
    }
    const btnstyled2 = {
        background: 'white',
        margin: 'auto',
        borderWidth: '2px',
Spark's avatar
Spark committed
35
36
        // padding: '0',
        fontSize: '0.7em',
37
38
        color: 'rgb(110, 189, 142)',
        borderColor: 'rgba(195, 195, 195, 0.753)',
Spark's avatar
Spark committed
39
40
        // borderRadius: '20px',
        width: '50%'
41
    }
Spark's avatar
Spark committed
42

43
44
45
46
    return (
            <Col className='text-center pt-3 pb-2 px-0'>
                <Card style={cardstyled} id='localName'>
                    <Card.Title>
Spark's avatar
Spark committed
47
                        <strong>
Spark's avatar
Spark committed
48
                            {checkCookies() ?
Spark's avatar
Spark committed
49
50
51
52
53
54
55
56
57
58
59
60
                                <h2>
                                    {`${nickname}`}
                                </h2>
                                :
                                <h2>
                                    GUEST
                                </h2>
                            }
                        </strong>
                        <p style={{ fontWeight: '300', margin: '0' }}>
                            환영합니다
                        </p>
61
                    </Card.Title>
Spark's avatar
Spark committed
62
                    <hr />
Spark's avatar
Spark committed
63
                    <Row style={{ alignItems: 'center', margin: 'auto', justifyContent: 'center' }}>
Spark's avatar
Spark committed
64
                        <Card.Subtitle>
Spark's avatar
Spark committed
65
                            {localname_emd ?
Spark's avatar
Spark committed
66
67
68
69
70
71
72
73
                                <p className='mb-2'>

                                    {`${localname_doe}`}
                                    <br />
                                    {`${localname_sgg}`}
                                    <br />
                                    {`${localname_emd}`}
                                </p>
Spark's avatar
Spark committed
74
                                :
Spark's avatar
Spark committed
75
76
77
                                <p className='mb-2'>
                                    로그인  이용 가능합니다
                                </p>
Spark's avatar
Spark committed
78
                            }
79
                        </Card.Subtitle>
Spark's avatar
Spark committed
80
                        {checkCookies() &&
Spark's avatar
Spark committed
81
                            <Button variant='light' className='m-auto d-flex' style={btnstyled2}>
Spark's avatar
Spark committed
82
                                <Link to='/edit' className='w-100' style={{ textDecoration: 'none', color: 'rgb(110, 189, 142)' }}>
Spark's avatar
Spark committed
83
84
                                    변경
                                </Link>
Spark's avatar
Spark committed
85
86
                            </Button>
                        }
87
                    </Row>
Spark's avatar
Spark committed
88
                    {checkCookies() &&
Spark's avatar
Spark committed
89
90
                        <p className='w-100 justify-content-center m-auto'>
                            <hr />
91

Spark's avatar
Spark committed
92
93
94
95
                            환경을 향한 노력 <br />
                            <strong>OOO  </strong>
                        </p>
                    }
96
97
98
99
                </Card>
            </Col>
    )
}
Spark's avatar
Spark committed
100
export default UserInfo;