UserInfo.js 3.5 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';
5
6


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

Spark's avatar
Spark committed
9
10
11
12
    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
13

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


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

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

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