LocalCode.js 2.57 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';
Spark's avatar
Spark committed
3
// import db from "../db/index"
4
import '../App.css'
Spark's avatar
Spark committed
5
import { Link } from 'react-router-dom';
6
7
8


function LocalCode() {
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
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
    const cardstyled = {
        margin: 'auto',
        padding: '1em',
        display: 'flex',
        justifyContent: 'center',
        width: '100%',
        borderWidth: '3px',
        borderRadius: '20px',
        borderColor: 'rgba(195, 195, 195, 0.753)',
        color: 'rgb(110, 189, 142)'
    }
    const btnstyled2 = {
        background: 'white',
        margin: 'auto',
        borderWidth: '2px',
        fontSize: '0.5em',
        color: 'rgb(110, 189, 142)',
        borderColor: 'rgba(195, 195, 195, 0.753)',
        borderRadius: '20px',
    }
Spark's avatar
Spark committed
35

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

                    환경을 향한 노력 <br />
                    <strong>OOO  </strong>
                </Card>
            </Col>
        </>
    )
}
export default LocalCode;