Make profile SSR formatting deterministic

This commit is contained in:
2026-08-29 20:24:38 +02:00
parent 872f420190
commit 99d94c9333
5 changed files with 86 additions and 4 deletions
@@ -7,10 +7,10 @@ import FollowButton from '../social/FollowButton'
import FollowersPreview from '../social/FollowersPreview'
import MutualFollowersBadge from '../social/MutualFollowersBadge'
import { shinyFlagUrl } from '../../utils/flagUrl'
import { formatProfileDate, formatProfileNumber } from '../../lib/profileFormatters'
function formatCompactNumber(value) {
const numeric = Number(value ?? 0)
return numeric.toLocaleString('en-US')
return formatProfileNumber(value)
}
export default function ProfileHero({ user, profile, isOwner, viewerIsFollowing, followerCount, recentFollowers = [], followContext = null, heroBgUrl, countryName, leaderboardRank, extraActions = null }) {
@@ -25,7 +25,7 @@ export default function ProfileHero({ user, profile, isOwner, viewerIsFollowing,
const uname = user.username || user.name || 'Unknown'
const displayName = user.name || uname
const joinDate = user.created_at
? new Date(user.created_at).toLocaleDateString('en-US', { month: 'long', year: 'numeric' })
? formatProfileDate(user.created_at, { month: 'long', year: 'numeric' })
: null
const progressPercent = Math.round(Number(user?.progress_percent ?? 0))
const heroStats = [