diff --git a/src/components/layout.js b/src/components/layout.js
index e538615..65e56ab 100644
--- a/src/components/layout.js
+++ b/src/components/layout.js
@@ -1,10 +1,11 @@
import Link from 'next/link'
import tabs from '../data/tabs.json'
+import constants from '../constants.json'
// TODO: activelink prop to set link to active
export default function Layout (props) {
- const { currPageName } = props
+ const href = '' // TODO
return (
{props.children}
diff --git a/src/data/links.json b/src/data/links.json
index 85e0ca7..ea27f66 100644
--- a/src/data/links.json
+++ b/src/data/links.json
@@ -1,18 +1,22 @@
{
"install": {
- "href": "/install",
+ "href": "install",
"text": "Install"
},
+ "data": {
+ "href": "data.json",
+ "text": "Összes kérdés JSON"
+ },
"server": {
- "href": "/servergit",
+ "href": "servergit",
"text": "Szerver repó"
},
"client": {
- "href": "/scriptgit",
+ "href": "scriptgit",
"text": "Script git"
},
"classes": {
- "href": "/classesgit",
+ "href": "classesgit",
"text": "Classes git"
}
}
diff --git a/src/data/tabs.json b/src/data/tabs.json
index f29d916..4634115 100644
--- a/src/data/tabs.json
+++ b/src/data/tabs.json
@@ -11,6 +11,14 @@
"href": "/allQuestions",
"text": "All question"
},
+ "feedback": {
+ "href": "/feedback",
+ "text": "Feedback"
+ },
+ "testSender": {
+ "href": "/testSender",
+ "text": "Test Sender"
+ },
"userQuestions": {
"href": "/userQuestions",
"text": "User Questions"
diff --git a/src/defaultStyles.css b/src/defaultStyles.css
index ac1c17e..81cf34d 100644
--- a/src/defaultStyles.css
+++ b/src/defaultStyles.css
@@ -20,6 +20,16 @@ body {
text-decoration: none;
}
+.motdHeader {
+ text-align: center;
+ font-size: 24px;
+}
+
+.motd {
+ text-align: center;
+ font-size: 20px;
+}
+
.sidebar {
margin: 0;
padding: 0;
diff --git a/src/pages/_app.js b/src/pages/_app.js
index 9c15648..bad7188 100644
--- a/src/pages/_app.js
+++ b/src/pages/_app.js
@@ -1,9 +1,14 @@
// import App from 'next/app'
import '../defaultStyles.css'
+import Layout from '../components/layout'
function MyApp ({ Component, pageProps }) {
- return
+ return (
+
+
+
+ )
}
// Only uncomment this method if you have blocking data requirements for
diff --git a/src/pages/allQuestions.js b/src/pages/allQuestions.js
index 89e4126..4e080b9 100644
--- a/src/pages/allQuestions.js
+++ b/src/pages/allQuestions.js
@@ -4,7 +4,6 @@ import fetch from 'unfetch'
import LoadingIndicator from '../components/LoadingIndicator.js'
import Subject from '../components/Subject.js'
import SubjectSelector from '../components/SubjectSelector.js'
-import Layout from '../components/layout'
import constants from '../constants.json'
@@ -30,37 +29,33 @@ export default function AllQuestions (props) {
})
return (
-
+
-
+
{ setActiveSubjName(subjName) }}
+ />
+
+
+
+
+
)
} else {
return (
-
-
-
+
)
}
}
diff --git a/src/pages/feedback.js b/src/pages/feedback.js
index 5056313..d4bc6ef 100644
--- a/src/pages/feedback.js
+++ b/src/pages/feedback.js
@@ -1,7 +1,24 @@
+import constants from '../constants.json'
+
export default function Feedback (props) {
+ // TODO: textarea style to css
+ // TODO: response to user that msg is sucessfully sent
return (
)
}
diff --git a/src/pages/home.js b/src/pages/home.js
index 37290ef..993f616 100644
--- a/src/pages/home.js
+++ b/src/pages/home.js
@@ -1,28 +1,31 @@
import React, { PureComponent } from 'react'
import links from './links.json'
+import constants from '../constants.json'
+// TODO: aludni
class HomeTab extends PureComponent {
render () {
- return (
-
- {Object.keys(links).map((key) => {
- let link = links[key]
- return (
-
- )
- })}
-
- )
+ return (HAAAAAAAAAA
)
+ // return (
+ //
+ // {Object.keys(links).map((key) => {
+ // const link = links[key]
+ // return (
+ //
+ // )
+ // })}
+ //
+ // )
}
}
diff --git a/src/pages/index.js b/src/pages/index.js
index 3961850..f8de196 100644
--- a/src/pages/index.js
+++ b/src/pages/index.js
@@ -1,35 +1,60 @@
-
// TODO: css remove unnecesarry stuff
// TODO: resizing
-// TODO: fetch data only once?
-// TODO: move manual to this module instead of api
-// TODO: feedback tab
// TODO: motd
-import Layout from '../components/layout'
+// TODO: aludni
+// TODO: fetch only once
+import React, { useState, useEffect } from 'react'
+import fetch from 'unfetch'
import links from '../data/links.json'
-// import constants from '../constants.json'
+import constants from '../constants.json'
export default function Index (props) {
- return (
-
+ const [motd, setMotd] = useState('loading...')
+
+ useEffect(() => {
+ console.info('Fetching data')
+ fetch(`${constants.serverUrl}motd`)
+ .then((resp) => {
+ return resp.text()
+ })
+ .then((data) => {
+ setMotd(data)
+ })
+ }, [])
+
+ const renderMotd = () => {
+ return (
- {Object.keys(links).map((key) => {
- let link = links[key]
- return (
-
- )
- })}
+
+ MOTD:
+
+
-
+ )
+ }
+
+ return (
+
+ {renderMotd()}
+ {Object.keys(links).map((key) => {
+ let link = links[key]
+ return (
+
+ )
+ })}
+
)
}
diff --git a/src/pages/manual.js b/src/pages/manual.js
index 9fbd4ab..9fc4fa9 100644
--- a/src/pages/manual.js
+++ b/src/pages/manual.js
@@ -1,10 +1,9 @@
-import Layout from '../components/layout'
export default function Manual (props) {
return (
-
+
{renderMaual()}
-
+
)
}
diff --git a/src/pages/userQuestions.js b/src/pages/userQuestions.js
index 1bb2550..57a47fb 100644
--- a/src/pages/userQuestions.js
+++ b/src/pages/userQuestions.js
@@ -1,7 +1,6 @@
import React, { useState, useEffect } from 'react'
import LoadingIndicator from '../components/LoadingIndicator'
-import Layout from '../components/layout'
import constants from '../constants.json'
@@ -40,17 +39,13 @@ export default function UserQuestions (props) {
}).reverse()
return (
-
-
- {questions}
-
-
+
+ {questions}
+
)
} else {
return (
-
-
-
+
)
}
}