mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
Initial commit
This commit is contained in:
commit
d0a48513e9
28 changed files with 724 additions and 0 deletions
22
src/components/Question/Question.css
Normal file
22
src/components/Question/Question.css
Normal file
|
@ -0,0 +1,22 @@
|
|||
.questionContainer {
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.questionContainer:hover {
|
||||
background-color: var(--hoover-color);
|
||||
}
|
||||
|
||||
.question {
|
||||
font-weight: bold;
|
||||
font-size: 17px;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.answer {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.data {
|
||||
font-size: 13px;
|
||||
color: #a1a1a1;
|
||||
}
|
34
src/components/Question/Question.js
Normal file
34
src/components/Question/Question.js
Normal file
|
@ -0,0 +1,34 @@
|
|||
import React, { PureComponent } from 'react'
|
||||
import './Question.css'
|
||||
|
||||
class Question extends PureComponent {
|
||||
render () {
|
||||
const { question } = this.props
|
||||
|
||||
let qdata = question.data
|
||||
if (typeof qdata === 'object' && qdata.type === 'simple') {
|
||||
qdata = ''
|
||||
}
|
||||
if (qdata) {
|
||||
try {
|
||||
qdata = JSON.stringify(qdata)
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className='questionContainer'>
|
||||
<div className='question'>
|
||||
{question.Q}
|
||||
</div>
|
||||
<div className='answer'>
|
||||
{question.A}
|
||||
</div>
|
||||
<div className='data'>
|
||||
{qdata || null}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default Question
|
1
src/components/Question/index.js
Normal file
1
src/components/Question/index.js
Normal file
|
@ -0,0 +1 @@
|
|||
export { default } from './Question'
|
Loading…
Add table
Add a link
Reference in a new issue