import React, { useEffect, useState } from 'react' import { Container, Row, Col, Modal } from 'react-bootstrap'; import MainLayer from '../components/MainLayer'; import '../App.css' import EueSuggest from '../components/EueSuggest'; import ChartTemp from '../components/ChartTemp'; import Donation from '../components/Donation'; import LocCodeChange from '../components/LocCodeChange'; import { callUserInfo } from '../utils/CheckDB'; import { isLogined } from './../utils/Auth'; function GetLocFirst() { const constyled = { display: 'flex', justifyContent: 'space-evenly', width: '100%', position: 'relative' } const col1sty = { display: 'flex', justifyContent: 'start', alignItems: 'center' } const col2sty = { display: 'flex', justifyContent: 'center', alignItems: 'center', flexDirection: 'column', padding: '0' } const [show, setShow] = useState(false) useEffect(() => { callUserInfo().then((res) => { if (isLogined()) { const existLoc = res[0]['loc_code'] if (existLoc === null) { setTimeout(function () { setShow(true) }, 1000) } else { console.log('Already has Loc_code') window.location.replace('/') } } }) }, []) return ( EUE에 오신걸 환영합니다 ); } export default GetLocFirst;