Home.js 1.14 KB
Newer Older
Jiwon Yoon's avatar
a    
Jiwon Yoon committed
1
2
3
4
import React from 'react'
import { Link } from 'react-router-dom';
import './Home.css';
// import bg from './img_study.jpg'
Jiwon Yoon's avatar
Jiwon Yoon committed
5
6
7
8


function Home() {
    return (
Jiwon Yoon's avatar
a    
Jiwon Yoon committed
9
10
11
        <div className="container my-con">
            <div >
                <p className="text-center font-weight-bold">이름을 입력하세요</p>
Jiwon Yoon's avatar
home    
Jiwon Yoon committed
12
                <div>
Jiwon Yoon's avatar
a    
Jiwon Yoon committed
13
14
15
16
17
18
19
20
                    <div>
                        <input className="inputBox" onChange={(event) => sessionStorage.setItem('name', event.target.value)} />
                    </div>
                    <div>
                        <Link to="/quiz">
                            <button className="QuizStart" onClick={checking}>Quiz Start !</button>
                        </Link>
                    </div>
Jiwon Yoon's avatar
home    
Jiwon Yoon committed
21
                </div>
Jiwon Yoon's avatar
Jiwon Yoon committed
22
            </div>
Jiwon Yoon's avatar
a    
Jiwon Yoon committed
23
24
25
26
27
            <div>
                계산수학
            </div>
        </div>

Jiwon Yoon's avatar
Jiwon Yoon committed
28
29
30
    )
}

Jiwon Yoon's avatar
a    
Jiwon Yoon committed
31
32
33
34
35
36
37
38
function checking() {
    if (sessionStorage.getItem('name') === null || sessionStorage.getItem('name').length === 0) {
        alert('이름을 입력하세요')
    }
    else {
        alert('입력하신 이름은' + sessionStorage.getItem('name') + '입니다.')
    }
}
Jiwon Yoon's avatar
home    
Jiwon Yoon committed
39

Jiwon Yoon's avatar
a    
Jiwon Yoon committed
40
export default Home;