Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function currentPageNavigationOptions() {
if (Scrivito.currentPage()) {
switch (Scrivito.currentPage().objClass()) {
case "Blog":
return blogNavigationOptions(Scrivito.currentPage());
case "BlogPost":
return blogPostNavigationOptions(Scrivito.currentPage());
case "Event":
return eventNavigationOptions(Scrivito.currentPage());
case "Homepage":
return homepageNavigationOptions(Scrivito.currentPage());
case "Job":
return jobNavigationOptions(Scrivito.currentPage());
case "LandingPage":
return landingPageNavigationOptions(Scrivito.currentPage());
case "Page":
return pageNavigationOptions(Scrivito.currentPage());
case "SearchResults":
return searchResultsNavigationOptions(Scrivito.currentPage());
default:
break;
}
}
return {
navigationStyle: "solidWhite",
backgroundImage: null,
heightClassName: null,
isLandingPage: false,
useGradient: false,
};
function NavigationSection({ heightClassName }) {
if (!["full-height", "medium-height"].includes(heightClassName)) {
return null;
}
if (!Scrivito.currentPage()) {
return null;
}
const obj = Scrivito.currentPage();
if (!obj.get("navigationSection")) {
return null;
}
return (
);
}
function isActive(page) {
if (!Scrivito.currentPage()) {
return false;
}
const currentPath = Scrivito.currentPage().path();
if (currentPath) {
return currentPath.startsWith(page.path());
}
if (Scrivito.currentPage().objClass() === "BlogPost") {
return page.objClass() === "Blog";
}
return false;
}
function currentPageNavigationOptions() {
if (Scrivito.currentPage()) {
switch (Scrivito.currentPage().objClass()) {
case "Blog":
return blogNavigationOptions(Scrivito.currentPage());
case "BlogPost":
return blogPostNavigationOptions(Scrivito.currentPage());
case "Event":
return eventNavigationOptions(Scrivito.currentPage());
case "Homepage":
return homepageNavigationOptions(Scrivito.currentPage());
case "Job":
return jobNavigationOptions(Scrivito.currentPage());
case "LandingPage":
return landingPageNavigationOptions(Scrivito.currentPage());
case "Page":
return pageNavigationOptions(Scrivito.currentPage());
case "SearchResults":
return searchResultsNavigationOptions(Scrivito.currentPage());
default:
break;
export const SearchIcon = Scrivito.connect(({ toggleSearch }) => {
if (
Scrivito.currentPage() &&
Scrivito.currentPage().objClass() === "SearchResults"
) {
return (
<span>
<i aria-hidden="true">
</i></span><i aria-hidden="true">
);
}
return (
<span>
<i aria-hidden="true">
</i></span><i aria-hidden="true">
);
});
</i></i>
function currentPageNavigationOptions() {
if (Scrivito.currentPage()) {
switch (Scrivito.currentPage().objClass()) {
case "Blog":
return blogNavigationOptions(Scrivito.currentPage());
case "BlogPost":
return blogPostNavigationOptions(Scrivito.currentPage());
case "Event":
return eventNavigationOptions(Scrivito.currentPage());
case "Homepage":
return homepageNavigationOptions(Scrivito.currentPage());
case "Job":
return jobNavigationOptions(Scrivito.currentPage());
case "LandingPage":
return landingPageNavigationOptions(Scrivito.currentPage());
case "Page":
return pageNavigationOptions(Scrivito.currentPage());
case "SearchResults":
function isActive(page) {
if (!Scrivito.currentPage()) {
return false;
}
const currentPath = Scrivito.currentPage().path();
if (currentPath) {
return currentPath.startsWith(page.path());
}
if (Scrivito.currentPage().objClass() === "BlogPost") {
return page.objClass() === "Blog";
}
return false;
}
function isActive(page) {
if (!Scrivito.currentPage()) {
return false;
}
const currentPath = Scrivito.currentPage().path();
if (currentPath) {
return currentPath.startsWith(page.path());
}
if (Scrivito.currentPage().objClass() === "BlogPost") {
return page.objClass() === "Blog";
}
return false;
}
case "Blog":
return blogNavigationOptions(Scrivito.currentPage());
case "BlogPost":
return blogPostNavigationOptions(Scrivito.currentPage());
case "Event":
return eventNavigationOptions(Scrivito.currentPage());
case "Homepage":
return homepageNavigationOptions(Scrivito.currentPage());
case "Job":
return jobNavigationOptions(Scrivito.currentPage());
case "LandingPage":
return landingPageNavigationOptions(Scrivito.currentPage());
case "Page":
return pageNavigationOptions(Scrivito.currentPage());
case "SearchResults":
return searchResultsNavigationOptions(Scrivito.currentPage());
default:
break;
}
}
return {
navigationStyle: "solidWhite",
backgroundImage: null,
heightClassName: null,
isLandingPage: false,
useGradient: false,
};
}
if (Scrivito.currentPage()) {
switch (Scrivito.currentPage().objClass()) {
case "Blog":
return blogNavigationOptions(Scrivito.currentPage());
case "BlogPost":
return blogPostNavigationOptions(Scrivito.currentPage());
case "Event":
return eventNavigationOptions(Scrivito.currentPage());
case "Homepage":
return homepageNavigationOptions(Scrivito.currentPage());
case "Job":
return jobNavigationOptions(Scrivito.currentPage());
case "LandingPage":
return landingPageNavigationOptions(Scrivito.currentPage());
case "Page":
return pageNavigationOptions(Scrivito.currentPage());
case "SearchResults":
return searchResultsNavigationOptions(Scrivito.currentPage());
default:
break;
}
}
return {
navigationStyle: "solidWhite",
backgroundImage: null,
heightClassName: null,
isLandingPage: false,
useGradient: false,
};
}