refactor: update layout to match nextjs 15 convention

This commit is contained in:
Alvalens 2025-03-18 11:31:48 +07:00
parent 553880a3e0
commit 80904c426d
3 changed files with 9 additions and 8 deletions

View file

@ -1,7 +1,7 @@
import Footer from "@/components/Footer"; import Footer from "@/components/Footer";
export const metadata = { export const metadata = {
title: "Alvalens | About", title: "Alvalens | About"
}; };
export default function Layout({ children }) { export default function Layout({ children }) {
return ( return (

View file

@ -1,5 +1,5 @@
"use client"; "use client";
import { useState, useEffect } from "react"; import { useState, useEffect, use } from "react";
import { motion } from "framer-motion"; import { motion } from "framer-motion";
import jsonData from "@/json/data.json"; import jsonData from "@/json/data.json";
@ -53,7 +53,8 @@ function ScrollDownButton() {
} }
function Page({ params }) { function Page(props) {
const params = use(props.params);
const [data, setData] = useState(null); const [data, setData] = useState(null);
useEffect(() => { useEffect(() => {
const selectedData = jsonData.Projects.find( const selectedData = jsonData.Projects.find(

View file

@ -2,7 +2,7 @@
import Footer from "@/components/Footer"; import Footer from "@/components/Footer";
export const metadata = { export const metadata = {
title: "Alvalens | Projects", title: "Alvalens | Projects"
}; };
export default function Layout({ children }) { export default function Layout({ children }) {
return ( return (