mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
Home page and pw request page refactor
This commit is contained in:
parent
f159b9379c
commit
0ea9ecb5a3
6 changed files with 191 additions and 212 deletions
|
@ -11,7 +11,7 @@ import styles from './index.module.css'
|
|||
import links from '../data/links.json'
|
||||
import constants from '../constants.json'
|
||||
|
||||
export default function Index(props) {
|
||||
export default function Index({ router }) {
|
||||
const [motd, setMotd] = useState('loading...')
|
||||
const [userSpecificMotd, setUserSpecificMotd] = useState('loading...')
|
||||
const [news, setNews] = useState(null)
|
||||
|
@ -100,7 +100,14 @@ export default function Index(props) {
|
|||
})
|
||||
.reverse()
|
||||
|
||||
return <div className={styles.questionscontainer}>{questions}</div>
|
||||
return (
|
||||
<div>
|
||||
<div className={styles.title}>News</div>
|
||||
<hr />
|
||||
<hr />
|
||||
<div className={styles.questionscontainer}>{questions}</div>
|
||||
</div>
|
||||
)
|
||||
} else {
|
||||
return <LoadingIndicator />
|
||||
}
|
||||
|
@ -109,7 +116,9 @@ export default function Index(props) {
|
|||
const renderMotd = () => {
|
||||
return (
|
||||
<div>
|
||||
<div className={styles.motdHeader}>MOTD:</div>
|
||||
<div className={styles.title}>MOTD</div>
|
||||
<hr />
|
||||
<hr />
|
||||
<div
|
||||
className={styles.motd}
|
||||
dangerouslySetInnerHTML={{ __html: motd }}
|
||||
|
@ -134,20 +143,26 @@ export default function Index(props) {
|
|||
|
||||
return (
|
||||
<div>
|
||||
{renderMotd()}
|
||||
{userSpecificMotd && renderUserSpecificMotd()}
|
||||
<center>
|
||||
<div className={styles.buttonContainer}>
|
||||
{Object.keys(links).map((key) => {
|
||||
let link = links[key]
|
||||
return (
|
||||
<span className="link" key={key}>
|
||||
<a href={link.href}>
|
||||
<div className={styles.button}>{link.text}</div>
|
||||
</a>
|
||||
</span>
|
||||
<div
|
||||
className={styles.button}
|
||||
key={key}
|
||||
onClick={() => {
|
||||
router.push(link.href)
|
||||
}}
|
||||
>
|
||||
{link.text}
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</center>
|
||||
</div>
|
||||
<hr />
|
||||
{renderMotd()}
|
||||
{userSpecificMotd && renderUserSpecificMotd()}
|
||||
<hr />
|
||||
<Sleep />
|
||||
{renderNews()}
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue