From ee9d0391f485da2adb76c041cd83ed7a917c8ddc Mon Sep 17 00:00:00 2001 From: IMXNOOBX Date: Wed, 3 Apr 2024 08:41:00 +0000 Subject: [PATCH] Hotfix to the ScrollTo Component --- app/components/navbar/navlink/index.tsx | 1 + app/components/navbar/profiles/index.tsx | 2 +- app/components/utils/ScrollTo.tsx | 4 ++-- app/projects/page.tsx | 2 ++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/components/navbar/navlink/index.tsx b/app/components/navbar/navlink/index.tsx index ad8c4f5..754b946 100644 --- a/app/components/navbar/navlink/index.tsx +++ b/app/components/navbar/navlink/index.tsx @@ -11,6 +11,7 @@ export default function Button({ image, to, isActive = false, className, childre className={`flex transition-all duration-300 bg-transparent ${isActive ? 'py-2' : 'group-hover:py-2'}`}> window.open(to, '_blank')} > - icon + icon icon ); diff --git a/app/components/utils/ScrollTo.tsx b/app/components/utils/ScrollTo.tsx index d09a796..ac3629d 100644 --- a/app/components/utils/ScrollTo.tsx +++ b/app/components/utils/ScrollTo.tsx @@ -50,7 +50,7 @@ export default function ScrollTo({ point }: { point: number | undefined }) { }, scrolled: { opacity: 1, - position: 'fixed', + // position: 'fixed', x: '-40px', bottom: '10%', left: '50%', @@ -63,7 +63,7 @@ export default function ScrollTo({ point }: { point: number | undefined }) { } }} onClick={() => window.scrollTo({ top: scrolled ? 0 :point || window.innerHeight, behavior: 'smooth' })} - className="overflow-hidden absolute bottom-20 left-1/2 flex items-center justify-center w-20 h-20 cursor-pointer z-50 select-none" + className="overflow-hidden fixed bottom-20 left-1/2 flex items-center justify-center w-20 h-20 cursor-pointer z-50 select-none" > scroll diff --git a/app/projects/page.tsx b/app/projects/page.tsx index ff5ed32..efb0470 100644 --- a/app/projects/page.tsx +++ b/app/projects/page.tsx @@ -1,4 +1,5 @@ import ProjectCard from "@/app/projects/card/index"; +import ScrollTo from "@/app/components/utils/ScrollTo"; async function getProjects(username: string = "") { if (!username) @@ -21,6 +22,7 @@ export default async function Projects() { return (
+ {repos.map((repo: any, i: number) => (