mirror of
https://github.com/r-freeman/portfolio.git
synced 2024-11-11 18:45:41 +00:00
Removed redundant function
This commit is contained in:
parent
0524cbdaf4
commit
6b4d2b21fd
@ -1,4 +1,3 @@
|
||||
import {useEffect, useRef} from 'react'
|
||||
import type {AppProps} from 'next/app'
|
||||
import {Header} from '@/components/Header'
|
||||
import {Footer} from '@/components/Footer'
|
||||
@ -6,19 +5,7 @@ import {Footer} from '@/components/Footer'
|
||||
import '../styles/tailwind.css'
|
||||
import 'focus-visible'
|
||||
|
||||
function usePrevious(value: string): string | null {
|
||||
let ref = useRef<string | null>(null)
|
||||
|
||||
useEffect(() => {
|
||||
ref.current = value
|
||||
}, [value])
|
||||
|
||||
return ref.current
|
||||
}
|
||||
|
||||
export default function App({Component, pageProps, router}: AppProps) {
|
||||
let previousPathname = usePrevious(router.pathname)
|
||||
|
||||
export default function App({Component, pageProps}: AppProps) {
|
||||
return (
|
||||
<>
|
||||
<div className="fixed inset-0 flex justify-center sm:px-8">
|
||||
@ -29,7 +16,7 @@ export default function App({Component, pageProps, router}: AppProps) {
|
||||
<div className="relative">
|
||||
<Header/>
|
||||
<main>
|
||||
<Component previousPathname={previousPathname} {...pageProps} />
|
||||
<Component {...pageProps} />
|
||||
</main>
|
||||
<Footer/>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user