UserInfo.js 2.64 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
16
17
18
19
20
21
22
    const cardstyled = {
        margin: 'auto',
        padding: '1em',
        display: 'flex',
        justifyContent: 'center',
        width: '100%',
        borderWidth: '3px',
        borderRadius: '20px',
        borderColor: 'rgba(195, 195, 195, 0.753)',
Spark's avatar
Spark committed
23
24
25
26
        // color: '#04AB70'
        color: 'rgb(110, 189, 142)',


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

40
    return (
Spark's avatar
Spark committed
41
        <Row>
42
43
44
            <Col className='text-center pt-3 pb-2 px-0'>
                <Card style={cardstyled} id='localName'>
                    <Card.Title>
Spark's avatar
Spark committed
45
                        {nickname ?
Spark's avatar
Spark committed
46
                            `${nickname}`
Spark's avatar
Spark committed
47
48
49
50
                            :
                            <>
                                GUEST
                            </>
Spark's avatar
Spark committed
51
                        }, 환영합니다.
52
                    </Card.Title>
Spark's avatar
Spark committed
53
                    <Row style={{ alignItems: 'center', margin: 'auto', justifyContent: 'center' }}>
54
                        <Card.Subtitle>
Spark's avatar
Spark committed
55
56
57
58
59
60
61
                            {localname_emd ?
                                `${localname_doe} ${localname_sgg} ${localname_emd}`
                                :
                                <>
                                    지역을 입력해 주세요
                                </>
                            }
62
                        </Card.Subtitle>
Spark's avatar
Spark committed
63
                        {nickname &&
Spark's avatar
Spark committed
64
65
                            <Button variant='light' className='m-auto d-flex' style={btnstyled2}>
                                <Link to='/local_code' className='w-100' style={{ textDecoration: 'none', color: 'rgb(110, 189, 142)' }}>
Spark's avatar
Spark committed
66
67
                                    변경
                                </Link>
Spark's avatar
Spark committed
68
69
                            </Button>
                        }
70
                    </Row>
Spark's avatar
Spark committed
71
                    <hr />
72
73
74
75
76

                    환경을 향한 노력 <br />
                    <strong>OOO  </strong>
                </Card>
            </Col>
Spark's avatar
Spark committed
77
        </Row>
78
79
    )
}
Spark's avatar
Spark committed
80
export default UserInfo;