fix: replace dangerouslySetInnerHTML with safe rendering in UserContainerView

- Remove dangerouslySetInnerHTML for creation date and last login fields
  which caused corrupted display
- Use separate LocalizeText keys with safe React rendering instead
- Add missing friends count display

New external_texts keys required:
  extendedprofile.created.title, extendedprofile.last.login.title,
  extendedprofile.friends.count
This commit is contained in:
Life
2026-03-29 16:45:14 +02:00
parent d619a0250f
commit 3e515e234e
@@ -41,8 +41,15 @@ export const UserContainerView: FC<{
<p className="text-sm italic leading-tight">{ userProfile.motto }</p>
</div>
<div className="flex flex-col gap-1">
<p className="text-sm leading-none" dangerouslySetInnerHTML={{ __html: LocalizeText('extendedprofile.created', ['created'], [userProfile.registration]) }} />
<p className="text-sm leading-none" dangerouslySetInnerHTML={{ __html: LocalizeText('extendedprofile.last.login', ['lastlogin'], [FriendlyTime.format(userProfile.secondsSinceLastVisit, '.ago', 2)]) }} />
<p className="text-sm leading-none">
<b>{ LocalizeText('extendedprofile.created.title') }</b> { userProfile.registration }
</p>
<p className="text-sm leading-none">
<b>{ LocalizeText('extendedprofile.last.login.title') }</b> { FriendlyTime.format(userProfile.secondsSinceLastVisit, '.ago', 2) }
</p>
<p className="text-sm leading-none">
<b>{ LocalizeText('extendedprofile.friends.count') }</b> { userProfile.friendsCount }
</p>
<p className="text-sm leading-none">
<b>{ LocalizeText('extendedprofile.achievementscore') }</b> { userProfile.achievementPoints }
</p>