Issue #314: Modified Castform template to handle data profile having no birthDate field (backward compatibility)

This commit is contained in:
gianantoniopini
2020-11-08 14:56:52 +01:00
parent ea9931a147
commit f779ca4cbf

View File

@ -54,8 +54,9 @@ const Castform = ({ data, language }) => {
</div>
);
const BirthDate = () => (
data.profile.birthDate && (
const BirthDate = () => {
if (data.profile.birthDate) {
return (
<div className="text-xs">
<h6 className="capitalize font-semibold">
{t('builder.profile.birthDate')}
@ -64,8 +65,11 @@ const Castform = ({ data, language }) => {
<span>{formatDate({ date: data.profile.birthDate, language, includeDay: true })}</span>
</div>
</div>
)
);
}
return null;
}
return (
<PageContext.Provider value={{ data, heading: HeadingD }}>