Skip to main content

Profile And Settings Module

Quick Answer

The profile module lives in src/core/profile. It provides reusable screens for editing account details, user settings, blocked users, contact us, public profile display, and form-driven settings UI.

Most profile customization is done through app config, not by rewriting the form renderer.

Source Map

src/core/profile
├── hooks
├── ui
└── index.ts

Important exports:

ExportPurpose
IMEditProfileScreenUser profile edit screen.
IMUserSettingsScreenSettings list for account-level actions.
IMProfileSettingsScreenProfile-related settings screen.
IMBlockedUsersScreenList and manage blocked users.
IMContactUsScreenContact/support form.
IMUserProfileComponentReusable public profile UI.
IMFormComponentForm renderer used by edit/settings screens.

Form Configuration

IMFormComponent renders fields from a config object. It supports text, switch, button, and select fields.

Example:

const editProfileFields = {
sections: [
{
title: 'Public Profile',
fields: [
{
displayName: 'First Name',
type: 'text',
editable: true,
key: 'firstName',
placeholder: 'Your first name',
},
{
displayName: 'Last Name',
type: 'text',
editable: true,
key: 'lastName',
placeholder: 'Your last name',
},
],
},
{
title: 'Private Details',
fields: [
{
displayName: 'Phone Number',
type: 'text',
editable: true,
key: 'phone',
placeholder: 'Your phone number',
},
],
},
],
}

The parent screen receives changes through:

CallbackPurpose
onFormChangeCalled when a field changes.
onFormButtonPressCalled when a button field is pressed.

Where To Customize

Start with the app config and look for fields such as:

editProfileFields
userSettingsFields
contactUsFields

Use those config fields to add, remove, reorder, or rename profile and settings fields. Edit src/core/profile/ui/IMFormComponent only when you need a new reusable field type or form behavior.

Data Contract

Field key values should match the user object fields used by the app and backend. Common keys include:

firstName
lastName
email
phone
profilePictureURL

If you add custom profile fields:

  1. Add the field to the profile form config.
  2. Make sure the save flow writes it to your backend.
  3. Update Firestore rules or backend validation.
  4. Update public profile screens if the field should be visible.
  5. Update privacy policy/store disclosures if the field collects sensitive data.

Blocked Users

Blocked users are connected to the user reporting module. If your app supports chat, feed posts, reviews, or other user-generated content, keep profile blocking and reporting flows enabled and tested.

See User Reporting.

Verification Checklist

Test:

  • edit profile opens;
  • required fields validate;
  • profile save updates the backend;
  • profile image upload works if enabled;
  • settings actions work;
  • contact form submits or shows a configured support path;
  • blocked users list loads;
  • unblocking a user works if the app supports it;
  • added custom fields appear in the UI and persist after app restart.

Troubleshooting

ProblemFix
Field renders but does not saveConfirm the field key is handled by the save flow and backend.
Field saves but disappears after restartConfirm the user read API returns the custom field.
Select field shows wrong labelCheck options and displayOptions arrays have matching order.
Profile photo upload failsCheck camera/media permissions and Firebase Storage or media upload Functions.
Blocked users screen is empty foreverCheck user-reporting hooks, backend rules, and current user ID.