mirror of
https://gitlab.com/MrFry/qmining-data-editor
synced 2025-04-01 20:24:01 +02:00
possible answers fix, next path fix, prettier format
This commit is contained in:
parent
e17bbe6402
commit
70b53e89aa
9 changed files with 377 additions and 360 deletions
|
@ -3,32 +3,34 @@ import React from 'react'
|
|||
import styles from './SubjectSelector.module.css'
|
||||
|
||||
export default function SubjectSelector(props) {
|
||||
const { activeSubjName, searchTerm, data, onSubjSelect } = props
|
||||
const { activeSubjName, searchTerm, data, onSubjSelect } = props
|
||||
|
||||
return (
|
||||
<div className={styles.subjectSelector}>
|
||||
{data.map((subj, i) => {
|
||||
if (!subj.Name.toLowerCase().includes(searchTerm.toLowerCase())) {
|
||||
return null
|
||||
}
|
||||
return (
|
||||
<div className={styles.subjectSelector}>
|
||||
{data.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)}
|
||||
>
|
||||
<span className={styles.subjName}>{subj.Name}</span>
|
||||
<span className={styles.questionCount}>
|
||||
[ {subj.Questions.length} ]
|
||||
</span>
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
)
|
||||
return (
|
||||
<div
|
||||
className={
|
||||
activeSubjName === subj.Name
|
||||
? 'subjItem activeSubjItem'
|
||||
: 'subjItem'
|
||||
}
|
||||
key={i}
|
||||
onClick={() => onSubjSelect(subj.Name)}
|
||||
>
|
||||
<span className={styles.subjName}>{subj.Name}</span>
|
||||
<span className={styles.questionCount}>
|
||||
[ {subj.Questions.length} ]
|
||||
</span>
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue