mirror of
				https://github.com/theoludwig/theoludwig.git
				synced 2025-10-14 20:23:25 +02:00 
			
		
		
		
	fix: client-side age calculation, more glanular check for isMounted
Allows to render as much as possible on the server side. While keeping the calculation of the age on the client side to avoid hydratation mismatch.
This commit is contained in:
		| @@ -30,14 +30,17 @@ export const ProfileList = (props: ProfileListProps): JSX.Element => { | ||||
|         title={i18n.translate("home.about.pronouns")} | ||||
|         value={i18n.translate("home.about.pronouns-value")} | ||||
|       /> | ||||
|       {isMounted ? ( | ||||
|         <ProfileItem | ||||
|           title={i18n.translate("home.about.birth-date")} | ||||
|           value={`${BIRTH_DATE_STRING} (${age} ${i18n.translate( | ||||
|             "home.about.years-old", | ||||
|           )})`} | ||||
|         /> | ||||
|       ) : null} | ||||
|       <ProfileItem | ||||
|         title={i18n.translate("home.about.birth-date")} | ||||
|         value={ | ||||
|           isMounted | ||||
|             ? `${BIRTH_DATE_STRING} (${age} ${i18n.translate( | ||||
|                 "home.about.years-old", | ||||
|               )})` | ||||
|             : BIRTH_DATE_STRING | ||||
|         } | ||||
|       /> | ||||
|  | ||||
|       <ProfileItem | ||||
|         title={i18n.translate("home.about.nationality")} | ||||
|         value="Alsace, France" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user