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