From 70138b18d5d173e472e93717912ed93456d9b9c3 Mon Sep 17 00:00:00 2001 From: Yvonne Tang <42749717+yvonnetangsu@users.noreply.github.com> Date: Wed, 11 Dec 2024 13:50:57 -0800 Subject: [PATCH] DS-989 | Use modals for changemaker card content for all breakpoints (#373) * Use modal for all breakpoints * modal functionality and styles * Change close button border to red; clean up * Use headlessui description without nesting; update PR template * Remove unnecessary code --- .github/pull_request_template.md | 2 +- .../AnnotatedImage/AnnotatedImage.styles.ts | 2 +- components/AnnotatedImage/ImageHotspot.tsx | 2 - .../ChangemakerCard/ChangemakerCard.styles.ts | 24 +-- .../ChangemakerCard/ChangemakerCard.tsx | 138 ++++++------------ components/RichText.tsx | 3 +- components/Storyblok/SbCardWysiwyg.tsx | 12 +- components/Storyblok/SbChangemakerCard.tsx | 2 +- 8 files changed, 71 insertions(+), 114 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 4cef4992..40ed4937 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -20,7 +20,7 @@ 3. Verify... # Associated Issues and/or People -- JIRA ticket(s) - GIVCAMP- +- JIRA ticket(s) - DS- - Other PRs - Any other contextual information that might be helpful (e.g., description of a bug that this PR fixes, new functionality that it adds, etc.) - Anyone who should be notified? (`@mention` them here) diff --git a/components/AnnotatedImage/AnnotatedImage.styles.ts b/components/AnnotatedImage/AnnotatedImage.styles.ts index 4970ba30..30970cf5 100644 --- a/components/AnnotatedImage/AnnotatedImage.styles.ts +++ b/components/AnnotatedImage/AnnotatedImage.styles.ts @@ -1,4 +1,4 @@ -export const root = 'relative self-start'; +export const root = 'relative self-start annotated-image'; export const imageWrapper = 'relative @container'; export const ul = 'list-unstyled'; export const li = 'mb-0'; diff --git a/components/AnnotatedImage/ImageHotspot.tsx b/components/AnnotatedImage/ImageHotspot.tsx index ac0fa8e4..31064fb5 100644 --- a/components/AnnotatedImage/ImageHotspot.tsx +++ b/components/AnnotatedImage/ImageHotspot.tsx @@ -30,7 +30,6 @@ export const ImageHotspot = ({ descriptionSize, }: SbImageHotspotType) => { const [isModalOpen, setIsModalOpen] = useState(false); - const buttonRef = useRef(null); const [isClicked, setIsClicked] = useState(false); const panelRef = useRef(null); @@ -58,7 +57,6 @@ export const ImageHotspot = ({
- {heading} - {subheading && ( - {subheading} - )} - {children} +
+ +
+
+ {heading} + {subheading && + {subheading} + } +
+
{children}
+
+
diff --git a/components/RichText.tsx b/components/RichText.tsx index 39d93eba..81208333 100644 --- a/components/RichText.tsx +++ b/components/RichText.tsx @@ -18,6 +18,7 @@ import { */ export type RichTextBaseFontSizeType = 'default' | 'card' | 'changemaker' | 'changemakerHorizontal' | 'big'; +export type RichTextLinkColorType = 'unset' | 'white' | 'digital-red-xlight'; export type RichTextProps = { wysiwyg: StoryblokRichtext; @@ -28,7 +29,7 @@ export type RichTextProps = { type?: 'default' | 'card'; baseFontSize?: RichTextBaseFontSizeType; textColor?: 'black' | 'white' | 'black-70'; - linkColor?: 'unset' | 'white' | 'digital-red-xlight'; + linkColor?: RichTextLinkColorType; bgColor?: 'black' | 'black-50' | 'black-60' | 'black-70' | 'white' | 'none'; textAlign?: TextAlignType; className?: string; diff --git a/components/Storyblok/SbCardWysiwyg.tsx b/components/Storyblok/SbCardWysiwyg.tsx index 822d8e4b..71e16d95 100644 --- a/components/Storyblok/SbCardWysiwyg.tsx +++ b/components/Storyblok/SbCardWysiwyg.tsx @@ -1,6 +1,6 @@ import { type StoryblokRichtext } from 'storyblok-rich-text-react-renderer-ts'; import { storyblokEditable } from '@storyblok/react/rsc'; -import { RichText } from '../RichText'; +import { RichText, type RichTextLinkColorType } from '../RichText'; /** * This is used only as a sub-component currently @@ -14,6 +14,7 @@ type SbCardWysiwygProps = { isLightText?: boolean; }, baseFontSize?: 'default' | 'changemaker' | 'changemakerHorizontal' | 'card'; + linkColor?: RichTextLinkColorType; }; export const SbCardWysiwyg = ({ @@ -23,8 +24,15 @@ export const SbCardWysiwyg = ({ }, blok, baseFontSize, + linkColor, }: SbCardWysiwygProps) => (
- +
); diff --git a/components/Storyblok/SbChangemakerCard.tsx b/components/Storyblok/SbChangemakerCard.tsx index 845600a3..5591bccf 100644 --- a/components/Storyblok/SbChangemakerCard.tsx +++ b/components/Storyblok/SbChangemakerCard.tsx @@ -34,7 +34,7 @@ export const SbChangemakerCard = ({ }, blok, }: SbChangemakerCardProps) => { - const Body = !!getNumBloks(body) ? : undefined; + const Body = !!getNumBloks(body) ? : undefined; return (