mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
User specific motd changes (again)
This commit is contained in:
parent
121e43c4e6
commit
23dc6197ad
4 changed files with 62 additions and 24 deletions
|
@ -12,7 +12,7 @@ function MyApp({ Component, pageProps, router }) {
|
|||
const [motd, setMotd] = useState()
|
||||
const [userSpecificMotd, setUserSpecificMotd] = useState()
|
||||
|
||||
useEffect(() => {
|
||||
const getGlobalProps = () => {
|
||||
fetch(`${constants.apiUrl}infos?motd=true`, {
|
||||
credentials: 'include',
|
||||
Accept: 'application/json',
|
||||
|
@ -26,6 +26,10 @@ function MyApp({ Component, pageProps, router }) {
|
|||
setMotd(data.motd)
|
||||
setUserSpecificMotd(data.userSpecificMotd)
|
||||
})
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
getGlobalProps()
|
||||
}, [])
|
||||
|
||||
const globalData = {
|
||||
|
@ -35,8 +39,17 @@ function MyApp({ Component, pageProps, router }) {
|
|||
}
|
||||
|
||||
return (
|
||||
<Layout route={router.route} globalData={globalData}>
|
||||
<Component {...pageProps} router={router} globalData={globalData} />
|
||||
<Layout
|
||||
route={router.route}
|
||||
globalData={globalData}
|
||||
refetchGlobalData={getGlobalProps}
|
||||
>
|
||||
<Component
|
||||
{...pageProps}
|
||||
router={router}
|
||||
globalData={globalData}
|
||||
refetchGlobalData={getGlobalProps}
|
||||
/>
|
||||
</Layout>
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue