From 7ed622daa3c93165f0666f893dc0a1108993e8c9 Mon Sep 17 00:00:00 2001 From: atrincas Date: Mon, 16 Dec 2024 18:19:57 +0100 Subject: [PATCH] showGradient in profile page scroll-area --- client/src/components/ui/scroll-area.tsx | 40 ++++++++++++------- .../profile/custom-projects/index.tsx | 28 ++++--------- client/src/containers/profile/index.tsx | 2 +- 3 files changed, 34 insertions(+), 36 deletions(-) diff --git a/client/src/components/ui/scroll-area.tsx b/client/src/components/ui/scroll-area.tsx index ac7ac2d1..4fad6a82 100644 --- a/client/src/components/ui/scroll-area.tsx +++ b/client/src/components/ui/scroll-area.tsx @@ -13,21 +13,33 @@ const ScrollArea = React.forwardRef< * When true, adds a horizontal scrollbar to the scroll area */ hasHorizontalScroll?: boolean; + /** + * When true, adds a gradient to the bottom of the scroll area + */ + showGradient?: boolean; } ->(({ className, children, hasHorizontalScroll, ...props }, ref) => ( - - - {children} - - - {hasHorizontalScroll && } - - -)); +>( + ( + { className, children, hasHorizontalScroll, showGradient, ...props }, + ref, + ) => ( + + + {children} + + {showGradient && ( +
+ )} + + {hasHorizontalScroll && } + + + ), +); ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName; const ScrollBar = React.forwardRef< diff --git a/client/src/containers/profile/custom-projects/index.tsx b/client/src/containers/profile/custom-projects/index.tsx index f023e53c..20ab6d35 100644 --- a/client/src/containers/profile/custom-projects/index.tsx +++ b/client/src/containers/profile/custom-projects/index.tsx @@ -4,7 +4,7 @@ import { ACTIVITY } from "@shared/entities/activity.enum"; import { useSession } from "next-auth/react"; import { client } from "@/lib/query-client"; -import { cn, getAuthHeader } from "@/lib/utils"; +import { getAuthHeader } from "@/lib/utils"; import { DEFAULT_CUSTOM_PROJECTS_QUERY_KEY } from "@/app/my-projects/url-store"; @@ -17,24 +17,6 @@ import { TableRow, } from "@/components/ui/table"; -const GRADIENT_STYLES = - "absolute inset-0 bg-gradient-to-t from-big-stone-1000 to-transparent opacity-100" as const; - -const CustomTableHead: FC<{ - title: string; - className?: HTMLDivElement["className"]; -}> = ({ title, className }) => ( - -
- {title} -
-
-
-
-); - const CustomProjects: FC = () => { const { data: session } = useSession(); const queryKey = DEFAULT_CUSTOM_PROJECTS_QUERY_KEY; @@ -61,8 +43,12 @@ const CustomProjects: FC = () => { - - + + Project type + + + Number of projects + diff --git a/client/src/containers/profile/index.tsx b/client/src/containers/profile/index.tsx index 4c5d7d29..a4569b51 100644 --- a/client/src/containers/profile/index.tsx +++ b/client/src/containers/profile/index.tsx @@ -101,7 +101,7 @@ export default function Profile() { ({ id: s.id, name: s.title }))} /> - +
{sections.map(({ Component, ...rest }) => (