Merge branch 'master' of gitlab.com:MrFry/qmining-page

This commit is contained in:
mrfry 2021-05-04 13:03:26 +02:00
commit e3c22aa010
5 changed files with 31 additions and 17 deletions

View file

@ -115,12 +115,9 @@ export default function Layout({
const userId = globalData.userId const userId = globalData.userId
const userSpecificMotd = globalData.userSpecificMotd const userSpecificMotd = globalData.userSpecificMotd
useEffect( useEffect(() => {
() => { setDonateShowing(!!router.query.donate)
setDonateShowing(!!router.query.donate) }, [router.query.donate])
},
[router.query.donate]
)
let href = router.route let href = router.route
if (href === '/' || href === '') { if (href === '/' || href === '') {
@ -181,9 +178,7 @@ export default function Layout({
border: 'none', border: 'none',
margin: '1px', margin: '1px',
}} }}
src={`${ src={`${constants.siteUrl}img/frylabs-logo_small_transparent.png`}
constants.siteUrl
}img/frylabs-logo_small_transparent.png`}
alt="FryLabs" alt="FryLabs"
/> />
</a> </a>
@ -195,6 +190,10 @@ export default function Layout({
<div id="sideBarLinks" className={styles.sidebarLinks}> <div id="sideBarLinks" className={styles.sidebarLinks}>
{Object.keys(tabs).map((key) => { {Object.keys(tabs).map((key) => {
const item = tabs[key] const item = tabs[key]
if (item.seperator) {
return <hr key={key} />
}
return ( return (
<Link href={item.href} key={key}> <Link href={item.href} key={key}>
<a <a

View file

@ -19,7 +19,7 @@
border-radius: 5px; border-radius: 5px;
} }
.sidebarLinks > * { .sidebarLinks > a {
display: block; display: block;
text-align: center; text-align: center;
color: black; color: black;

View file

@ -3,6 +3,9 @@
"href": "/", "href": "/",
"text": "Főoldal" "text": "Főoldal"
}, },
"s1": {
"seperator": true
},
"script": { "script": {
"href": "/script", "href": "/script",
"text": "Script" "text": "Script"
@ -11,10 +14,17 @@
"href": "/allQuestions", "href": "/allQuestions",
"text": "Kérdések és tárgyak" "text": "Kérdések és tárgyak"
}, },
"userFiles": { "userfiles": {
"href": "/userFiles", "href": "/userfiles",
"text": "Tanulás segédanyagok" "text": "Tanulás segédanyagok"
}, },
"s2": {
"seperator": true
},
"pwRequest": {
"href": "/pwRequest",
"text": "Jelszó generálás"
},
"contribute": { "contribute": {
"href": "/contribute", "href": "/contribute",
"text": "Teendők" "text": "Teendők"
@ -23,10 +33,6 @@
"href": "/ranklist", "href": "/ranklist",
"text": "Ranklista" "text": "Ranklista"
}, },
"pwRequest": {
"href": "/pwRequest",
"text": "Jelszó generálás"
},
"faq": { "faq": {
"href": "/faq", "href": "/faq",
"text": "GYIK" "text": "GYIK"
@ -34,5 +40,8 @@
"contact": { "contact": {
"href": "/contact", "href": "/contact",
"text": "Kapcsolat" "text": "Kapcsolat"
},
"s3": {
"seperator": true
} }
} }

View file

@ -5,7 +5,7 @@ import LoadingIndicator from '../components/LoadingIndicator'
import Modal from '../components/modal' import Modal from '../components/modal'
import SearchBar from '../components/searchBar' import SearchBar from '../components/searchBar'
import styles from './userFiles.module.css' import styles from './userfiles.module.css'
import constants from '../constants.json' import constants from '../constants.json'
function listUserDir(subdir) { function listUserDir(subdir) {
@ -168,6 +168,12 @@ export default function UserFiles({ router, globalData }) {
const currDir = router.query.dir ? decodeURIComponent(router.query.dir) : '' const currDir = router.query.dir ? decodeURIComponent(router.query.dir) : ''
useEffect(() => {
router.replace(`${router.asPath.replace('.html', '')}`, undefined, {
shallow: true,
})
}, [])
useEffect(() => { useEffect(() => {
const dir = router.query.dir ? decodeURIComponent(router.query.dir) : '' const dir = router.query.dir ? decodeURIComponent(router.query.dir) : ''
setDirs(null) setDirs(null)