diff --git a/components/pages/home/TimelineShowcase.tsx b/components/pages/home/TimelineShowcase.tsx index b7a91d1..b528242 100644 --- a/components/pages/home/TimelineShowcase.tsx +++ b/components/pages/home/TimelineShowcase.tsx @@ -1,9 +1,9 @@ +import { EncodeDataAttributeCallback } from '@sanity/react-loader' import Image from 'next/image' import React, { Suspense } from 'react' import { Timeline } from '@/components/ui/timeline' import { LadderPayload } from '@/types' -import { EncodeDataAttributeCallback } from '@sanity/react-loader' export function TimelineShowcase({data1, encodeDataAttribute1}: {data1:LadderPayload | null, encodeDataAttribute1?: EncodeDataAttributeCallback }) { diff --git a/components/ui/card-hover-effect.tsx b/components/ui/card-hover-effect.tsx index 916c15e..024bd30 100644 --- a/components/ui/card-hover-effect.tsx +++ b/components/ui/card-hover-effect.tsx @@ -65,7 +65,7 @@ export const HoverEffect = ({ return (
{ - const { overview = [], showcaseProjects = [], title = '' } = data1 ?? {} + const { showcaseProjects = [], title = '' } = data1 ?? {} const ref = useRef(null) const containerRef = useRef(null) @@ -49,7 +50,6 @@ export const Timeline = ({ const heightTransform = useTransform(scrollYProgress, [0, 1], [0, height]) const opacityTransform = useTransform(scrollYProgress, [0, 0.1], [0, 1]) - return (
{title && (
-

+

{data1?.title}

-
+
@@ -71,7 +71,7 @@ export const Timeline = ({
{showcaseProjects && showcaseProjects.length > 0 && ( -
+
{showcaseProjects.map((project, key) => { const href = resolveHref(project?._type, project?.slug) const item = project @@ -79,9 +79,9 @@ export const Timeline = ({ return null } return ( - {/* */} -
-
-
-
-
-

- {item.title} -

-
+
+
+
+
+
+

+ {new Date( + item?.duration?.start ?? new Date(), + ).toLocaleDateString('en-CA', { + year: 'numeric', + month: '2-digit', + })} + -{' '} + {new Date( + item?.duration?.end ?? new Date(), + ).toLocaleDateString('en-CA', { + year: 'numeric', + month: '2-digit', + })} +

+
-
-

- {item.slug} -

- {/* {item?.content}{' '} */} -
-
- + +

+ {new Date( + item?.duration?.start ?? new Date(), + ).toLocaleDateString('en-CA', { + year: 'numeric', + month: '2-digit', + })} + -{' '} + {new Date( + item?.duration?.end ?? new Date(), + ).toLocaleDateString('en-CA', { + year: 'numeric', + month: '2-digit', + })} +

+ {/* {item?.content}{' '} */} + +

+ {item.title} +

+
+ +
+
+ {item?.cloudinaryList + ?.slice(0, 4) + ?.map((image, index) => ( + {image.alt + ))} +
+ +
+
) })}
diff --git a/sanity/lib/queries.ts b/sanity/lib/queries.ts index c71864a..578039e 100644 --- a/sanity/lib/queries.ts +++ b/sanity/lib/queries.ts @@ -26,6 +26,9 @@ export const ladderQuery = groq` "slug": slug.current, tags, title, + cloudinaryList, + duration + }, title, } diff --git a/types/index.ts b/types/index.ts index a708172..39a1b8f 100644 --- a/types/index.ts +++ b/types/index.ts @@ -25,6 +25,11 @@ export interface ShowcaseProject { slug?: string tags?: string[] title?: string + duration?: { + start?: string + end?: string + } + cloudinaryList?: any } // Page payloads