Skip to content

Commit

Permalink
WIP caption
Browse files Browse the repository at this point in the history
  • Loading branch information
yvonnetangsu committed Apr 5, 2024
1 parent 02c20d4 commit 769fda2
Show file tree
Hide file tree
Showing 3 changed files with 178 additions and 159 deletions.
4 changes: 4 additions & 0 deletions components/Storyblok/SbVerticalPoster.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type SbVerticalPosterProps = {
publishedDate?: string;
cta?: SbBlokData[];
image?: SbImageType;
caption?: StoryblokRichtext;
alt?: string;
bgImage?: SbImageType;
bgAlt?: string;
Expand All @@ -46,6 +47,7 @@ export const SbVerticalPoster = ({
publishedDate,
cta,
image: { filename, focus } = {},
caption,
alt,
bgImage: { filename: bgImageSrc, focus: bgImageFocus } = {},
bgAlt,
Expand All @@ -56,6 +58,7 @@ export const SbVerticalPoster = ({
}: SbVerticalPosterProps) => {
const Cta = !!getNumBloks(cta) ? <CreateBloks blokSection={cta} /> : undefined;
const Body = hasRichText(body) ? <RichText textAlign="center" textColor={bgColor === 'black' ? 'white' : 'black'} wysiwyg={body} /> : undefined;
const Caption = hasRichText(caption) ? <RichText textColor='black-70' wysiwyg={caption} /> : undefined;

return (
<VerticalPoster
Expand All @@ -71,6 +74,7 @@ export const SbVerticalPoster = ({
byline={byline}
publishedDate={publishedDate}
cta={Cta}
caption={Caption}
imageSrc={filename}
imageFocus={focus}
alt={alt}
Expand Down
2 changes: 1 addition & 1 deletion components/VerticalPoster/VerticalPoster.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { type BgColorType } from '@/components/Container';

export const root = 'relative overflow-hidden break-words';

export const grid = 'w-full';
export const grid = 'relative w-full';

export const contentWrapper = (imageOnLeft: boolean, isParallax: boolean) => cnb('relative px-20 sm:px-30 md:px-50 rs-py-6 lg:px-[6vw]', {
'lg:order-last': imageOnLeft,
Expand Down
Loading

0 comments on commit 769fda2

Please sign in to comment.