From 715f4e518f8572026290b1a970a4d3438af5749a Mon Sep 17 00:00:00 2001 From: Yvonne Tang Date: Wed, 11 Oct 2023 13:29:14 -0700 Subject: [PATCH] Add above sidebar region --- .../Storyblok/SbStoryMvp/SbAboveContent.tsx | 3 + .../Storyblok/SbStoryMvp/SbStoryMvp.tsx | 158 +++++++++--------- 2 files changed, 85 insertions(+), 76 deletions(-) diff --git a/components/Storyblok/SbStoryMvp/SbAboveContent.tsx b/components/Storyblok/SbStoryMvp/SbAboveContent.tsx index 65d4bd9a..29a40ccd 100644 --- a/components/Storyblok/SbStoryMvp/SbAboveContent.tsx +++ b/components/Storyblok/SbStoryMvp/SbAboveContent.tsx @@ -5,15 +5,18 @@ import { Container } from '@/components/Container'; import { Grid } from '@/components/Grid'; type SbAboveContentProps = { + aboveSidebar?: SbBlokData[]; intro: SbBlokData[]; sidebar?: SbBlokData[]; } export const SbAboveContent = ({ + aboveSidebar, intro, sidebar, }: SbAboveContentProps) => ( +
diff --git a/components/Storyblok/SbStoryMvp/SbStoryMvp.tsx b/components/Storyblok/SbStoryMvp/SbStoryMvp.tsx index dfa54d29..697a0599 100644 --- a/components/Storyblok/SbStoryMvp/SbStoryMvp.tsx +++ b/components/Storyblok/SbStoryMvp/SbStoryMvp.tsx @@ -19,6 +19,7 @@ import { getProcessedImage } from '@/utilities/getProcessedImage'; type SbStoryMvpProps = { blok: { _uid: string; + aboveSidebar?: SbBlokData[]; intro?: SbBlokData[]; sidebar?: SbBlokData[]; content?: SbBlokData[]; @@ -51,6 +52,7 @@ export const SbStoryMvp = ({ tabColor, topics, // page regions + aboveSidebar, intro, sidebar, content, @@ -58,36 +60,79 @@ export const SbStoryMvp = ({ }, blok, slug, -}: SbStoryMvpProps) => ( -
- -
-
- {!(title?.includes('Whereas') || title?.includes('Progress') || title?.includes('Video') || title?.includes('Solve')) && ( - <> - +}: SbStoryMvpProps) => { + const showAboveContent = !!getNumBloks(aboveSidebar) || !!getNumBloks(intro) || !!getNumBloks(sidebar); + + return ( +
+ +
+
+ {!(title?.includes('Whereas') || title?.includes('Progress') || title?.includes('Video') || title?.includes('Solve')) && ( + <> + + + + )} + {showAboveContent && ( + + )} + {title?.includes('Solve') && ( + + )} + {title?.includes('Progress') && ( + + )} + {title?.includes('Video scrolling') && ( + + )} + {title?.includes('Chatbot') && ( + + )} + {title?.includes('Whereas') && ( + + )} + + {title?.includes('bookshelf') && ( + + )} + {title?.includes('Immersive featured') && ( + <> + + + + + )} + {getNumBloks(blok.ankle) > 0 && ( - - )} - {getNumBloks(blok.intro) > 0 && ( - - )} - {title?.includes('Solve') && ( - - )} - {title?.includes('Progress') && ( - - )} - {title?.includes('Video scrolling') && ( - - )} - {title?.includes('Chatbot') && ( - - )} - {title?.includes('Whereas') && ( - - )} - - {title?.includes('bookshelf') && ( - - )} - {title?.includes('Immersive featured') && ( - <> - - - - - )} - {getNumBloks(blok.ankle) > 0 && ( - - )} - -
-
-
-); + )} + +
+
+
+ ); +};