Skip to content

Commit 40b96f8

Browse files
committed
feat(edit-profile): validation on displayname not empty
1 parent b1f215e commit 40b96f8

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/screens/profile/EditProfileScreen.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,11 @@ const EditProfileScreen = () => {
230230
onPress={() => {
231231
handleFormSubmit();
232232
}}
233+
disabled={isLoading || formData.displayName?.length === 0}
233234
/>
234235
),
235236
});
236-
}, [navigation, handleFormSubmit]);
237+
}, [navigation, handleFormSubmit, formData, isLoading]);
237238

238239
if (isLoading) {
239240
return (
@@ -294,6 +295,8 @@ const EditProfileScreen = () => {
294295
setFormDataChanged(true);
295296
}}
296297
autoCapitalize="none"
298+
multiline={true}
299+
numberOfLines={4}
297300
/>
298301
<TextInput
299302
value={formData.location}

src/types/user.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
export interface UserData {
22
username: string;
33
displayName: string;
4-
bio: string;
4+
bio: string | null;
55
bioEntities: BioEntities;
66
avatarUrl: string | null;
77
bannerUrl: string | null;
88
location: string | null;
9-
websiteUrl: string;
9+
websiteUrl: string | null;
1010
birthDate: string | null;
1111
joinedAt: string;
1212
relationship: {

0 commit comments

Comments
 (0)