small improvements
This commit is contained in:
parent
b6d9c65392
commit
f535dc134c
|
@ -1,7 +1,7 @@
|
|||
import { PrismaClient } from '@prisma/client'
|
||||
|
||||
if (!global.prisma) {
|
||||
global.prisma = new PrismaClient()
|
||||
}
|
||||
const prisma = global.prisma || new PrismaClient()
|
||||
|
||||
export default global.prisma
|
||||
if (process.env.NODE_ENV === 'development') global.prisma = prisma
|
||||
|
||||
export default prisma
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import Layout from './layout'
|
||||
import styles from './layout-center.module.css'
|
||||
|
||||
export default function LayoutCenter ({ children }) {
|
||||
export default function LayoutCenter ({ children, ...props }) {
|
||||
return (
|
||||
<div className={styles.page}>
|
||||
<Layout noContain>
|
||||
<Layout noContain {...props}>
|
||||
<div className={styles.content}>
|
||||
{children}
|
||||
</div>
|
||||
|
|
|
@ -5,7 +5,7 @@ import { LightningProvider } from './lightning'
|
|||
import { useRouter } from 'next/router'
|
||||
import Footer from './footer'
|
||||
|
||||
export default function Layout ({ noContain, children }) {
|
||||
export default function Layout ({ noContain, noFooter, children }) {
|
||||
const router = useRouter()
|
||||
const defaultTitle = router.asPath.split('?')[0].slice(1)
|
||||
return (
|
||||
|
@ -23,7 +23,7 @@ export default function Layout ({ noContain, children }) {
|
|||
{children}
|
||||
</Container>
|
||||
)}
|
||||
<Footer />
|
||||
{!noFooter && <Footer />}
|
||||
</LightningProvider>
|
||||
</>
|
||||
)
|
||||
|
|
|
@ -25,7 +25,8 @@
|
|||
"react-dom": "17.0.1",
|
||||
"sass": "^1.32.8",
|
||||
"swr": "^0.5.4",
|
||||
"yup": "^0.32.9"
|
||||
"yup": "^0.32.9",
|
||||
"prisma": "^2.23.0"
|
||||
},
|
||||
"standard": {
|
||||
"parser": "babel-eslint",
|
||||
|
@ -44,7 +45,6 @@
|
|||
"babel-plugin-inline-react-svg": "^2.0.1",
|
||||
"eslint": "^7.22.0",
|
||||
"eslint-plugin-compat": "^3.9.0",
|
||||
"prisma": "^2.23.0",
|
||||
"standard": "^16.0.3"
|
||||
}
|
||||
}
|
|
@ -50,7 +50,7 @@ export default function login ({ providers, csrfToken, error }) {
|
|||
const [errorMessage, setErrorMessage] = useState(error && (errors[error] ?? errors.default))
|
||||
|
||||
return (
|
||||
<LayoutCenter>
|
||||
<LayoutCenter noFooter>
|
||||
<div className={styles.login}>
|
||||
{errorMessage &&
|
||||
<Alert variant='danger' onClose={() => setErrorMessage(undefined)} dismissible>{errorMessage}</Alert>}
|
||||
|
|
Loading…
Reference in New Issue