diff --git a/src/screens/Profile/Header/EditProfileDialog.tsx b/src/screens/Profile/Header/EditProfileDialog.tsx index 3b948f2375..1715328f54 100644 --- a/src/screens/Profile/Header/EditProfileDialog.tsx +++ b/src/screens/Profile/Header/EditProfileDialog.tsx @@ -5,7 +5,7 @@ import {msg} from '@lingui/core/macro' import {useLingui} from '@lingui/react' import {Plural, Trans} from '@lingui/react/macro' -import {urls} from '#/lib/constants' +import {MAX_DESCRIPTION, MAX_DISPLAY_NAME, urls} from '#/lib/constants' import {cleanError} from '#/lib/strings/errors' import {isOverMaxGraphemeCount} from '#/lib/strings/helpers' import {logger} from '#/logger' @@ -26,9 +26,6 @@ import * as Toast from '#/components/Toast' import {Text} from '#/components/Typography' import {useSimpleVerificationState} from '#/components/verification' -const DISPLAY_NAME_MAX_GRAPHEMES = 64 -const DESCRIPTION_MAX_GRAPHEMES = 256 - export function EditProfileDialog({ profile, control, @@ -205,11 +202,11 @@ function DialogInner({ const displayNameTooLong = isOverMaxGraphemeCount({ text: displayName, - maxCount: DISPLAY_NAME_MAX_GRAPHEMES, + maxCount: MAX_DISPLAY_NAME, }) const descriptionTooLong = isOverMaxGraphemeCount({ text: description, - maxCount: DESCRIPTION_MAX_GRAPHEMES, + maxCount: MAX_DESCRIPTION, }) const cancelButton = useCallback( @@ -330,7 +327,7 @@ function DialogInner({ {color: t.palette.negative_400}, ]}> @@ -381,7 +378,7 @@ function DialogInner({ {color: t.palette.negative_400}, ]}>