Skip to content

Commit ca89724

Browse files
committed
Added documentation in useHeader explaining the header background convention:
- Headers are 'surfaceless' by default (for content screens like conversation list and chat) - Settings-like screens (Profile, AppSettings) explicitly set surface background
1 parent 416ad8d commit ca89724

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

features/profiles/profile.screen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export function ProfileScreen() {
130130
// Header configuration
131131
useHeader(
132132
{
133-
backgroundColor: theme.colors.background.surface,
133+
backgroundColor: theme.colors.background.surface, // Use the same background color as the screen
134134
safeAreaEdges: ["top"],
135135
titleComponent: (
136136
<Text preset="body">

navigation/use-header.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ import { useLayoutEffect } from "react";
44

55
/**
66
* A hook that can be used to easily set the Header of a react-navigation screen from within the screen's component.
7+
*
8+
* Header Background Convention:
9+
* - By default, headers use a 'surfaceless' background to match content screens like conversation list and chat
10+
* - For settings-like screens (Profile, AppSettings, etc.) that use a 'surface' background,
11+
* explicitly set backgroundColor: theme.colors.background.surface in the header config
712
* @see [Documentation and Examples]{@link https://docs.infinite.red/ignite-cli/boilerplate/utility/useHeader/}
813
* @param {HeaderProps} headerProps - The props for the `Header` component.
914
* @param {any[]} deps - The dependencies to watch for changes to update the header.

0 commit comments

Comments
 (0)