Refactor and update project components for Next.js 15 compatibility (#6)
* refactor: update all modules to latest version * refactor: update layout to match nextjs 15 convention * fix: implement TopProgressBar as Client * fix: remove unnecessary locale prop * fix: update postcss.config.js export * fix: comment out styles * fix: ref usage in useIntersectionObserver and update Navbar * chore: performance optimizations * fix: simplify Loading component structure * refactor: move ProjectCard component and add prop types validation
This commit is contained in:
parent
481bc8324e
commit
7f0c142dda
20 changed files with 3422 additions and 2569 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue