Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
online-quiz-react
Commits
e67f66d7
Commit
e67f66d7
authored
Aug 12, 2020
by
Jiwon Yoon
Browse files
a
parent
0cb9f458
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Admin.js
View file @
e67f66d7
import
React
,
{
useState
}
from
'
react
'
;
import
React
,
{
useState
}
from
'
react
'
;
import
AdminQuiz
from
'
./AdminQuiz
'
;
import
AdminQuiz
from
'
./AdminQuiz
'
import
AdminSetting
from
'
./AdminSetting
'
import
AdminSetting
from
'
./AdminSetting
'
// import { Link } from 'react-router-dom';
let
QuizBtn
=
[]
let
QuizBtn
=
[]
function
Admin
()
{
function
Admin
()
{
const
[
result
,
setresult
]
=
useState
(
''
)
const
[
QuizBtnCount
,
setQuizBtnCount
]
=
useState
(
4
)
const
[
result
,
setresult
]
=
useState
(
''
)
function
handleClickSetting
(){
// const [addQuiz, setaddQuiz] = useState('')
setresult
(
<
AdminSetting
/>
)
const
[
QuizBtnCount
,
setQuizBtnCount
]
=
useState
(
4
)
function
handleClickSetting
()
{
setresult
(
<
AdminSetting
/>
)
}
}
function
handleClickQuiz
()
{
function
handleClickQuiz
(){
setresult
(
<
AdminQuiz
/>
)
setresult
(
<
AdminQuiz
/>
)
}
}
function
handleClickAddQuiz
()
{
function
handleClickAddQuiz
(){
QuizBtn
.
push
(
QuizBtn
Count
.
push
(
<
button
type
=
"
button
"
className
=
"
btn btn-outline-primary
"
id
=
{
QuizBtnCount
}
onClick
=
{
handleClickQuiz
}
>
Quiz
{
QuizBtnCount
}
<
/button
>
<
button
type
=
'
button
'
className
=
'
btn btn-outline-primary
'
id
=
{
QuizBtnCount
}
onClick
=
{
handleClickQuiz
}
>
Quiz
{
QuizBtnCount
}
<
/button
>
)
)
setQuizBtnCount
(
QuizBtnCount
+
1
)
setQuizBtnCount
(
QuizBtnCount
+
1
)
}
}
return
(
return
(
<>
<>
<
div
className
=
"
container-fluid
"
>
<
div
className
=
"
container-fluid
"
>
<
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
=
"
my-5
"
>
<
div
className
=
"
my-5
"
>
<
h4
>
관리자페이지
<
/h4
>
<
h4
>
관리자페이지
<
/h4
>
<
/div
>
<
/div
>
<
div
>
<
div
>
<
button
type
=
"
button
"
className
=
"
btn btn-outline-info mb-5
"
onClick
=
{
handleClickSetting
}
>
Setting
<
/button
>
<
button
type
=
"
button
"
className
=
"
btn btn-outline-info mb-5
"
onClick
=
{
handleClickSetting
}
>
Setting
<
/button
>
<
/div
>
<
/div
>
<
div
class
=
"
btn-group-vertical
"
>
<
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
=
"
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
=
"
2
"
onClick
=
{
handleClickQuiz
}
>
Quiz
2
<
/button
>
<
button
type
=
"
button
"
className
=
"
btn btn-outline-primary
"
id
=
"
3
"
onClick
=
{
handleClickQuiz
}
>
Quiz
3
<
/button
>
<
button
type
=
"
button
"
className
=
"
btn btn-outline-primary
"
id
=
"
3
"
onClick
=
{
handleClickQuiz
}
>
Quiz
3
<
/button
>
{
QuizBtn
.
map
((
element
)
=>
element
)}
{
QuizBtn
.
map
((
element
)
=>
element
)}
<
button
type
=
"
button
"
className
=
"
btn btn-outline-primary
"
onClick
=
{
handleClickAddQuiz
}
>+<
/button
>
<
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
className
=
"
row d-flex justify-content-center
"
>
<
div
className
=
"
row d-flex justify-content-center
"
>
<
/div
>
<
/div
>
<
/div
>
{
result
}
<
/div
>
<
/div
>
{
result
}
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/
>
<
/
>
)
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment