mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
Added manual and all question page
This commit is contained in:
parent
c19f24de87
commit
261e04a0eb
7 changed files with 257 additions and 91 deletions
|
@ -1,9 +1,12 @@
|
|||
import React, { PureComponent } from 'react'
|
||||
import fetch from 'unfetch'
|
||||
|
||||
import LoadingIndicator from '../LoadingIndicator'
|
||||
import Subject from '../../components/Subject'
|
||||
import LoadingIndicator from '../components/LoadingIndicator.js'
|
||||
import Subject from '../components/Subject.js'
|
||||
import SubjectSelector from '../components/SubjectSelector.js'
|
||||
|
||||
import constants from '../../constants.json'
|
||||
import constants from '../constants.json'
|
||||
import Layout from '../components/layout'
|
||||
|
||||
class AllQuestions extends PureComponent {
|
||||
constructor (props) {
|
||||
|
@ -50,47 +53,39 @@ class AllQuestions extends PureComponent {
|
|||
})
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Layout currPageName='allQuestions' >
|
||||
<div>
|
||||
<input
|
||||
placeholder='Keresés...'
|
||||
className='searchBar'
|
||||
type='text'
|
||||
value={searchTerm}
|
||||
onChange={this.searchBarOnChange.bind(this)}
|
||||
/>
|
||||
</div>
|
||||
<div className='subjectSelector'>
|
||||
{this.data.Subjects.map((subj, i) => {
|
||||
if (!subj.Name.toLowerCase().includes(searchTerm.toLowerCase())) {
|
||||
return null
|
||||
}
|
||||
<div>
|
||||
<input
|
||||
placeholder='Keresés...'
|
||||
className='searchBar'
|
||||
type='text'
|
||||
value={searchTerm}
|
||||
onChange={this.searchBarOnChange.bind(this)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
return (
|
||||
<div
|
||||
className={activeSubjName === subj.Name
|
||||
? 'subjItem activeSubjItem'
|
||||
: 'subjItem'
|
||||
}
|
||||
key={i}
|
||||
onClick={() => this.onSubjSelect(subj.Name)}
|
||||
>
|
||||
{subj.Name}
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
<hr />
|
||||
<div>
|
||||
<Subject
|
||||
subj={currSubj}
|
||||
<SubjectSelector
|
||||
data={this.data}
|
||||
activeSubjName={activeSubjName}
|
||||
searchTerm={searchTerm}
|
||||
onSubjSelect={this.onSubjSelect.bind(this)}
|
||||
/>
|
||||
|
||||
<hr />
|
||||
<div>
|
||||
<Subject
|
||||
subj={currSubj}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Layout>
|
||||
)
|
||||
} else {
|
||||
return (
|
||||
<LoadingIndicator />
|
||||
<Layout currPageName='allQuestions' >
|
||||
<LoadingIndicator />
|
||||
</Layout>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue