generated from jetskis/superhi-site-build
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sanity connect, extend the product in sanity, render the product in t…
…he frontend
- Loading branch information
1 parent
056f445
commit 1319e9f
Showing
8 changed files
with
5,690 additions
and
5,613 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import React from 'react'; | ||
|
||
import { ValueProps } from '~/components/sharable/valueProps' | ||
import { Faqs } from '~/components/sharable/faqs' | ||
|
||
const COMPONENTS = { | ||
'module.valueProps': ValueProps, | ||
'module.faqs': Faqs, | ||
}; | ||
|
||
const ProductComponentList = ({components = [], componentProps = {}}) => { | ||
const componentRows = components?.map((component, index) => { | ||
const Component = COMPONENTS[component._type]; | ||
|
||
if (!Component) | ||
return ( | ||
<div key={component._key} className="p-8"> | ||
<div className='p-2 border border-solid bg-magenta'> | ||
missing - {component._type} | ||
</div> | ||
</div> | ||
); | ||
|
||
return ( | ||
<Component | ||
index={index} | ||
key={component._key} | ||
{...component} | ||
{...componentProps} | ||
/> | ||
); | ||
}); | ||
|
||
return <>{componentRows}</> | ||
}; | ||
|
||
export default ProductComponentList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.