Changed lotsa stuff 2

This commit is contained in:
mrfry 2021-03-23 20:00:52 +01:00
parent 7bb7b919ae
commit 1f90e62ac3
10 changed files with 119 additions and 190 deletions

View file

@ -1,4 +1,4 @@
import React, { PureComponent } from 'react'
import React from 'react'
import Questions from './Questions.js'
@ -8,10 +8,7 @@ const countReducer = (acc, subj) => {
return acc + subj.Questions.length
}
class QuestionSearchResult extends PureComponent {
render() {
const { data, searchTerm } = this.props
export default function QuestionSearchResult({ data, searchTerm }) {
let subjs = []
let results = -1
@ -51,13 +48,11 @@ class QuestionSearchResult extends PureComponent {
<div>
<div>
{searchTerm ? '' : 'Kezdj el írni kereséshez! '}
{`${results} találat, ${subjs.length} tárgyból`}
{`${results} találat, ${subjs.length || data.length} tárgyból`}
</div>
{results === 0 && (
<div>
{
'Pontos egyezést keres a kereső, próbálj kisebb részletre keresni'
}
{'Pontos egyezést keres a kereső, próbálj kisebb részletre keresni'}
</div>
)}
</div>
@ -65,7 +60,14 @@ class QuestionSearchResult extends PureComponent {
}
if (results > constants.maxQuestionsToRender) {
return renderCount()
return (
<div>
{renderCount()}
{searchTerm ? (
<div>Szűkítsd a keresést találatok megjelenítéséhez!</div>
) : null}
</div>
)
} else {
return (
<div>
@ -76,7 +78,4 @@ class QuestionSearchResult extends PureComponent {
</div>
)
}
}
}
export default QuestionSearchResult

View file

@ -192,13 +192,13 @@ export default function Layout({
) : null}
</div>
{donateShowing ? (
<Layout
<Modal
closeClick={() => {
setDonateShowing(false)
}}
>
<div>hi</div>
</Layout>
</Modal>
) : null}
{showMotdModal ? (
<Modal

View file

@ -30,7 +30,7 @@ textarea {
color: var(--text-color);
background-color: var(--background-color);
box-sizing: border-box;
height: 120px;
height: 140px;
width: 100%;
border: 1px solid #666;
border-radius: 3px;
@ -39,10 +39,14 @@ textarea {
input {
color: var(--text-color);
background-color: var(--background-color);
border: 1px solid #444;
border: 0px solid #444;
width: 100%;
}
input:focus {
border: 0px solid #444;
}
.link {
margin: 20px;
font-size: 20px;

View file

@ -6,6 +6,7 @@ import QuestionSearchResult from '../components/QuestionSearchResult.js'
import Subject from '../components/Subject.js'
import SubjectSelector from '../components/SubjectSelector.js'
import Sleep from '../components/sleep'
import ExternalLinkIcon from '../components/externalLinkIcon'
import styles from './allQuestions.module.css'
@ -258,7 +259,6 @@ export default function AllQuestions({ router }) {
>
Tárgyak
</div>
<div>
<a
onClick={() => {
if (selectedDb === 'all') {
@ -270,12 +270,11 @@ export default function AllQuestions({ router }) {
)
}
}}
className={styles.button}
>
{'Kérdések letöltése'}
<ExternalLinkIcon size={15} />
</a>
</div>
</div>
{fetchingData ? (
<LoadingIndicator />
) : (

View file

@ -11,7 +11,3 @@
cursor: pointer;
border: none;
}
.activeTypeSelector {
background-color: #444;
}

View file

@ -1,8 +1,9 @@
import React, { useState } from 'react'
import React from 'react'
import Head from 'next/head'
import FeedbackArea from '../components/feedbackArea'
import styles from './contact.module.css'
import constants from '../constants.json'
const contactMethods = {
irc: {
@ -21,74 +22,13 @@ const contactMethods = {
},
}
function submitFeedback(msg) {
return new Promise((resolve) => {
fetch(constants.apiUrl + 'postfeedback', {
method: 'POST',
credentials: 'include',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
newTask: msg,
from: 'contribute',
}),
})
.then((resp) => {
return resp.json()
})
.then((resp) => {
if (resp.success) {
resolve()
} else {
alert('Hiba küldés közben')
}
})
.catch((err) => {
alert('Hiba küldés közben')
console.error(err)
})
})
}
export default function Contact() {
const [feedback, setFeedback] = useState('')
const feedbackArea = () => {
return (
<div className={styles.inputArea}>
<textarea
onChange={(event) => setFeedback(event.target.value)}
value={feedback}
className={styles.feedback}
/>
<div className={'buttonContainer'}>
<div
onClick={() => {
if (feedback) {
submitFeedback(feedback).then(() => {
alert('Elküldve')
setFeedback('')
})
} else {
alert('Adj meg valami üzenetet ...')
}
}}
>
Küldés
</div>
</div>
</div>
)
}
return (
<div>
<Head>
<title>Kapcsolat - Qmining | Frylabs.net</title>
</Head>
{feedbackArea()}
<FeedbackArea from={'contact'} />
<div className={styles.contactsContainer}>
<div>Itt vannak hogy hogy lehet kontaktolni</div>
{Object.keys(contactMethods).map((key) => {

View file

@ -23,16 +23,3 @@
.contactsContainer > div > div:nth-child(2) {
flex: 1;
}
.feedback {
color: var(--text-color);
background-color: var(--background-color);
font-size: 14px;
width: 100%;
box-sizing: border-box;
height: 60px;
}
.inputArea {
display: flex;
}

View file

@ -3,6 +3,7 @@ import Head from 'next/head'
import Sleep from '../components/sleep'
import Todos from '../components/todoStuff/todos'
import FeedbackArea from '../components/feedbackArea'
import constants from '../constants.json'
import styles from './contribute.module.css'
@ -37,6 +38,7 @@ export default function contribute() {
Itt írhatsz új todo-ra ötleteket, vagy jelezhetsz hogy egyikben
segítenél
</div>
<FeedbackArea from={'contribute'} />
<hr />
<Todos />
<Sleep />

View file

@ -1,11 +1,12 @@
import React, { useState, useEffect } from 'react'
import fetch from 'unfetch'
import Head from 'next/head'
import Link from 'next/link'
import styles from './pwRequest.module.css'
import constants from '../constants.json'
export default function PwRequest(props) {
export default function PwRequest() {
const [result, setResult] = useState([])
const [remaining, setRemaining] = useState('...')
const [requestedPWS, setRequestedPWS] = useState('...')
@ -56,7 +57,7 @@ export default function PwRequest(props) {
setResult([...result, resp.pw])
setRemaining(resp.remaining)
setRequestedPWS(resp.requestedPWS)
} else if (resp.result === 'success') {
} else if (resp.result === 'nouser') {
setResult(['Nem vagy bejelentkezve!']) // this should never happpen
} else {
setResult([
@ -99,11 +100,11 @@ export default function PwRequest(props) {
egyet és add oda másnak, mint hogy közösen használjatok egyet, mert
egyszerre, egy felhasználó csak egy helyen, egy eszközön lehet
belépve, mindenhol máshol automatikusan kijelentkeztetésre kerül. A
jelszavakról bővebben a Script használata oldal{' '}
<a href="/manual#pw" target="_blank">
vonatkozó részén
</a>{' '}
olvashatsz.
jelszavakról bővebben a{' '}
<Link href="/faq">
<a>GYIK</a>
</Link>
-ben olvashatsz.
</p>
</div>
<div className={styles.text}>

View file

@ -13,12 +13,12 @@ export default function Script() {
</Head>
<div className={'buttonContainer'}>
<a href="https://www.tampermonkey.net/">
Ajánlott userscript bővítmény
<ExternalLinkIcon size={20} />
Ajánlott userscript kezelő bővítmény
<ExternalLinkIcon size={15} />
</a>
<a href="/install">
Script telepítése
<ExternalLinkIcon size={20} />
<ExternalLinkIcon size={15} />
</a>
</div>
<Sleep />
@ -31,14 +31,14 @@ function renderManual() {
return (
<>
<center>
<h2 className={'subtitle'}>A userscript használata</h2>
<h2 className={'subtitle'}>A userscript telepítése, és használata</h2>
</center>
<div>
<p>
Ez a userscript Moodle/Elearnig/KMOOC tesztek megoldása során
segítséget jelenít meg.
</p>
<ul>
<ol>
<li>
Tölts le egy userscript futtató kiegészítőt a böngésződhöz: pl. a{' '}
<a
@ -52,7 +52,7 @@ function renderManual() {
</li>
<li>
<a
href="http://qmining.frylabs.net/install?man"
href="http://qmining.frylabs.net/install"
target="_blank"
rel="noreferrer"
>
@ -61,24 +61,28 @@ function renderManual() {
</li>
<li>
A script ezt követően udvariasan megkér, hogy hadd beszélgessen a
szerverrel, mert mással nem tud, ezért ezt engedélyezd neki.
szerverrel, ezt engedélyezd neki. (Always allow domain)
</li>
<li>
A kitöltendő teszt oldalán a kérdésre a választ kell látnod felül
egy lebegő ablakban.
A támogatott oldalakon a script egy apró menü ablakot jelenít meg a
weboldal bal alsó részén
</li>
<li>
Ezután a kitöltendő teszt oldalán a kérdésre a választ kell látnod
felül egy lebegő ablakban.
</li>
<li>
Teszt ellenőrzés oldalon a script beküldi a szervernek a helyes
válaszokat, az lementi az új kérdéseket, amik ezután azonnal
elérhetők lesznek (neked, és másoknak is)
</li>
</ul>
</ol>
Egyéb fontos tudnivalók:
<ul>
<li>
Ezt ments sokszor akár minden nap:{' '}
<a
href="http://qmining.frylabs.net/allqr.txt?man"
href="http://qmining.frylabs.net/allqr.txt"
target="_blank"
rel="noreferrer"
>
@ -96,13 +100,10 @@ function renderManual() {
scripttel.
</li>
</ul>
<div>
Ha útközben elakadsz, vagy hibát észlelsz, akkor oldalt a Kapcsolat
résznél sok elérhetőséget találsz, amin segítséget kérhetsz.
</div>
<div className={'rtfmImage'}>
<img
style={{ maxWidth: '100%', minWidth: '200px' }}
src="img/rtfm.jpg"
alt="img"
/>
</div>
</>
)