Skip to content

Commit

Permalink
feat: add update timestamp to Recruiters and Uses pages
Browse files Browse the repository at this point in the history
  • Loading branch information
martapanc committed Oct 21, 2023
1 parent 89c4705 commit 2053392
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 1 deletion.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"i18next": "^23.4.5",
"inquirer-fuzzy-path": "^2.3.0",
"js-cookie": "^3.0.5",
"moment": "^2.29.4",
"next": "^13.5.6",
"next-cloudinary": "^4.18.1",
"next-themes": "^0.2.1",
Expand All @@ -54,6 +55,7 @@
"react-i18next": "^13.2.0",
"react-icons": "^4.10.1",
"react-markdown": "^8.0.7",
"react-moment": "^1.1.3",
"react-string-replace": "^1.1.1",
"react-syntax-highlighter": "^15.5.0",
"react-tippy": "^1.4.0",
Expand Down
7 changes: 6 additions & 1 deletion src/app/(public)/recruiters-info/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import '@/components/molecules/RecruiterInfo/recruiterInfo.css';

import Heading from '@/components/atoms/headings/Heading';
import { SalaryHappinessTool } from '@/components/molecules/RecruiterInfo/SalaryHappinessTool';
import UpdateTimestamp from '@/components/molecules/UpdateTimestamp/UpdateTimestamp';

import { queryRecruitersPage } from '@/queries/recruiters-page';

Expand Down Expand Up @@ -97,9 +98,13 @@ const RecruitersPage = async () => {

<hr />

<div className='outro mt-8'>
<div className='outro mt-8 mb-10'>
<ReactMarkdown>{recruitersPage.outro}</ReactMarkdown>
</div>

<hr />

<UpdateTimestamp updatedAt={recruitersPage.updatedAt} />
</div>
</section>
</main>
Expand Down
5 changes: 5 additions & 0 deletions src/app/(public)/uses/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import ReactMarkdown from 'react-markdown';
import './uses.css';

import Heading from '@/components/atoms/headings/Heading';
import UpdateTimestamp from '@/components/molecules/UpdateTimestamp/UpdateTimestamp';

import { queryUsesPage } from '@/queries/uses-page';

Expand Down Expand Up @@ -47,6 +48,10 @@ const UsesPage = async () => {
<ReactMarkdown>{section.content}</ReactMarkdown>
</div>
))}

<hr className='my-8' />

<UpdateTimestamp updatedAt={usesPage.updatedAt} />
</div>
</section>
</main>
Expand Down
20 changes: 20 additions & 0 deletions src/components/molecules/UpdateTimestamp/UpdateTimestamp.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
'use client';

import Moment from 'react-moment';

export interface UpdateTimestampProps {
updatedAt: Date;
}

const UpdateTimestamp = ({ updatedAt }: UpdateTimestampProps) => {
return (
<div className='mt-4 flex justify-end'>
<strong>Last update:</strong>
&nbsp;
<Moment format='ddd Do MMMM YYYY, HH:mm'>{updatedAt}</Moment>
&nbsp;(CEST)
</div>
);
};

export default UpdateTimestamp;
1 change: 1 addition & 0 deletions src/queries/recruiters-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export function recruitersPageQuery(locale: string) {
content
}
outro
updatedAt
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/queries/uses-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const UsesPageQuery = gql`
title
content
}
updatedAt
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/types/RecruitersPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ export interface RecruitersPage {
jobPreferences: TitledParagraph;
tldr: TitledParagraph;
outro: string;
updatedAt: Date;
}
1 change: 1 addition & 0 deletions src/types/UsesPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ export interface UsesPage {
productivity: TitledParagraph;
programmingTools: TitledParagraph;
security: TitledParagraph;
updatedAt: Date;
}
10 changes: 10 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11262,6 +11262,11 @@ mkdirp@^1.0.3, mkdirp@^1.0.4:
resolved "https://verdaccio.mein-recycling.de/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e"
integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==

moment@^2.29.4:
version "2.29.4"
resolved "https://verdaccio.mein-recycling.de/moment/-/moment-2.29.4.tgz#3dbe052889fe7c1b2ed966fcb3a77328964ef108"
integrity sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==

mri@^1.1.0, mri@^1.2.0:
version "1.2.0"
resolved "https://verdaccio.mein-recycling.de/mri/-/mri-1.2.0.tgz#6721480fec2a11a4889861115a48b6cbe7cc8f0b"
Expand Down Expand Up @@ -12629,6 +12634,11 @@ react-markdown@^8.0.7:
unist-util-visit "^4.0.0"
vfile "^5.0.0"

react-moment@^1.1.3:
version "1.1.3"
resolved "https://verdaccio.mein-recycling.de/react-moment/-/react-moment-1.1.3.tgz#829b21dfb279aa6db47ce4f1ac2555af17a1bcdc"
integrity sha512-8EPvlUL8u6EknPp1ISF5MQ3wx2OHJVXIP/iZc4wRh3iV3XozftZERDv9ANZeAtMlhNNQHdFoqcZHFUkBSTONfA==

react-refresh@^0.11.0:
version "0.11.0"
resolved "https://verdaccio.mein-recycling.de/react-refresh/-/react-refresh-0.11.0.tgz#77198b944733f0f1f1a90e791de4541f9f074046"
Expand Down

0 comments on commit 2053392

Please sign in to comment.