mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-26 22:44:35 +10:00
Issue #314: Created separate component BirthDateA, with language retrieved from data.metadata.language
This commit is contained in:
26
src/templates/blocks/BirthDate/BirthDateA.js
Normal file
26
src/templates/blocks/BirthDate/BirthDateA.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import React, { memo, useContext } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import PageContext from '../../../contexts/PageContext';
|
||||
import { formatDate } from '../../../utils';
|
||||
|
||||
const BirthDateA = () => {
|
||||
const { t } = useTranslation();
|
||||
const { data } = useContext(PageContext);
|
||||
|
||||
if (data.profile.birthDate) {
|
||||
return (
|
||||
<div className="text-xs">
|
||||
<h6 className="capitalize font-semibold">
|
||||
{t('builder.profile.birthDate')}
|
||||
</h6>
|
||||
<div>
|
||||
<span>{formatDate({ date: data.profile.birthDate, language: data.metadata.language, includeDay: true })}</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
export default memo(BirthDateA);
|
||||
Reference in New Issue
Block a user