Skip to content

Commit

Permalink
add case studies page
Browse files Browse the repository at this point in the history
  • Loading branch information
seanjermey committed Oct 16, 2023
1 parent f5a7230 commit 0448708
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { Content } from "@/ui";
import { getRoute } from "@/getters/getRoute";
import { casestudyHelper } from "@/helpers/casestudyHelper";

export default function CaseStudyPage({ content }) {
return (
<>
<Content items={content} />
</>
);
}

export async function getStaticProps({ params: { url_slug } }) {
const casestudy = casestudyHelper.find(url_slug);

return {
props: {
meta: {},
content: [
{
component: "BreadcrumbNavigation",
props: {
items: [
{ label: "Recruitment Solutions", href: getRoute("recruitmentSolutions") },
{ label: "Case Studies", href: getRoute("caseStudies") },
{ label: casestudy.title, href: getRoute("caseStudy", { url_slug }) },
],
},
},
{
component: "Header",
props: {
title: {
path: `page.caseStudy.${url_slug}.component.Header.title`,
placeholder: casestudy.title,
},
back: {
path: "page.caseStudy.component.Header.back",
placeholder: `Back to Case Studies`,
href: getRoute("caseStudies"),
},
},
},
],
},
};
}

export async function getStaticPaths() {
return {
paths: casestudyHelper.toPaths(),
fallback: false,
};
}
5 changes: 1 addition & 4 deletions src/pages/recruitment-solutions/case-studies/index.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ export async function getStaticProps() {
},
},
},
{
component: "CaseStudyFeed",
props: {},
},
{ component: "CaseStudyFeed" },
],
},
};
Expand Down

0 comments on commit 0448708

Please sign in to comment.