Skip to content

Commit

Permalink
Merge pull request #1517 from starknet-io/enhancement/update-jobs-page
Browse files Browse the repository at this point in the history
Update jobs page
  • Loading branch information
rafaelcruzazevedo authored Oct 20, 2023
2 parents 893324a + 9729f1e commit 2db5193
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
6 changes: 6 additions & 0 deletions workspaces/cms-scripts/src/algolia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ try {
})
.wait();
}

if (resourceName === "jobs") {
await index.setSettings({
customRanking: ["desc(published_at_ts)"],
});
}
}
} catch (err) {
console.error(err);
Expand Down
3 changes: 2 additions & 1 deletion workspaces/website/src/pages/jobs/JobsCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ListCard } from "@ui/Card/ListCard";
import { JobsHit } from "./JobsPage";
import moment from "moment";

export default function JobsCard({ hit }: { hit: JobsHit }) {
let tags: string[] = [];
Expand All @@ -10,7 +11,7 @@ export default function JobsCard({ hit }: { hit: JobsHit }) {
return (
<ListCard
variant="job"
startDateTime={hit.contact?.name}
startDateTime={`${hit.contact?.name} - ${moment(hit.published_at).format('DD MMM, YYYY')}`}
image={hit.contact?.logo}
title={hit.job?.title}
description={hit.job?.description}
Expand Down
9 changes: 6 additions & 3 deletions workspaces/website/src/pages/jobs/JobsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import algoliasearch from "algoliasearch/lite";
import {
InstantSearch,
Configure,
useInfiniteHits,
useInfiniteHits
} from "react-instantsearch-hooks-web";
import { useRefinementList } from "react-instantsearch-hooks";
import { PageLayout } from "@ui/Layout/PageLayout";
Expand Down Expand Up @@ -55,8 +55,11 @@ export function JobsPage({ params, env, seo }: Props): JSX.Element | null {
indexName={`web_jobs_${env.ALGOLIA_INDEX}`}
>
<Configure
hitsPerPage={40}
facetsRefinements={{ locale: [params.locale], status: ['active'] }}
hitsPerPage={5}
facetsRefinements={{
locale: [params.locale],
status: ['active']
}}
/>
<JobsPageLayout params={params} seo={seo} />
</InstantSearch>
Expand Down

0 comments on commit 2db5193

Please sign in to comment.