1
0
Fork 0

chore: Fixed linter warnings

This commit is contained in:
Joost De Cock 2022-01-20 09:07:38 +01:00
parent 56df5d5287
commit 2234155052
70 changed files with 103 additions and 309 deletions

View file

@ -1,3 +1,4 @@
import React from 'react'
import { useState } from 'react'
import { useRouter } from 'next/router'
import Link from 'next/link'
@ -10,8 +11,6 @@ import Header from 'site/components/header'
import Footer from 'site/components/footer'
import Search from 'site/components/search'
const iconSize= 48
const PageTitle = ({ app, slug, title }) => {
if (title) return <h1>{title}</h1>
if (slug) return <h1>{get(app.navigation, slug.split('/')).__title}</h1>
@ -39,7 +38,7 @@ const Breadcrumbs = ({ app, slug=false, title }) => {
</Link>
</li>
{crumbs.map(crumb => (
<>
<React.Fragment key={crumb[1]}>
<li className="text-base-content">&raquo;</li>
<li>
{crumb[2]
@ -53,7 +52,7 @@ const Breadcrumbs = ({ app, slug=false, title }) => {
: <span className="text-base-content">{crumb[0]}</span>
}
</li>
</>
</React.Fragment>
))}
</ul>
)
@ -71,13 +70,11 @@ const DefaultLayout = ({ app, title=false, children=[], search, setSearch}) => {
}
const router = useRouter()
router?.events?.on('routeChangeStart', startNavigation)
router?.events?.on('routeChangeComplete', () => app.stopLoading())
router.events?.on('routeChangeStart', startNavigation)
router.events?.on('routeChangeComplete', () => app.stopLoading())
const slug = router.asPath.slice(1)
const [leftNav, setLeftNav] = useState(false)
const toggleLeftNav = () => setLeftNav(!leftNav)
return (
<div className={`
flex flex-col justify-between