Skip to content

Commit 36913d6

Browse files
increase profile name max length to 40 (#1379)
* changed max chars for profile name from 16 to 30 * Changed max to 40 and import from settings Co-authored-by: Glenn 'devalias' Grant <[email protected]>
1 parent 175c46a commit 36913d6

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

src/components/organisms/EditProfileModal/EditProfileModal.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { QuestionsFormData } from "pages/Account/Questions";
77
import { updateUserProfile } from "pages/Account/helpers";
88
import { QuestionType } from "types/Question";
99
import ProfilePictureInput from "components/molecules/ProfilePictureInput";
10+
import { DISPLAY_NAME_MAX_CHAR_COUNT } from "settings";
1011
import { useUser } from "hooks/useUser";
1112
import { useSelector } from "hooks/useSelector";
1213
import { currentVenueSelectorData } from "utils/selectors";
@@ -74,15 +75,16 @@ const EditProfileModal: React.FunctionComponent<PropsType> = ({
7475
placeholder="Your display name"
7576
ref={register({
7677
required: true,
77-
maxLength: 16,
78+
maxLength: DISPLAY_NAME_MAX_CHAR_COUNT,
7879
})}
7980
/>
8081
{errors.partyName && errors.partyName.type === "required" && (
8182
<span className="input-error">Display name is required</span>
8283
)}
8384
{errors.partyName && errors.partyName.type === "maxLength" && (
8485
<span className="input-error">
85-
Display name must be 16 characters or less
86+
Display name must be {DISPLAY_NAME_MAX_CHAR_COUNT} characters or
87+
less
8688
</span>
8789
)}
8890
{user && (

src/components/organisms/ProfileModal/EditProfileForm/EditProfileForm.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { updateUserProfile } from "pages/Account/helpers";
77
import { QuestionType } from "types/Question";
88
import ProfilePictureInput from "components/molecules/ProfilePictureInput";
99
import { useUser } from "hooks/useUser";
10-
import { DEFAULT_PROFILE_IMAGE } from "settings";
10+
import { DEFAULT_PROFILE_IMAGE, DISPLAY_NAME_MAX_CHAR_COUNT } from "settings";
1111
import { useSelector } from "hooks/useSelector";
1212
import { currentVenueSelectorData } from "utils/selectors";
1313

@@ -70,15 +70,16 @@ const EditProfileForm: React.FunctionComponent<PropsType> = ({
7070
placeholder="Your display name"
7171
ref={register({
7272
required: true,
73-
maxLength: 16,
73+
maxLength: DISPLAY_NAME_MAX_CHAR_COUNT,
7474
})}
7575
/>
7676
{errors.partyName && errors.partyName.type === "required" && (
7777
<span className="input-error">Display name is required</span>
7878
)}
7979
{errors.partyName && errors.partyName.type === "maxLength" && (
8080
<span className="input-error">
81-
Display name must be 16 characters or less
81+
Display name must be {DISPLAY_NAME_MAX_CHAR_COUNT} characters or
82+
less
8283
</span>
8384
)}
8485
{user && (

src/pages/Account/Profile.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { RouterLocation } from "types/RouterLocation";
99
import { useUser } from "hooks/useUser";
1010
import { IS_BURN } from "secrets";
1111
import getQueryParameters from "utils/getQueryParameters";
12-
import { DEFAULT_VENUE } from "settings";
12+
import { DEFAULT_VENUE, DISPLAY_NAME_MAX_CHAR_COUNT } from "settings";
1313
import { useVenueId } from "hooks/useVenueId";
1414

1515
export interface ProfileFormData {
@@ -71,19 +71,21 @@ const Profile: React.FunctionComponent<PropsType> = ({ location }) => {
7171
placeholder="Your display name"
7272
ref={register({
7373
required: true,
74-
maxLength: 16,
74+
maxLength: DISPLAY_NAME_MAX_CHAR_COUNT,
7575
})}
7676
autoComplete="off"
7777
/>
7878
<span className="input-info">
79-
This is your public name (max 16 characters)
79+
This is your display name (max {DISPLAY_NAME_MAX_CHAR_COUNT}{" "}
80+
characters)
8081
</span>
8182
{errors.partyName && errors.partyName.type === "required" && (
8283
<span className="input-error">Display name is required</span>
8384
)}
8485
{errors.partyName && errors.partyName.type === "maxLength" && (
8586
<span className="input-error">
86-
Display name must be 16 characters or less
87+
Display name must be {DISPLAY_NAME_MAX_CHAR_COUNT} characters or
88+
less
8789
</span>
8890
)}
8991
{user && (

src/settings.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export const SPARKLEVERSE_LOGO_URL = sparkleverseLogo;
5454
export const DEFAULT_PARTY_NAME = "Anon";
5555
export const DEFAULT_EDIT_PROFILE_TEXT =
5656
"I haven't edited my profile to tell you yet";
57+
export const DISPLAY_NAME_MAX_CHAR_COUNT = 40;
5758
export const VENUE_CHAT_AGE_DAYS = 30;
5859
export const VENUE_NAME_MIN_CHAR_COUNT = 3;
5960
export const VENUE_NAME_MAX_CHAR_COUNT = 50;

0 commit comments

Comments
 (0)