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 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>
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 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>
);
};
const BlogPost = props => {
const edges = get(props.data, 'prismic.allBlogposs.edges', []);
const data = get(edges, '0.node');
if (!data) {
return null;
}
return (
<div id="blogpost">
<h1>{RichText.asText(data.title)}</h1>
{RichText.render(data.body, linkResolver)}
</div>
);
};
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>
);
};
export const Quote = (props) => {
var sectionClass = "content-section ";
if (props.slice.slice_label) {
sectionClass += "text-section-" + props.slice.slice_label;
} else {
sectionClass += "text-section-1col";
}
return (
<section>
<blockquote>
{RichText.asText(props.slice.primary.quote_text)}
</blockquote>
</section>
);
};
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>
);
};