diff --git a/src/app/_components/about-me/page.tsx b/src/app/_components/about-me/page.tsx index cae083d..d7c6fd6 100644 --- a/src/app/_components/about-me/page.tsx +++ b/src/app/_components/about-me/page.tsx @@ -1,6 +1,4 @@ -"use client"; - -import React, { useEffect, useState } from "react"; +import React from "react"; import Skeleton from "react-loading-skeleton"; import "react-loading-skeleton/dist/skeleton.css"; @@ -26,11 +24,11 @@ type AboutMeDataType = { skills: SkillType[]; }; -type AboutMeProps = { - data: AboutMeDataType; -}; - -export default function AboutMe({ data }: AboutMeProps) { +export default async function AboutMe() { + const response = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/about-me`, { + cache: "no-store", // غیرفعال کردن کش + }); + const aboutMeData: AboutMeDataType = await response.json(); return (

- {data?.title || } + {aboutMeData?.title || }

- {data?.description || } + {aboutMeData?.description || }

- {data?.image ? ( + {aboutMeData?.image ? (
- profile picture + profile picture
) : ( diff --git a/src/app/page.tsx b/src/app/page.tsx index ddf1d17..25a079f 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -5,33 +5,7 @@ import AboutMe from "./_components/about-me/page"; import Services from "./_components/services/page"; import MyProjects from "./_components/my-projects/page"; -type SkillType = { - id: 1; - title: string; - image: string; - description: string; - link: string; - percentage: number; - about_me_id: number; - created_at: string; - updated_at: string; -}; - -type AboutMeDataType = { - id: number; - title: string; - description: string; - image: string; - created_at: string; - updated_at: string; - skills: SkillType[]; -}; - export default async function Home() { - const response = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/about-me`, { - cache: "no-store", // غیرفعال کردن کش - }); - let aboutMeData: AboutMeDataType = await response.json(); return (
@@ -108,7 +82,7 @@ export default async function Home() {
- +