Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #31

Merged
merged 3 commits into from
Oct 23, 2024
Merged

Dev #31

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/Bio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const Bio = () => {
const t = useTranslations();

if (!user || !user.birth) {
return <div>Loading...</div>;
return <div> </div>;
}

const age = calculateAge(user.birth);
Expand Down
7 changes: 7 additions & 0 deletions components/EducationContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useEffect, useState } from "react";
import { fetchDataFromBucket } from "@/utils/getBucket";
import { EducationCard, EducationCardProps } from "./EducationCard";
import { useLocale, useTranslations } from "next-intl";
import Loading from "@/app/[locale]/about/(me)/education/loading";

export const EducationContainer = () => {
const locale = useLocale();
Expand All @@ -11,6 +12,7 @@ export const EducationContainer = () => {
const [certifications, setCertifications] = useState<EducationCardProps[]>(
[]
);
const [isLoading, setIsLoading] = useState<boolean>(true);

useEffect(() => {
const fetchData = async () => {
Expand All @@ -23,6 +25,8 @@ export const EducationContainer = () => {
setEducation(data);
} catch (error) {
console.error("Error fetching data:", error);
} finally {
setIsLoading(false);
}
};
fetchData();
Expand All @@ -44,6 +48,9 @@ export const EducationContainer = () => {
fetchData();
}, [locale]);

if (isLoading) {
return <Loading />;
}
return (
<section className="flex flex-col gap-8">
<h2 className="text-4xl font-semibold text-center">
Expand Down
7 changes: 7 additions & 0 deletions components/ExperienceContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import { useEffect, useState } from "react";
import { ExperienceCard, ExperienceCardProps } from "./ExperienceCard";
import { fetchDataFromBucket } from "@/utils/getBucket";
import { useLocale } from "next-intl";
import Loading from "@/app/[locale]/about/(me)/experience/loading";

export const ExperienceContainer = () => {
const locale = useLocale();
const [experience, setExperience] = useState<ExperienceCardProps[]>([]);
const [isLoading, setIsLoading] = useState<boolean>(true);

useEffect(() => {
const fetchData = async () => {
Expand All @@ -19,11 +21,16 @@ export const ExperienceContainer = () => {
setExperience(data);
} catch (error) {
console.error("Error fetching data:", error);
} finally {
setIsLoading(false);
}
};
fetchData();
}, [experience, locale]);

if (isLoading) {
return <Loading />;
}
return (
<section className="flex flex-col gap-8">
{experience.map((xp, index) => (
Expand Down
8 changes: 8 additions & 0 deletions components/SkillsContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
import { Badge } from "@/components/ui/badge";
import { fetchDataFromBucket } from "@/utils/getBucket";
import { useLocale, useTranslations } from "next-intl";
import Loading from "@/app/[locale]/about/(me)/skills/loading";

interface Skill {
name: string;
Expand All @@ -29,6 +30,7 @@ export default function SkillsContainer() {
const bucketUrl = process.env.NEXT_PUBLIC_S3_BUCKET_URL;
const [categories, setCategories] = useState<string[]>([]);
const [skills, setSkills] = useState<Skill[]>([]);
const [isLoading, setIsLoading] = useState<boolean>(true);

useEffect(() => {
const fetchData = async () => {
Expand Down Expand Up @@ -60,6 +62,8 @@ export default function SkillsContainer() {
setSkills(data);
} catch (error) {
console.error("Error fetching data:", error);
} finally {
setIsLoading(false);
}
};
fetchData();
Expand All @@ -78,6 +82,10 @@ export default function SkillsContainer() {
setSelectedCategories([]);
};

if (isLoading) {
return <Loading />;
}

return (
<div className="container">
<h1 className="text-3xl font-bold mb-8 text-center">{t("mySkills")}</h1>
Expand Down
16 changes: 14 additions & 2 deletions components/WorkContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,36 @@ import { ViewerProps, WorkViewer } from "./WorkViewer";
import { useLocale } from "next-intl";
import { SidebarProvider } from "./ui/sidebar";
import { fetchDataFromBucket } from "@/utils/getBucket";
import { useLoader } from "@/context/LoaderContext";
import Loading from "@/app/[locale]/work/loading";

export const WorkContainer = () => {
const { showLoader, hideLoader } = useLoader();
const locale = useLocale();
const [works, setWorks] = useState<ViewerProps[]>([]);
const [selectedItem, setSelectedItem] = useState<ViewerProps | null>(null);
const [isLoading, setIsLoading] = useState<boolean>(true);

useEffect(() => {
const fetchData = async () => {
showLoader();
try {
const data = await fetchDataFromBucket(locale, "work", "projects");
setWorks(data);
setSelectedItem(data[0]);
} catch (error) {
console.error("Error fetching data:", error);
} finally {
hideLoader();
setIsLoading(false);
}
};
fetchData();
}, [locale]);
}, [locale, showLoader, hideLoader]);

if (isLoading) {
return <Loading />;
}

return (
<SidebarProvider>
Expand All @@ -41,7 +53,7 @@ export const WorkContainer = () => {
descriptionTwo={selectedItem?.descriptionTwo ?? ""}
descriptionThree={selectedItem?.descriptionThree ?? ""}
imageFull={selectedItem?.imageFull}
visitOnGithub={selectedItem?.visitOnGithub ?? ""}
visitOnGithub={selectedItem?.visitOnGithub ?? null}
technos={selectedItem?.technos ?? []}
language={selectedItem?.language ?? "Unknown language"}
/>
Expand Down
Binary file added public/empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/empty.webp
Binary file not shown.