From 748a2d826c014fb9ef972ad94ccd24b1623f0e3f Mon Sep 17 00:00:00 2001 From: MrFry Date: Sun, 22 Mar 2020 16:58:43 +0100 Subject: [PATCH] Merged subject browser / question searcher, showing questions count on subject browser --- src/components/SubjectSelector.js | 9 ++++++++- src/data/tabs.json | 6 +++++- src/defaultStyles.css | 3 +++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/components/SubjectSelector.js b/src/components/SubjectSelector.js index 732eea5..ed194e4 100644 --- a/src/components/SubjectSelector.js +++ b/src/components/SubjectSelector.js @@ -1,5 +1,7 @@ // TODO: add number next to it +import styles from './SubjectSelector.module.css' + export default function SubjectSelector (props) { const { activeSubjName, searchTerm, data, onSubjSelect } = props @@ -19,7 +21,12 @@ export default function SubjectSelector (props) { key={i} onClick={() => onSubjSelect(subj.Name)} > - {subj.Name} + + {subj.Name} + + + [ {subj.Questions.length} ] + ) })} diff --git a/src/data/tabs.json b/src/data/tabs.json index a008598..e0a4845 100644 --- a/src/data/tabs.json +++ b/src/data/tabs.json @@ -9,7 +9,11 @@ }, "allQuestions": { "href": "/allQuestions", - "text": "All question" + "text": "Kérdés keresés" + }, + "subjBrowser": { + "href": "/subjectBrowser", + "text": "Tárgyak" }, "repos": { "href": "/repos", diff --git a/src/defaultStyles.css b/src/defaultStyles.css index 4fc48da..f639233 100644 --- a/src/defaultStyles.css +++ b/src/defaultStyles.css @@ -214,6 +214,9 @@ body { font-size: 18px; padding: 3px; cursor: pointer; + float: 1; + display: flex; + justify-content: space-between; } .activeSubjItem {