refactor: update layout to match nextjs 15 convention
This commit is contained in:
parent
553880a3e0
commit
80904c426d
3 changed files with 9 additions and 8 deletions
|
|
@ -1,5 +1,5 @@
|
|||
"use client";
|
||||
import { useState, useEffect } from "react";
|
||||
import { useState, useEffect, use } from "react";
|
||||
import { motion } from "framer-motion";
|
||||
import jsonData from "@/json/data.json";
|
||||
|
||||
|
|
@ -53,9 +53,10 @@ function ScrollDownButton() {
|
|||
}
|
||||
|
||||
|
||||
function Page({ params }) {
|
||||
const [data, setData] = useState(null);
|
||||
useEffect(() => {
|
||||
function Page(props) {
|
||||
const params = use(props.params);
|
||||
const [data, setData] = useState(null);
|
||||
useEffect(() => {
|
||||
const selectedData = jsonData.Projects.find(
|
||||
(item) => item.slug === params.slug
|
||||
);
|
||||
|
|
@ -66,7 +67,7 @@ function Page({ params }) {
|
|||
}
|
||||
}, [params.slug]);
|
||||
|
||||
if (data === "404") {
|
||||
if (data === "404") {
|
||||
return (
|
||||
<>
|
||||
<NotFound />
|
||||
|
|
@ -98,7 +99,7 @@ function Page({ params }) {
|
|||
</div>
|
||||
);
|
||||
}
|
||||
return (
|
||||
return (
|
||||
<div className="relative min-h-screen w-full gap-4 p-10 flex justify-center items-center flex-col mb-10 ">
|
||||
<FixedButon href="/projects">
|
||||
<FontAwesomeIcon
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
import Footer from "@/components/Footer";
|
||||
|
||||
export const metadata = {
|
||||
title: "Alvalens | Projects",
|
||||
title: "Alvalens | Projects"
|
||||
};
|
||||
export default function Layout({ children }) {
|
||||
return (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue