import React, { useEffect, useState } from 'react' import { Button, Image, Row, ButtonGroup, Form, Col } from 'react-bootstrap'; import { Link } from 'react-router-dom'; import '../App.css' import UserInfo from './UserInfo'; import { kakaoLogout } from '../utils/Oauth'; import axios from 'axios'; import { callUserInfo, deleteCookie } from '../utils/CheckDB'; import { checkCookies } from '../utils/CheckDB'; function MainLayer() { const boxstyled = { border: 'solid', color: 'rgba(195, 195, 195, 0.753)', borderRadius: '20px', borderWidth: '3px', width: '100%', backgroundSize: 'contain', textDecorationColor: 'none' } const btnstyled = { background: 'rgb(110, 189, 142)', margin: 'auto', marginBottom: '0.5em', display: 'flex', justifyContent: 'center', width: '100%', borderWidth: '2px', borderColor: 'rgba(195, 195, 195, 0.753)', borderRadius: '20px', textDecorationColor: 'none', color: 'white' } const [airUsing, setAirUsing] = useState(false) useEffect(() => { callUserInfo().then((res) => { if (res !== []) { console.log(res[0]) } else { console.log(res) } }) }, []) async function airChange() { setAirUsing(!airUsing) await axios.post('/api/edit-profile', { using_aircon: !airUsing }) .then(function (response) { console.log('res', response); callUserInfo().then((res) => { if (res !== []) { console.log(res[0]) } else { console.log(res) } }) }) .catch(function (error) { console.log('err', error); }); } return ( EUE {checkCookies() &&
} {checkCookies() ? //true : //false } {!checkCookies() && } | ); } export default MainLayer