Last active
July 17, 2018 21:38
-
-
Save tonyspiro/fa68ae9484899ce0ae7e8228528fdda5 to your computer and use it in GitHub Desktop.
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
// section-list.js | |
import TeamSection from './sections/team' | |
import SignupSection from './sections/signup' | |
export default ({ sections }) => ( | |
<div> | |
{ | |
sections.map(section => { | |
if (section.metadata.team) | |
return <TeamSection section={section} /> | |
if (section.metadata.cta) | |
return <SignupSection section={section} /> | |
}) | |
} | |
</div> | |
) |
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
// signup.js | |
export default ({ section }) => ( | |
<div> | |
<h3>{section.metadata.headline}</h3> | |
<div dangerouslySetInnerHTML={{ __html: section.metadata.content }}></div> | |
<div><img src={section.metadata.image.imgix_url} /></div> | |
<div><button>{section.metadata.cta}</button></div> | |
</div> | |
) |
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
// team.js | |
export default ({ section }) => ( | |
<div> | |
<h3>{section.metadata.headline}</h3> | |
{ | |
section.metadata.team.map(person => { | |
return ( | |
<div key={person._id}> | |
<div>{person.metadata.name}</div> | |
<div>{person.metadata.quote}</div> | |
<div><img src={person.metadata.image.imgix_url} /></div> | |
</div> | |
) | |
}) | |
} | |
</div> | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment