mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
Header changes
This commit is contained in:
parent
b9248f2699
commit
e935de7e78
10 changed files with 39 additions and 22 deletions
|
@ -6,7 +6,7 @@ import Sleep from '../components/sleep'
|
|||
import constants from '../constants.json'
|
||||
|
||||
class QuestionSearchResult extends PureComponent {
|
||||
render () {
|
||||
render() {
|
||||
const { data, searchTerm } = this.props
|
||||
|
||||
let subjs = []
|
||||
|
@ -19,12 +19,15 @@ class QuestionSearchResult extends PureComponent {
|
|||
if (searchTerm) {
|
||||
subjs = data.reduce((acc, subj) => {
|
||||
const resultQuestions = subj.Questions.reduce((qacc, question) => {
|
||||
const keys = [ 'Q', 'A', 'data' ]
|
||||
const keys = ['Q', 'A', 'data']
|
||||
keys.some((key) => {
|
||||
if (typeof question[key] !== 'string') {
|
||||
return false
|
||||
}
|
||||
if (question[key] && question[key].toLowerCase().includes(searchTerm.toLowerCase())) {
|
||||
if (
|
||||
question[key] &&
|
||||
question[key].toLowerCase().includes(searchTerm.toLowerCase())
|
||||
) {
|
||||
qacc.push(question)
|
||||
return true
|
||||
}
|
||||
|
@ -34,7 +37,7 @@ class QuestionSearchResult extends PureComponent {
|
|||
if (resultQuestions.length > 0) {
|
||||
acc.push({
|
||||
Name: subj.Name,
|
||||
Questions: resultQuestions
|
||||
Questions: resultQuestions,
|
||||
})
|
||||
}
|
||||
return acc
|
||||
|
@ -48,8 +51,17 @@ 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}{' '}
|
||||
{searchTerm ? 'találat' : 'kérdés'}{' '}
|
||||
{searchTerm ? subjs.length : data.length} tárgy
|
||||
</div>
|
||||
{results === 0 && (
|
||||
<div>
|
||||
{
|
||||
'Pontos egyezést keres a kereső, próbálj kisebb részletre keresni'
|
||||
}
|
||||
</div>
|
||||
)}
|
||||
<Sleep />
|
||||
</div>
|
||||
)
|
||||
|
@ -59,14 +71,10 @@ class QuestionSearchResult extends PureComponent {
|
|||
return renderCount()
|
||||
} else {
|
||||
return (
|
||||
<div >
|
||||
<div>
|
||||
<div>{renderCount()}</div>
|
||||
<div>
|
||||
{renderCount()}
|
||||
</div>
|
||||
<div>
|
||||
<Questions
|
||||
subjs={subjs}
|
||||
/>
|
||||
<Questions subjs={subjs} />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
|
|
@ -306,7 +306,7 @@ export default function AddQuestion() {
|
|||
return (
|
||||
<div>
|
||||
<Head>
|
||||
<title>Qmining - Kérdés beküldés</title>
|
||||
<title>Qmining - Kérdés beküldés | Frylabs.net</title>
|
||||
</Head>
|
||||
{subjects ? (
|
||||
<>
|
||||
|
|
|
@ -27,12 +27,13 @@ export default function AllQuestions({ router, getData }) {
|
|||
return (
|
||||
<div>
|
||||
<Head>
|
||||
<title>Qmining - Kérdés keresés</title>
|
||||
<title>Qmining - Kérdés keresés | Frylabs.net</title>
|
||||
</Head>
|
||||
{data ? (
|
||||
<>
|
||||
<div className={styles.searchContainer}>
|
||||
<input
|
||||
autoFocus
|
||||
placeholder="Keresés..."
|
||||
className={styles.searchBar}
|
||||
type="text"
|
||||
|
|
|
@ -63,7 +63,7 @@ export default function contribute() {
|
|||
return (
|
||||
<div>
|
||||
<Head>
|
||||
<title>Qmining - Contribute / Todos</title>
|
||||
<title>Qmining - Todos | Frylabs.net</title>
|
||||
</Head>
|
||||
<div className={styles.description}>
|
||||
Egy kártyára kattintva szavazhatsz. Minél több szavazat érkezik egy
|
||||
|
@ -72,7 +72,10 @@ export default function contribute() {
|
|||
(ha van hozzá)
|
||||
</div>
|
||||
<Todos />
|
||||
<div className={styles.description}>Itt írhatsz todo-ra ötleteket </div>
|
||||
<div className={styles.description}>
|
||||
Itt írhatsz új todo-ra ötleteket, vagy jelezhetsz hogy egyikben
|
||||
segítenél
|
||||
</div>
|
||||
{renderNewTaskArea()}
|
||||
<Sleep />
|
||||
<hr />
|
||||
|
|
|
@ -32,6 +32,7 @@ export default function Feedback(props) {
|
|||
<div className={styles.inputArea}>
|
||||
<div className={styles.textTitle}>{params.text}</div>
|
||||
<textarea
|
||||
autoFocus={params.autoFocus}
|
||||
onChange={(e) => params.onChange(e)}
|
||||
value={form[params.name] || ''}
|
||||
className={styles.feedback}
|
||||
|
@ -159,6 +160,7 @@ export default function Feedback(props) {
|
|||
text: 'Rövid leírás',
|
||||
name: 'description',
|
||||
onChange: onChange,
|
||||
autoFocus: true,
|
||||
})}
|
||||
<div className={styles.desc}>
|
||||
Főoldalon lesz rá válasz MOTD-ben, amit csak te látsz (ha kell rá
|
||||
|
@ -235,7 +237,7 @@ export default function Feedback(props) {
|
|||
return (
|
||||
<div>
|
||||
<Head>
|
||||
<title>Qmining - Feedback</title>
|
||||
<title>Qmining - Feedback | Frylabs.net</title>
|
||||
</Head>
|
||||
<Button text="IRC chat" href="/irc" />
|
||||
<p />
|
||||
|
|
|
@ -146,7 +146,7 @@ export default function Index() {
|
|||
return (
|
||||
<div>
|
||||
<Head>
|
||||
<title>Qmining</title>
|
||||
<title>Qmining | Frylabs.net</title>
|
||||
</Head>
|
||||
<div className={styles.buttonContainer}>
|
||||
{Object.keys(links).map((key) => {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import React from 'react'
|
||||
|
||||
import Sleep from '../components/sleep'
|
||||
import Head from 'next/head'
|
||||
|
||||
|
@ -9,7 +11,7 @@ function renderMaual() {
|
|||
return (
|
||||
<div>
|
||||
<Head>
|
||||
<title>Qmining - Manual</title>
|
||||
<title>Manual - Qmining | Frylabs.net</title>
|
||||
</Head>
|
||||
<center>
|
||||
<h1>Manual</h1>
|
||||
|
|
|
@ -80,7 +80,7 @@ export default function PwRequest(props) {
|
|||
// TODO: újrafogalmazás, remove hány nap után kapnak új jelszót először
|
||||
<div>
|
||||
<Head>
|
||||
<title>Qmining - Jelszó kérés</title>
|
||||
<title>Qmining - Jelszó kérés | Frylabs.net</title>
|
||||
</Head>
|
||||
<div id="form">
|
||||
<div className={styles.text}>
|
||||
|
|
|
@ -127,7 +127,7 @@ export default function RankList() {
|
|||
return (
|
||||
<div>
|
||||
<Head>
|
||||
<title>Qmining - Ranklista</title>
|
||||
<title>Qmining - Ranklista | Frylabs.net</title>
|
||||
</Head>
|
||||
<div>
|
||||
<div
|
||||
|
|
|
@ -38,12 +38,13 @@ export default function SubjectBrowser({ getData }) {
|
|||
return (
|
||||
<div>
|
||||
<Head>
|
||||
<title>Qmining - Tárgyak</title>
|
||||
<title>Qmining - Tárgyak | Frylabs.net</title>
|
||||
</Head>
|
||||
{data ? (
|
||||
<>
|
||||
<div className={styles.searchContainer}>
|
||||
<input
|
||||
autoFocus
|
||||
placeholder="Keresés..."
|
||||
className={styles.searchBar}
|
||||
type="text"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue