this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Use proper constants.ts exports for Edit Profile Dialog limits (#10054)

authored by

RetroSunstar and committed by
GitHub
dbba97f2 5e8ef6aa

+5 -8
+5 -8
src/screens/Profile/Header/EditProfileDialog.tsx
··· 5 5 import {useLingui} from '@lingui/react' 6 6 import {Plural, Trans} from '@lingui/react/macro' 7 7 8 - import {urls} from '#/lib/constants' 8 + import {MAX_DESCRIPTION, MAX_DISPLAY_NAME, urls} from '#/lib/constants' 9 9 import {cleanError} from '#/lib/strings/errors' 10 10 import {isOverMaxGraphemeCount} from '#/lib/strings/helpers' 11 11 import {logger} from '#/logger' ··· 25 25 import * as Toast from '#/components/Toast' 26 26 import {Text} from '#/components/Typography' 27 27 import {useSimpleVerificationState} from '#/components/verification' 28 - 29 - const DISPLAY_NAME_MAX_GRAPHEMES = 64 30 - const DESCRIPTION_MAX_GRAPHEMES = 256 31 28 32 29 export function EditProfileDialog({ 33 30 profile, ··· 205 202 206 203 const displayNameTooLong = isOverMaxGraphemeCount({ 207 204 text: displayName, 208 - maxCount: DISPLAY_NAME_MAX_GRAPHEMES, 205 + maxCount: MAX_DISPLAY_NAME, 209 206 }) 210 207 const descriptionTooLong = isOverMaxGraphemeCount({ 211 208 text: description, 212 - maxCount: DESCRIPTION_MAX_GRAPHEMES, 209 + maxCount: MAX_DESCRIPTION, 213 210 }) 214 211 215 212 const cancelButton = useCallback( ··· 330 327 {color: t.palette.negative_400}, 331 328 ]}> 332 329 <Plural 333 - value={DISPLAY_NAME_MAX_GRAPHEMES} 330 + value={MAX_DISPLAY_NAME} 334 331 other="Display name is too long. The maximum number of characters is #." 335 332 /> 336 333 </Text> ··· 381 378 {color: t.palette.negative_400}, 382 379 ]}> 383 380 <Plural 384 - value={DESCRIPTION_MAX_GRAPHEMES} 381 + value={MAX_DESCRIPTION} 385 382 other="Description is too long. The maximum number of characters is #." 386 383 /> 387 384 </Text>