- {subj.Questions.map((qo, i) => {
- const question = qo.q
- const unsaved = qo.unsaved
+ return (
+
- )
- }
+ )
+ }
}
export default Questions
diff --git a/src/components/Subject.js b/src/components/Subject.js
index 7f9f32e..8a0d29c 100644
--- a/src/components/Subject.js
+++ b/src/components/Subject.js
@@ -6,96 +6,98 @@ import styles from './subject.module.css'
import commonStyles from '../commonStyles.module.css'
function DeletedQuestion({ reset }) {
- return (
-
-
Törölt kérdés
-
-
{
- reset()
- }}
- >
- Visszaállítás
+ return (
+
+
Törölt kérdés
+
+
{
+ reset()
+ }}
+ >
+ Visszaállítás
+
+
-
-
- )
+ )
}
export default function Subject(props) {
- const {
- subj,
- unsavedIndexes,
- deletedIndexes,
- editedIndexes,
- resetQuestion,
- handleQuestionChange,
- saveQuestion,
- deleteQuestion,
- } = props
+ const {
+ subj,
+ unsavedIndexes,
+ deletedIndexes,
+ editedIndexes,
+ resetQuestion,
+ handleQuestionChange,
+ saveQuestion,
+ deleteQuestion,
+ } = props
- if (subj) {
- return (
-
- {subj.Questions.map((question, i) => {
- // FIXME: list edited questions first?
- const unsaved = unsavedIndexes.includes(i)
- const edited = editedIndexes.includes(i)
- const deleted = deletedIndexes.includes(i)
- return (
-
-
- {deleted ? (
- {
- resetQuestion(i)
- }}
- index={i}
- />
- ) : (
-
-
{
- handleQuestionChange(newq, i)
- }}
- question={question}
- />
-
-
{
- resetQuestion(i)
- }}
- >
- Visszaállítás
-
-
{
- saveQuestion(i)
- }}
- >
- {edited ? 'Kérdés mentve' : 'Kérdés mentése'}
-
-
{
- deleteQuestion(i)
- }}
- >
- Kérdés törlése
-
-
-
- )}
-
- )
- })}
-
- )
- } else {
- return
- }
+ if (subj) {
+ return (
+
+ {subj.Questions.map((question, i) => {
+ // FIXME: list edited questions first?
+ const unsaved = unsavedIndexes.includes(i)
+ const edited = editedIndexes.includes(i)
+ const deleted = deletedIndexes.includes(i)
+ return (
+
+
+ {deleted ? (
+ {
+ resetQuestion(i)
+ }}
+ index={i}
+ />
+ ) : (
+
+
{
+ handleQuestionChange(newq, i)
+ }}
+ question={question}
+ />
+
+
{
+ resetQuestion(i)
+ }}
+ >
+ Visszaállítás
+
+
{
+ saveQuestion(i)
+ }}
+ >
+ {edited
+ ? 'Kérdés mentve'
+ : 'Kérdés mentése'}
+
+
{
+ deleteQuestion(i)
+ }}
+ >
+ Kérdés törlése
+
+
+
+ )}
+
+ )
+ })}
+
+ )
+ } else {
+ return
+ }
}
diff --git a/src/components/SubjectSelector.js b/src/components/SubjectSelector.js
index 3c06fab..52c6202 100644
--- a/src/components/SubjectSelector.js
+++ b/src/components/SubjectSelector.js
@@ -3,32 +3,34 @@ import React from 'react'
import styles from './SubjectSelector.module.css'
export default function SubjectSelector(props) {
- const { activeSubjName, searchTerm, data, onSubjSelect } = props
+ const { activeSubjName, searchTerm, data, onSubjSelect } = props
- return (
-
- {data.map((subj, i) => {
- if (!subj.Name.toLowerCase().includes(searchTerm.toLowerCase())) {
- return null
- }
+ return (
+
+ {data.map((subj, i) => {
+ if (
+ !subj.Name.toLowerCase().includes(searchTerm.toLowerCase())
+ ) {
+ return null
+ }
- return (
-
onSubjSelect(subj.Name)}
- >
- {subj.Name}
-
- [ {subj.Questions.length} ]
-
-
- )
- })}
-
- )
+ return (
+
onSubjSelect(subj.Name)}
+ >
+ {subj.Name}
+
+ [ {subj.Questions.length} ]
+
+
+ )
+ })}
+
+ )
}
diff --git a/src/components/dbSelector.js b/src/components/dbSelector.js
index f0cfe1f..e4ea5ca 100644
--- a/src/components/dbSelector.js
+++ b/src/components/dbSelector.js
@@ -1,37 +1,39 @@
import React from 'react'
export default function DbSelector(props) {
- const { selectedDb, qdbs, onChange, hideLockedDbs } = props
- const selectedIndex =
- qdbs && selectedDb
- ? qdbs.findIndex((qdb) => {
- return qdb.name === selectedDb.name
- })
- : -1
+ const { selectedDb, qdbs, onChange, hideLockedDbs } = props
+ const selectedIndex =
+ qdbs && selectedDb
+ ? qdbs.findIndex((qdb) => {
+ return qdb.name === selectedDb.name
+ })
+ : -1
- return (
- <>
-
{
- onChange(qdbs[event.target.value])
- }}
- >
- {' -- Válassz egy kérdés adatbázist -- '}
- {qdbs.map((qdb, i) => {
- if (hideLockedDbs && qdb.locked) {
- return null
- }
+ return (
+ <>
+ {
+ onChange(qdbs[event.target.value])
+ }}
+ >
+
+ {' -- Válassz egy kérdés adatbázist -- '}
+
+ {qdbs.map((qdb, i) => {
+ if (hideLockedDbs && qdb.locked) {
+ return null
+ }
- return (
-
- {qdb.name}
-
- )
- })}
-
- >
- )
+ return (
+
+ {qdb.name}
+
+ )
+ })}
+
+ >
+ )
}
diff --git a/src/components/searchBar.js b/src/components/searchBar.js
index a4de0c9..1da37a8 100644
--- a/src/components/searchBar.js
+++ b/src/components/searchBar.js
@@ -3,26 +3,26 @@ import React from 'react'
import styles from './searchBar.module.css'
export default function SearchBar(props) {
- const { onChange, value } = props
- return (
-
- {
- onChange(e.target.value)
- }}
- />
- {
- onChange('')
- }}
- className={styles.clearButton}
- >
- ❌
-
-
- )
+ const { onChange, value } = props
+ return (
+
+ {
+ onChange(e.target.value)
+ }}
+ />
+ {
+ onChange('')
+ }}
+ className={styles.clearButton}
+ >
+ ❌
+
+
+ )
}
diff --git a/src/pages/_app.js b/src/pages/_app.js
index 54eda57..414a5d5 100644
--- a/src/pages/_app.js
+++ b/src/pages/_app.js
@@ -4,7 +4,7 @@ import React from 'react'
import '../defaultStyles.css'
function MyApp({ Component, pageProps, router }) {
- return
+ return
}
// Only uncomment this method if you have blocking data requirements for