mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
Snow rendering changes, allquestions page fixes and improvements
This commit is contained in:
parent
d15e79e6ac
commit
5a1bd258bc
3 changed files with 34 additions and 28 deletions
|
@ -4,6 +4,10 @@ import Questions from './Questions.js'
|
|||
|
||||
import constants from '../constants.json'
|
||||
|
||||
const countReducer = (acc, subj) => {
|
||||
return acc + subj.Questions.length
|
||||
}
|
||||
|
||||
class QuestionSearchResult extends PureComponent {
|
||||
render() {
|
||||
const { data, searchTerm } = this.props
|
||||
|
@ -11,10 +15,6 @@ class QuestionSearchResult extends PureComponent {
|
|||
let subjs = []
|
||||
let results = -1
|
||||
|
||||
const countReducer = (acc, subj) => {
|
||||
return acc + subj.Questions.length
|
||||
}
|
||||
|
||||
if (searchTerm) {
|
||||
subjs = data.reduce((acc, subj) => {
|
||||
const resultQuestions = subj.Questions.reduce((qacc, question) => {
|
||||
|
@ -50,9 +50,8 @@ class QuestionSearchResult extends PureComponent {
|
|||
return (
|
||||
<div>
|
||||
<div>
|
||||
{searchTerm ? '' : 'Kezdj el írni kereséshez!'} {results}{' '}
|
||||
{searchTerm ? 'találat' : 'kérdés'}{' '}
|
||||
{searchTerm ? subjs.length : data.length} tárgy
|
||||
{searchTerm ? '' : 'Kezdj el írni kereséshez! '}
|
||||
{`${results} találat, ${subjs.length} tárgyból`}
|
||||
</div>
|
||||
{results === 0 && (
|
||||
<div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue