The Chat tab in SkinFirts’s bottom navigation gives patients a dedicated messaging space to communicate directly with their dermatologist. The screen renders a full conversation thread, a text input bar, and quick-action buttons for placing voice or video calls — all within a singleDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/BhushanBadhe39/SkinFirts/llms.txt
Use this file to discover all available pages before exploring further.
ChatScreen component.
Chat UI Layout
The conversation thread is built on aFlatList with the inverted prop set to true, so the most recent messages always appear at the bottom of the screen without any manual scroll management. Each list item is rendered as a ChatBubble component. Sender messages are right-aligned with a distinct background colour; receiver messages are left-aligned with a lighter shade.
chatHistory State Shape
The chatHistory state is an array of 16 message objects managed by useState. Each object describes who sent the message, when it was sent, and the message body. The initial seed represents a back-and-forth conversation about building the app itself.
| Field | Type | Description |
|---|---|---|
sender | boolean | true = current user (right side); false = doctor (left side) |
time | string | Timestamp displayed below the bubble (e.g. '10:45') |
msg | string | The text content of the message |
Send and Receive Flow
Two handler functions manage posting messages to the conversation thread. Both prepend a new message object to the front of thechatHistory array (which, combined with the inverted FlatList, makes it appear at the bottom of the screen).
handleSenderPost— called by the send button (send-outlineicon). Posts the current input as a message from the patient (right-aligned bubble).handleReceiverPost— called by the attach button (attach-outlineicon). Posts the current input as a simulated incoming message from the doctor (left-aligned bubble).
msg.trim() and clear the text field after posting.
ChatBubble Component
TheChatBubble component is the single visual building block for every message in the thread. It accepts three props and renders the bubble with conditional alignment and background colour.
| Prop | Type | Description |
|---|---|---|
isSender | boolean | Aligns the bubble right (flex-end) when true, left (flex-start) when false |
text | string | Message body displayed inside the bubble |
time | string | Timestamp rendered below the bubble in a smaller font |
ChatBubble.jsx:
- Sender bubble —
colors.shadebackground,borderBottomRightRadius: 0for a speech-bubble tail effect. - Receiver bubble —
colors.shadeLightbackground,borderBottomLeftRadius: 0for the opposing tail.
Input Area
The bottom bar contains three elements laid out in a horizontal row:| Element | Icon | Action |
|---|---|---|
| Attach button | attach-outline | Calls handleReceiverPost (simulates an incoming message) |
| Text input | — | Bound to msg state via value / onChangeText; placeholder 'Write Here...' |
| Send button | send-outline | Calls handleSenderPost (posts the patient’s message) |
mic-outline icon sits inside the text input area on the trailing edge as a decorative element.
Screen Header
The header bar is rendered inside a primary-colouredView and contains two groups of controls:
Left side:
- Back button (
chevron-back-outline) — navigates to'Home' - Doctor name label — displays
Dr. Bhushan Badhe
RoundButtonswithcall-outlineicon — for initiating a voice callRoundButtonswithvideocam-outlineicon — for initiating a video call
The chat is entirely client-side. There is no backend or WebSocket integration — all messages are stored in component state via
useState and are lost when the screen unmounts or the app restarts. Persisting messages would require connecting to a real-time messaging service and storing history server-side or in AsyncStorage.