From 1f9513bc9365cca02804ffe96a13a101407140a0 Mon Sep 17 00:00:00 2001 From: Matheus Albuquerque Date: Sun, 13 Oct 2024 16:59:06 +0200 Subject: [PATCH] feat(talks/photo-highlights-section): new visuals --- .../talks/photo-highlights-section-item.tsx | 79 +++++++++++-------- .../pages/talks/photo-highlights-section.tsx | 14 ++-- 2 files changed, 53 insertions(+), 40 deletions(-) diff --git a/src/components/pages/talks/photo-highlights-section-item.tsx b/src/components/pages/talks/photo-highlights-section-item.tsx index 7d4830c..3f84949 100644 --- a/src/components/pages/talks/photo-highlights-section-item.tsx +++ b/src/components/pages/talks/photo-highlights-section-item.tsx @@ -1,50 +1,63 @@ -import Image from 'next/image'; -import Link from 'next/link'; import { FunctionComponent, PropsWithChildren } from 'react'; -import Typography from 'components/shared/typography'; +import { FeaturedTalk } from 'services/content/talks'; + +import Link from 'components/shared/link'; +import { randomElement } from 'utils/array'; // --------------------------------------------------------------------------- -// TYPES +// UTILS // --------------------------------------------------------------------------- -export type PhotoHighlightsSectionItemProps = { - talkSlug: string; - eventName: string; - photoURL: string; +const getGradientClass = () => { + const gradients = [ + 'bg-gradient-to-br from-purple-600 via-pink-500 to-blue-600', + 'bg-gradient-to-tr from-blue-600 via-teal-500 to-purple-600', + 'bg-gradient-to-bl from-orange-500 via-pink-500 to-blue-600', + 'bg-gradient-to-r from-green-500 via-teal-500 to-blue-500', + 'bg-gradient-to-tl from-yellow-500 via-red-500 to-pink-500', + 'bg-gradient-to-l from-indigo-500 via-purple-500 to-pink-500', + 'bg-gradient-to-tr from-green-500 via-blue-500 to-purple-500', + 'bg-gradient-to-br from-red-500 via-orange-500 to-yellow-500', + 'bg-gradient-to-bl from-blue-500 via-cyan-500 to-teal-500', + 'bg-gradient-to-r from-purple-500 via-pink-500 to-red-500', + 'bg-gradient-to-tr from-green-500 via-yellow-500 to-orange-500', + 'bg-gradient-to-bl from-blue-500 via-indigo-500 to-violet-500', + ]; + + return randomElement(gradients); }; // --------------------------------------------------------------------------- // UI // --------------------------------------------------------------------------- -const PhotoHighlightsSectionItem: FunctionComponent> = (props) => { - const { photoURL, talkSlug, eventName } = props; +const PhotoHighlightsSectionItem: FunctionComponent> = (props) => { + const { photoURL, talkSlug, talkTitle, eventName, eventLocation } = props; return ( - -
- {eventName} -
- {eventName} -
-
- +
+
+
+
+ {eventName} +
+ {eventLocation} + +

+ {eventName} +

+ +

{talkTitle}

+
+
); }; diff --git a/src/components/pages/talks/photo-highlights-section.tsx b/src/components/pages/talks/photo-highlights-section.tsx index a437eec..c8fc5fc 100644 --- a/src/components/pages/talks/photo-highlights-section.tsx +++ b/src/components/pages/talks/photo-highlights-section.tsx @@ -1,18 +1,18 @@ import { FunctionComponent, PropsWithChildren } from 'react'; +import { FeaturedTalk } from 'services/content/talks'; + import SectionContainer from 'components/shared/section-container'; import SectionHeading from 'components/shared/section-heading'; -import PhotoHighlightsSectionItem, { - PhotoHighlightsSectionItemProps, -} from 'components/pages/talks/photo-highlights-section-item'; +import PhotoHighlightsSectionItem from 'components/pages/talks/photo-highlights-section-item'; // --------------------------------------------------------------------------- // TYPES // --------------------------------------------------------------------------- export type PhotoHighlightsSectionProps = { - items: Array; + items: Array; }; // --------------------------------------------------------------------------- @@ -23,12 +23,12 @@ const PhotoHighlightsSection: FunctionComponent -
-
+
+
{items.map((item) => ( ))} -
+
{' '}
);