diff --git a/components/layout/dynamic-content-manager/dynamic-content-manager.tsx b/components/layout/dynamic-content-manager/dynamic-content-manager.tsx index ffa2edf3e..7cd46fd67 100644 --- a/components/layout/dynamic-content-manager/dynamic-content-manager.tsx +++ b/components/layout/dynamic-content-manager/dynamic-content-manager.tsx @@ -8,6 +8,7 @@ const USPSection = dynamic(() => import('components/modules/usp-section')); const Slider = dynamic(() => import('components/modules/slider')); const BlurbSection = dynamic(() => import('components/modules/blurb-section')); const FilteredProductList = dynamic(() => import('components/modules/filtered-product-list')); +const ReusableSection = dynamic(() => import('components/modules/reusable-section')); interface getContentComponentProps { _type: string; _key: number; @@ -40,6 +41,13 @@ const getContentComponent = ({ _type, _key, disabled, ...rest }: getContentCompo return; } break; + case 'reusableSection': + if (disabled !== true) { + Component = ReusableSection; + } else { + return; + } + break; default: return (
{ - console.log(section) +const ReusableSection = ({ section }:ReusableSectionProps) => { +const data = section.existingSection.section.sectionType; + +if (!data) { + return; +} return ( -
-
- Reusable section -
- -
+ ) } -export default ReusableSection \ No newline at end of file +export default ReusableSection; \ No newline at end of file diff --git a/lib/sanity/queries.tsx b/lib/sanity/queries.tsx index 269546a32..a19043412 100644 --- a/lib/sanity/queries.tsx +++ b/lib/sanity/queries.tsx @@ -146,8 +146,16 @@ export const reusableSection = ` _type == 'reusableSection' => { disabled, _type, - _key, - title + title, + section { + existingSection-> { + section { + sectionType[] { + ${modules} + } + } + } + } } `