// import bg from './img_study.jpg'
// import korea from './img_korea.jpg'
import React, { useState } from 'react'
import { Redirect } from 'react-router-dom';
function Home() {
const [name, setName] = useState('')
const [password, SetPassword] = useState('')
const [done, setDone] = useState(false)
const handleChangename = (event) => {
setName(event.target.value)
}
const handleChangepassword = (event) => {
SetPassword(event.target.value)
}
function checking() {
if (!name) {
alert('이름을 입력하세요')
}
else if (!password) {
alert('비밀번호를 입력하세요')
}
else if (password !== '0000') {
alert('유효한 비밀번호를 입력하세요')
}
else {
alert('입력하신 이름은 ' + name + '입니다.')
localStorage.setItem('name', name)
localStorage.setItem('password', password)
setDone(true)
}
}
return (
<>
{done ?
이름 입력 |
비밀번호 |