File tree Expand file tree Collapse file tree 4 files changed +15
-9
lines changed
ProfileModal/EditProfileForm Expand file tree Collapse file tree 4 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { QuestionsFormData } from "pages/Account/Questions";
7
7
import { updateUserProfile } from "pages/Account/helpers" ;
8
8
import { QuestionType } from "types/Question" ;
9
9
import ProfilePictureInput from "components/molecules/ProfilePictureInput" ;
10
+ import { DISPLAY_NAME_MAX_CHAR_COUNT } from "settings" ;
10
11
import { useUser } from "hooks/useUser" ;
11
12
import { useSelector } from "hooks/useSelector" ;
12
13
import { currentVenueSelectorData } from "utils/selectors" ;
@@ -74,15 +75,16 @@ const EditProfileModal: React.FunctionComponent<PropsType> = ({
74
75
placeholder = "Your display name"
75
76
ref = { register ( {
76
77
required : true ,
77
- maxLength : 16 ,
78
+ maxLength : DISPLAY_NAME_MAX_CHAR_COUNT ,
78
79
} ) }
79
80
/>
80
81
{ errors . partyName && errors . partyName . type === "required" && (
81
82
< span className = "input-error" > Display name is required</ span >
82
83
) }
83
84
{ errors . partyName && errors . partyName . type === "maxLength" && (
84
85
< 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
86
88
</ span >
87
89
) }
88
90
{ user && (
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import { updateUserProfile } from "pages/Account/helpers";
7
7
import { QuestionType } from "types/Question" ;
8
8
import ProfilePictureInput from "components/molecules/ProfilePictureInput" ;
9
9
import { useUser } from "hooks/useUser" ;
10
- import { DEFAULT_PROFILE_IMAGE } from "settings" ;
10
+ import { DEFAULT_PROFILE_IMAGE , DISPLAY_NAME_MAX_CHAR_COUNT } from "settings" ;
11
11
import { useSelector } from "hooks/useSelector" ;
12
12
import { currentVenueSelectorData } from "utils/selectors" ;
13
13
@@ -70,15 +70,16 @@ const EditProfileForm: React.FunctionComponent<PropsType> = ({
70
70
placeholder = "Your display name"
71
71
ref = { register ( {
72
72
required : true ,
73
- maxLength : 16 ,
73
+ maxLength : DISPLAY_NAME_MAX_CHAR_COUNT ,
74
74
} ) }
75
75
/>
76
76
{ errors . partyName && errors . partyName . type === "required" && (
77
77
< span className = "input-error" > Display name is required</ span >
78
78
) }
79
79
{ errors . partyName && errors . partyName . type === "maxLength" && (
80
80
< 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
82
83
</ span >
83
84
) }
84
85
{ user && (
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import { RouterLocation } from "types/RouterLocation";
9
9
import { useUser } from "hooks/useUser" ;
10
10
import { IS_BURN } from "secrets" ;
11
11
import getQueryParameters from "utils/getQueryParameters" ;
12
- import { DEFAULT_VENUE } from "settings" ;
12
+ import { DEFAULT_VENUE , DISPLAY_NAME_MAX_CHAR_COUNT } from "settings" ;
13
13
import { useVenueId } from "hooks/useVenueId" ;
14
14
15
15
export interface ProfileFormData {
@@ -71,19 +71,21 @@ const Profile: React.FunctionComponent<PropsType> = ({ location }) => {
71
71
placeholder = "Your display name"
72
72
ref = { register ( {
73
73
required : true ,
74
- maxLength : 16 ,
74
+ maxLength : DISPLAY_NAME_MAX_CHAR_COUNT ,
75
75
} ) }
76
76
autoComplete = "off"
77
77
/>
78
78
< 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)
80
81
</ span >
81
82
{ errors . partyName && errors . partyName . type === "required" && (
82
83
< span className = "input-error" > Display name is required</ span >
83
84
) }
84
85
{ errors . partyName && errors . partyName . type === "maxLength" && (
85
86
< 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
87
89
</ span >
88
90
) }
89
91
{ user && (
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ export const SPARKLEVERSE_LOGO_URL = sparkleverseLogo;
54
54
export const DEFAULT_PARTY_NAME = "Anon" ;
55
55
export const DEFAULT_EDIT_PROFILE_TEXT =
56
56
"I haven't edited my profile to tell you yet" ;
57
+ export const DISPLAY_NAME_MAX_CHAR_COUNT = 40 ;
57
58
export const VENUE_CHAT_AGE_DAYS = 30 ;
58
59
export const VENUE_NAME_MIN_CHAR_COUNT = 3 ;
59
60
export const VENUE_NAME_MAX_CHAR_COUNT = 50 ;
You can’t perform that action at this time.
0 commit comments