Skip to content

Commit

Permalink
#
Browse files Browse the repository at this point in the history
  • Loading branch information
xvpc committed Sep 16, 2023
1 parent 438ea4c commit 95c0e8f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion components/sections/Instructions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function Instructions({ instructions }: InstructionsProps) {
initial={{y: "100px", opacity: 0}}
whileInView={{y: 0, opacity: 1}}
viewport={{once: true}}
transition={{duration: 1, delay: 0.7}}
transition={{duration: 0.8, delay: 0.5}}
>
{instructions}
</motion.p>
Expand Down
13 changes: 8 additions & 5 deletions pages/recipes/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react'

// NextJs
import { GetStaticPropsContext, GetServerSidePropsContext } from 'next'
import { useRouter } from 'next/router'
import { useRouter, withRouter } from 'next/router'

// Components
import Layout from '@/components/Layout'
Expand All @@ -11,12 +11,13 @@ import Info from '@/components/pages/Info'
// Lib
import getInfo from '@/lib/getInfo'

export default function InfoPage() {
const router = useRouter();
function InfoPage({ router }: { router : any}) {
// const router = useRouter();
const [data, setData] = useState<any>(null)

const id = router.query?.id || "";
const id = router.query?.id || null;

// TODO: Fix this shit
useEffect(() => {
if(id){
(async() => {
Expand All @@ -26,7 +27,7 @@ export default function InfoPage() {
if(data?.error){
console.log(`Error message => ${data?.error}`)

router.push('/404')
// router.push('/404')
}else{
setData(data)
}
Expand All @@ -46,6 +47,8 @@ export default function InfoPage() {
)
}

export default withRouter(InfoPage)

// export async function getStaticPaths(){
// return{
// paths: [],
Expand Down

0 comments on commit 95c0e8f

Please sign in to comment.