generated from theodorusclarence/ts-nextjs-tailwind-starter
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add Salary and Tools sections to RecruiterInfo page
- Loading branch information
Showing
6 changed files
with
150 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import ReactMarkdown from 'react-markdown'; | ||
|
||
import '@/components/molecules/RecruiterInfo/recruiterInfo.css'; | ||
|
||
import Heading from '@/components/atoms/headings/Heading'; | ||
import { SalaryHappinessTool } from '@/components/molecules/RecruiterInfo/SalaryHappinessTool'; | ||
|
||
import { queryRecruitersPage } from '@/queries/recruiters-page'; | ||
|
||
export const metadata = { | ||
title: 'Recruiters Info | MartaCodes.it', | ||
description: 'Information for Recruiters', | ||
}; | ||
|
||
const queryData = async () => { | ||
const recruitersPage = await queryRecruitersPage(); | ||
|
||
return { | ||
recruitersPage, | ||
}; | ||
}; | ||
|
||
const RecruitersPage = async () => { | ||
const { recruitersPage } = await queryData(); | ||
|
||
const salaryData = { | ||
min: 70000, | ||
median: 85000, | ||
max: 120000, | ||
}; | ||
|
||
const config = { | ||
displayTitle: true, | ||
currency: 'EUR', | ||
forexMultiplier: 1, | ||
}; | ||
|
||
return ( | ||
<main className='min-h-main'> | ||
<section> | ||
<div className='layout relative flex flex-col py-12'> | ||
<Heading title='recruiters.title' /> | ||
|
||
<div | ||
className='salary-expectations mb-2' | ||
aria-label='Salary Expectations' | ||
> | ||
<h2 className='mb-2'>{recruitersPage.salary.title}</h2> | ||
<ReactMarkdown>{recruitersPage.salary.content}</ReactMarkdown> | ||
|
||
<SalaryHappinessTool salaryData={salaryData} config={config} /> | ||
</div> | ||
|
||
<hr /> | ||
|
||
<div className='tools-techs mb-8'> | ||
<h2 className='my-4'>{recruitersPage.toolsTechs.title}</h2> | ||
<ReactMarkdown>{recruitersPage.toolsTechs.content}</ReactMarkdown> | ||
</div> | ||
|
||
<hr /> | ||
</div> | ||
</section> | ||
</main> | ||
); | ||
}; | ||
|
||
export default RecruitersPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.salary-expectations p { | ||
margin-bottom: 12px; | ||
} | ||
|
||
.tools-techs h4 { | ||
margin-bottom: 8px; | ||
} | ||
|
||
.tools-techs p { | ||
margin-top: 20px; | ||
} | ||
|
||
ul { | ||
margin-bottom: 16px; | ||
list-style: inside; | ||
} | ||
|
||
li { | ||
margin-left: 22px; | ||
margin-bottom: 5px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,5 +95,8 @@ | |
}, | ||
"uses": { | ||
"title": "Uses" | ||
}, | ||
"recruiters": { | ||
"title": "Info for Recruiters" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { gql } from '@apollo/client'; | ||
|
||
import { flattenToObject } from '@/lib/graphqlUtils'; | ||
|
||
import apolloClient from '../../apollo/apollo-client'; | ||
|
||
import { RecruitersPage } from '@/types/RecruitersPage'; | ||
|
||
export async function queryRecruitersPage() { | ||
const { data } = await apolloClient.query({ query: recruitersPageQuery }); | ||
|
||
return flattenToObject<RecruitersPage>(data.recruitersPage); | ||
} | ||
|
||
export const recruitersPageQuery = gql` | ||
{ | ||
recruitersPage { | ||
data { | ||
id | ||
attributes { | ||
salary { | ||
title | ||
content | ||
} | ||
toolsTechs { | ||
title | ||
content | ||
} | ||
jobPreferences { | ||
title | ||
content | ||
} | ||
tldr { | ||
title | ||
content | ||
} | ||
} | ||
} | ||
} | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export interface RecruitersPage { | ||
salary: TitledParagraph; | ||
toolsTechs: TitledParagraph; | ||
jobPreferences: TitledParagraph; | ||
tldr: TitledParagraph; | ||
} | ||
|
||
interface TitledParagraph { | ||
title: string; | ||
content: string; | ||
} |