diff --git a/src/components/UserProfile.jsx b/src/components/UserProfile.jsx index 0d380b24..7f813696 100644 --- a/src/components/UserProfile.jsx +++ b/src/components/UserProfile.jsx @@ -92,6 +92,10 @@ export const UserDetails = ({ allowEditing, updateProfile }) => { + const checkNull = (value) => { + if (value === 'null') return true + else return false + } return (
{!user ? ( @@ -110,7 +114,11 @@ export const UserDetails = ({ data-cy='edit-Name' >

- {user.Name ? user.Name : user.username} + {user.Name + ? checkNull(user.Name) + ? user.username + : user.Name + : user.username}

- {user.Bio || + {(user.Bio && !checkNull(user.Bio)) || (allowEditing ? 'Say something about yourself' : 'Hi There!')}

@@ -150,7 +158,11 @@ export const UserDetails = ({ data-cy='edit-Profession' > - {!user.Profession ? 'Your job title' : user.Profession} + {!user.Profession + ? 'Your job title' + : checkNull(user.Profession) + ? 'Your job title' + : user.Profession} @@ -169,7 +181,11 @@ export const UserDetails = ({ data-cy='edit-Company' > - {!user.Company ? 'Your company name' : user.Company} + {!user.Company + ? 'Your company name' + : checkNull(user.Company) + ? 'Your company name' + : user.Company} @@ -189,14 +205,18 @@ export const UserDetails = ({ > {user.LinkedIn ? ( - - {user.LinkedIn} - + checkNull(user.LinkedIn) ? ( + 'Your LinkedIn username' + ) : ( + + {user.LinkedIn} + + ) ) : ( 'Your LinkedIn username' )} @@ -219,14 +239,18 @@ export const UserDetails = ({ > {user.Twitter ? ( - - {user.Twitter ? `@${user.Twitter}` : ''} - + checkNull(user.Twitter) ? ( + 'Your Twitter handle' + ) : ( + + {user.Twitter ? `@${user.Twitter}` : ''} + + ) ) : ( 'Your Twitter handle' )}