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,6 +1,6 @@
|
|||
import React, { PureComponent } from 'react'
|
||||
|
||||
import Question from '../Question'
|
||||
import Question from './Question.js'
|
||||
|
||||
class Subject extends PureComponent {
|
||||
render () {
|
||||
|
|
26
src/components/SubjectSelector.js
Normal file
26
src/components/SubjectSelector.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
export default function SubjectSelector (props) {
|
||||
const { activeSubjName, searchTerm, data, onSubjSelect } = props
|
||||
|
||||
return (
|
||||
<div className='subjectSelector'>
|
||||
{data.Subjects.map((subj, i) => {
|
||||
if (!subj.Name.toLowerCase().includes(searchTerm.toLowerCase())) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className={activeSubjName === subj.Name
|
||||
? 'subjItem activeSubjItem'
|
||||
: 'subjItem'
|
||||
}
|
||||
key={i}
|
||||
onClick={() => onSubjSelect(subj.Name)}
|
||||
>
|
||||
{subj.Name}
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
)
|
||||
}
|
|
@ -1,4 +1,9 @@
|
|||
import Link from 'next/link'
|
||||
|
||||
// TODO: activelink prop to set link to active
|
||||
export default function Layout (props) {
|
||||
const { currPageName } = props
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className='sidebar'>
|
||||
|
@ -12,12 +17,23 @@ export default function Layout (props) {
|
|||
Frylabs
|
||||
</div>
|
||||
</div>
|
||||
<a
|
||||
className={'active'}
|
||||
onClick={() => { console.log('a') }}
|
||||
>aaaaaaaaaa</a>
|
||||
<Link href='/' >
|
||||
<a
|
||||
className={currPageName === 'index' ? 'active' : ''}
|
||||
>home</a>
|
||||
</Link>
|
||||
<Link href='/manual' >
|
||||
<a
|
||||
className={currPageName === 'manual' ? 'active' : ''}
|
||||
>manual</a>
|
||||
</Link>
|
||||
<Link href='/allQuestions' >
|
||||
<a
|
||||
className={currPageName === 'allQuestions' ? 'active' : ''}
|
||||
>manual</a>
|
||||
</Link>
|
||||
</div>
|
||||
<div>
|
||||
<div className='content'>
|
||||
{props.children}
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue