@@ -49,13 +49,9 @@ import {
4949 nameMaxLength ,
5050 nameMinLength ,
5151 nameValidationPattern ,
52+ profileAboutMeMinLength ,
5253} from "utils/validation" ;
5354
54- import {
55- ABOUT_ME_MIN_LENGTH ,
56- DEFAULT_ABOUT_ME_HEADINGS ,
57- DEFAULT_HOBBIES_HEADINGS ,
58- } from "./constants" ;
5955import StatusCardGroup from "./StatusCard" ;
6056
6157export type EditProfileFormValues = Omit <
@@ -297,7 +293,7 @@ export default function EditProfileForm() {
297293 regionsVisited : user . regionsVisitedList ,
298294 regionsLived : user . regionsLivedList ,
299295 aboutMe : user . aboutMe ,
300- thingsILike : user . thingsILike || DEFAULT_HOBBIES_HEADINGS ,
296+ thingsILike : user . thingsILike ,
301297 additionalInformation : user . additionalInformation ,
302298 location : {
303299 city : user . city ,
@@ -382,9 +378,6 @@ export default function EditProfileForm() {
382378 fluency : LanguageAbility . Fluency . FLUENCY_FLUENT ,
383379 } ) ) ,
384380 } ,
385- thingsILike : DEFAULT_HOBBIES_HEADINGS . includes ( data . thingsILike )
386- ? ""
387- : data . thingsILike ,
388381 } ,
389382 setMutationError : setErrorMessage ,
390383 onSuccess : ( ) => {
@@ -411,7 +404,7 @@ export default function EditProfileForm() {
411404 const handleSubmitButtonClick = ( event : FormEvent < HTMLFormElement > ) => {
412405 event . preventDefault ( ) ;
413406
414- if ( aboutMeField . length < ABOUT_ME_MIN_LENGTH || ! user ?. avatarUrl ) {
407+ if ( aboutMeField . length < profileAboutMeMinLength || ! user ?. avatarUrl ) {
415408 setShowIncompleteProfileDialog ( true ) ;
416409 } else {
417410 onSubmit ( ) ;
@@ -915,15 +908,15 @@ export default function EditProfileForm() {
915908 id = "aboutMe"
916909 label = { t ( "profile:heading.about_me" ) }
917910 name = "aboutMe"
918- placeholder = { DEFAULT_ABOUT_ME_HEADINGS }
911+ placeholder = { t ( "profile:about_me_textbox_placeholder" ) }
919912 defaultValue = { user . aboutMe }
920913 control = { control }
921- warning = { aboutMeField . length < ABOUT_ME_MIN_LENGTH }
914+ warning = { aboutMeField . length < profileAboutMeMinLength }
922915 helperText = {
923916 < Trans
924917 i18nKey = "profile:helper_text.characters_remaining"
925918 values = { {
926- count : ABOUT_ME_MIN_LENGTH - aboutMeField . length ,
919+ count : profileAboutMeMinLength - aboutMeField . length ,
927920 } }
928921 components = { { bold : < strong /> } }
929922 />
@@ -956,7 +949,8 @@ export default function EditProfileForm() {
956949 id = "thingsILike"
957950 label = { t ( "profile:heading.hobbies_section" ) }
958951 name = "thingsILike"
959- defaultValue = { user . thingsILike || DEFAULT_HOBBIES_HEADINGS }
952+ defaultValue = { user . thingsILike }
953+ placeholder = { t ( "profile:hobbies_textbox_placeholder" ) }
960954 control = { control }
961955 />
962956 </ FieldGroup >
@@ -1070,7 +1064,7 @@ export default function EditProfileForm() {
10701064 >
10711065 { t ( "profile:incomplete_dialog.description" ) }
10721066 </ Typography >
1073- { aboutMeField . length < ABOUT_ME_MIN_LENGTH && (
1067+ { aboutMeField . length < profileAboutMeMinLength && (
10741068 < ListItem key = { 1 } style = { { display : "list-item" } } >
10751069 { `• ${ t ( "profile:incomplete_dialog.about_me_message" ) } ` }
10761070 </ ListItem >
0 commit comments