Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const menu = props.menu.data.menu_links.map(function(menuItem, index){
var menuLink = PrismicLink.url(menuItem.link, PrismicConfig.linkResolver);
var label = RichText.asText(menuItem.label);
return <li>{label}</li>;
});
export const HomeBanner = (props) => {
var banner = props.document.data.homepage_banner[0];
var bannerStyle = { backgroundImage: 'linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6)), url(' + banner.image.url + ')' };
var link = PrismicLink.url(banner.button_link, PrismicConfig.linkResolver);
var label = RichText.asText(banner.button_label);
var button = null;
if (link && label != " ") {
button = {label};
}
return (
<section style="{bannerStyle}">
<div>
<h2>{ RichText.asText(banner.title) }</h2>
<p>{ RichText.asText(banner.tagline) }</p>
{ button }
</div>
</section>
);
};
var gallery = props.slice.items.map(function(galleryItem, index){
var description = RichText.render(galleryItem.image_description, PrismicConfig.linkResolver);
var link = PrismicLink.url(galleryItem.link, PrismicConfig.linkResolver);
var label = RichText.asText(galleryItem.link_label);
var button = null;
if (link && label != " ") {
button = <p>{label}</p>;
}
return (
<div>
<img src="{galleryItem.image.url}/">
{ description }
{ button }
</div>
);
});
export const ImageHighlight = (props) => {
var highlight = props.slice;
var link = PrismicLink.url(highlight.primary.link, PrismicConfig.linkResolver);
var label = RichText.asText(highlight.primary.link_label);
var button = null;
if (link && label != " ") {
button = <p>{label}</p>;
}
return (
<section>
<div>
{ RichText.render(highlight.primary.title, PrismicConfig.linkResolver) }
{ RichText.render(highlight.primary.headline, PrismicConfig.linkResolver) }
{ button }
</div>
<div>
<img src="{">
</div></section>