Commit 52cb6167 authored by baesangjune's avatar baesangjune
Browse files

No commit message

No commit message
parent cc59b791
...@@ -3,11 +3,12 @@ import AdminQuiz from './AdminQuiz' ...@@ -3,11 +3,12 @@ import AdminQuiz from './AdminQuiz'
import AdminSetting from './AdminSetting' import AdminSetting from './AdminSetting'
let QnAadmins = [] // let QnAadmins = []
let QnAadmin = {} // let QnAadmin = {}
let Setadmins = [] // let Setadmins = []
let Setadmin = {} // let Setadmin = {}
let QuizBtn=[]
function Admin() { function Admin() {
...@@ -135,119 +136,39 @@ function Admin() { ...@@ -135,119 +136,39 @@ function Admin() {
return ( return (
<> <>
{/* {doneQnA ? alert('모두 입력되었습니다.') : ''} <div className="container-fluid">
{doneset ? alert('모두 입력되었습니다.') : ''} */}
<div className="row justify-content-md-center mt-5 "> <div className="row justify-content-md-center mt-5 ">
<div className="col-2 text-center border"> <div className="col-2 text-center border">
<div className="container-fluid "> <div className="my-5">
<div className="navbar-header p-3 "> <h4>관리자페이지</h4>
<p className="navbar-brand border-bottom ">관리자 페이지</p>
</div> </div>
<div className="nav flex-column nav-pills" id="v-pills-tab" role="tablist"> <div>
<button type="button" className="btn btn-outline-info mb-5" onClick={handleClickSetting}>Setting</button>
<p className="navbar-text border-bottom">관리자 설정 변경하기</p>
<a className="nav-link" id="setting-tab" data-toggle='pill' href="#setting">Setting</a>
<p className="navbar-text border-bottom">Quiz 입력하기</p> {/*Quiz1 버튼에 무언갈 쓰고 Quiz2를 누르면 초기화되도록하기*/}
<a className="nav-link" id="Quiz-tab" data-toggle="pill" href="#Quiz" >Quiz1</a>
<a className="nav-link" id="Quiz-tab" data-toggle="pill" href="#Quiz" >Quiz2</a>
<a className="nav-link" id="Quiz-tab" data-toggle="pill" href="#Quiz" >Quiz3</a>
{addQuiz}
<button className="btn btn-danger navbar-btn" onClick={handleClickQuiz} >Quiz 추가</button>
</div> </div>
<div class="btn-group-vertical">
<button type="button" className="btn btn-outline-primary" id="1" onClick={handleClickQuiz}>Quiz 1</button>
<button type="button" className="btn btn-outline-primary" id="2" onClick={handleClickQuiz}>Quiz 2</button>
<button type="button" className="btn btn-outline-primary" id="3" onClick={handleClickQuiz}>Quiz 3</button>
{QuizBtn.map((element) => element)}
<button type="button" className="btn btn-outline-primary" onClick={handleClickAddQuiz}>+</button>
</div> </div>
</div> </div>
<div className="col-8"> <div className="col-8">
<div className="tab-content" id="v-pills-tabContent"> <div className="tab-content" id="v-pills-tabContent">
<div className="tab-pane fade show active" id="setting" role="tabpanel" > <div className="tab-pane fade show active" id="setting" role="tabpanel" >
<div>
<div className="container">
<div className="row d-flex justify-content-center"> <div className="row d-flex justify-content-center">
<div className="col-8">
<h2 className="p-3 border text-center bg-danger">관리자 설정변경</h2>
<div className="p-3 border">
<h3>변경할 비밀번호를 입력하세요</h3>
<input className='p-2' type="text" onChange={handleChangePassword} placeholder="New Password" />
</div> </div>
<div className="p-3 border">
<h3>변경할 관리자 비밀번호를 입력하세요</h3>
<input className='p-2' type="text" onChange={handleChangeAdminPassword} placeholder="New Admin Password" />
</div>
<div className="p-3 border">
<h3>타이머를 설정하세요(초단위)</h3>
<input className='p-2' type="text" onChange={handleChangeTime} placeholder="Set Time" />
</div> </div>
{result}
<label for="inputLogin" className="d-flex justify-content-center">
<button className="mt-4 btn btn-dark" onClick={handleClicksetting}>작성완료</button>
</label>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div className="tab-pane fade" id="Quiz" role="tabpanel">
<div className="container">
<div className="row d-flex justify-content-center">
<div className="col-8">
<h2 className="p-3 border text-center bg-danger">문제만들기</h2>
<div className="p-3 borber">
<div className="p-3 ">
<span className="font-weight-bold mr-2 h3">1.</span>
{/* <input type="text" onChange={handleChangenumber} placeholder="Number" /> */}
<input className='p-2' type="text" onChange={handleChangeQuestion} placeholder="문제를 입력하세요" />
</div>
<div className="p-3 ">
<div className="input-group">
<div className="input-group-prepend">
<div className="input-group-text p-3">
<input type="radio" id="option" />
</div>
</div>
<input type="text" className="form-control p-4" placeholder="보기를 입력하세요" onChange={handleChangechoose} />
</div>
{selectOption}
<button className="btn btn-outline-secondary btn-sm" onClick={addSelectOption}>+</button>
</div>
<div className="p-3 ">
<span className="font-weight-bold mr-2 h3">정답:</span>
<input className='p-2' type="text" onChange={handleChangeanswer} placeholder="정답을 입력하세요" />
</div>
<label for="inputLogin" className="d-flex justify-content-center">
<button className="mt-4 btn btn-dark" onClick={handleClickQnA}>작성완료</button>
</label>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</> </>
) )
......
...@@ -2,6 +2,10 @@ import React, { useState } from 'react'; ...@@ -2,6 +2,10 @@ import React, { useState } from 'react';
let list = [] let list = []
let QnAadmins = []
let QnAadmin = {}
function AdminQuiz() { function AdminQuiz() {
...@@ -16,7 +20,7 @@ function AdminQuiz() { ...@@ -16,7 +20,7 @@ function AdminQuiz() {
setQuestion(event.target.value) setQuestion(event.target.value)
} }
const handleChangechoose = (event) => { const handleChangeChoose = (event) => {
QnAadmin['Choose'] = event.target.value QnAadmin['Choose'] = event.target.value
...@@ -46,7 +50,7 @@ function AdminQuiz() { ...@@ -46,7 +50,7 @@ function AdminQuiz() {
} }
function handleClickQnA() { function handleClick() {
if (!question) { if (!question) {
alert('문제가 입력되지 않았습니다.') alert('문제가 입력되지 않았습니다.')
} }
......
import React,{ useState } from 'react' import React,{ useState } from 'react'
let Setadmins = []
let Setadmin = {}
function AdminSetting() { function AdminSetting() {
...@@ -24,7 +26,7 @@ function AdminSetting() { ...@@ -24,7 +26,7 @@ function AdminSetting() {
} }
function handleClicksetting() { function handleClick() {
if (!password) { if (!password) {
alert('비밀번호가 입력되지 않았습니다.') alert('비밀번호가 입력되지 않았습니다.')
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment