Merged subject browser / question searcher, showing questions count on subject browser

This commit is contained in:
MrFry 2020-03-22 16:58:43 +01:00
parent a0f2bf26b3
commit 748a2d826c
3 changed files with 16 additions and 2 deletions

View file

@ -1,5 +1,7 @@
// TODO: add number next to it // TODO: add number next to it
import styles from './SubjectSelector.module.css'
export default function SubjectSelector (props) { export default function SubjectSelector (props) {
const { activeSubjName, searchTerm, data, onSubjSelect } = props const { activeSubjName, searchTerm, data, onSubjSelect } = props
@ -19,7 +21,12 @@ export default function SubjectSelector (props) {
key={i} key={i}
onClick={() => onSubjSelect(subj.Name)} onClick={() => onSubjSelect(subj.Name)}
> >
{subj.Name} <span>
{subj.Name}
</span>
<span className={styles.questionCount}>
[ {subj.Questions.length} ]
</span>
</div> </div>
) )
})} })}

View file

@ -9,7 +9,11 @@
}, },
"allQuestions": { "allQuestions": {
"href": "/allQuestions", "href": "/allQuestions",
"text": "All question" "text": "Kérdés keresés"
},
"subjBrowser": {
"href": "/subjectBrowser",
"text": "Tárgyak"
}, },
"repos": { "repos": {
"href": "/repos", "href": "/repos",

View file

@ -214,6 +214,9 @@ body {
font-size: 18px; font-size: 18px;
padding: 3px; padding: 3px;
cursor: pointer; cursor: pointer;
float: 1;
display: flex;
justify-content: space-between;
} }
.activeSubjItem { .activeSubjItem {