show when logged in

This commit is contained in:
Thomas Ruoff
2020-11-08 23:39:30 +01:00
parent bd32cfb90b
commit 7fcdf680d3
3 changed files with 36 additions and 14 deletions

View File

@@ -1,10 +1,14 @@
import React from 'react'
import '../styles/index.css'
import UserContext from '../components/user/context'
export default function MyApp({ Component, pageProps }) {
const { username, role } = pageProps?.user || {}
return (
<div className="wrapper">
<Component {...pageProps} />
<UserContext.Provider value={{ username, role }}>
<Component {...pageProps} />
</UserContext.Provider>
</div>
)
}