mirror of
https://gitlab.com/MrFry/qmining-data-editor
synced 2025-04-01 20:24:01 +02:00
Data.json new structure fix
This commit is contained in:
parent
6bc51fb387
commit
280a94398b
4 changed files with 90 additions and 83 deletions
|
@ -1,27 +1,26 @@
|
|||
import styles from './SubjectSelector.module.css'
|
||||
|
||||
export default function SubjectSelector (props) {
|
||||
export default function SubjectSelector(props) {
|
||||
const { activeSubjName, searchTerm, data, onSubjSelect } = props
|
||||
|
||||
return (
|
||||
<div className={styles.subjectSelector}>
|
||||
{data.Subjects.map((subj, i) => {
|
||||
{data.map((subj, i) => {
|
||||
if (!subj.Name.toLowerCase().includes(searchTerm.toLowerCase())) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className={activeSubjName === subj.Name
|
||||
? 'subjItem activeSubjItem'
|
||||
: 'subjItem'
|
||||
className={
|
||||
activeSubjName === subj.Name
|
||||
? 'subjItem activeSubjItem'
|
||||
: 'subjItem'
|
||||
}
|
||||
key={i}
|
||||
onClick={() => onSubjSelect(subj.Name)}
|
||||
>
|
||||
<span className={styles.subjName}>
|
||||
{subj.Name}
|
||||
</span>
|
||||
<span className={styles.subjName}>{subj.Name}</span>
|
||||
<span className={styles.questionCount}>
|
||||
[ {subj.Questions.length} ]
|
||||
</span>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue