Skip to content

Commit

Permalink
Update Header props type
Browse files Browse the repository at this point in the history
  • Loading branch information
VickyStash committed Dec 29, 2023
1 parent 654e903 commit 1e8b542
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React, {ReactElement} from 'react';
import React, {ReactNode} from 'react';
import {StyleProp, TextStyle, View} from 'react-native';
import useThemeStyles from '@hooks/useThemeStyles';
import EnvironmentBadge from './EnvironmentBadge';
import Text from './Text';

type HeaderProps = {
/** Title of the Header */
title?: string | ReactElement;
title?: ReactNode;

/** Subtitle of the header */
subtitle?: string | ReactElement;
subtitle?: ReactNode;

/** Should we show the environment badge (dev/stg)? */
shouldShowEnvironmentBadge?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/components/HeaderWithBackButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function HeaderWithBackButton({
onThreeDotsButtonPress = () => {},
report = null,
policy,
personalDetails,
personalDetails = null,
shouldShowAvatarWithDisplay = false,
shouldShowBackButton = true,
shouldShowBorderBottom = false,
Expand Down
8 changes: 4 additions & 4 deletions src/components/HeaderWithBackButton/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ReactElement} from 'react';
import {ReactNode} from 'react';
import {OnyxCollection, OnyxEntry} from 'react-native-onyx';
import type {Action} from '@hooks/useSingleExecution';
import type {StepCounterParams} from '@src/languages/types';
Expand All @@ -23,7 +23,7 @@ type HeaderWithBackButtonProps = ChildrenProps & {
title?: string;

/** Subtitle of the header */
subtitle: string | ReactElement;
subtitle?: ReactNode;

/** Title color */
titleColor?: string;
Expand Down Expand Up @@ -92,10 +92,10 @@ type HeaderWithBackButtonProps = ChildrenProps & {
policy?: OnyxEntry<Policy>;

/** Policies, if we're showing the details for a report and need participant details for AvatarWithDisplay */
personalDetails: OnyxCollection<PersonalDetails>;
personalDetails?: OnyxCollection<PersonalDetails>;

/** Single execution function to prevent concurrent navigation actions */
singleExecution: <T extends unknown[]>(action: Action<T>) => Action<T>;
singleExecution?: <T extends unknown[]>(action: Action<T>) => Action<T>;

/** Whether we should navigate to report page when the route have a topMostReport */
shouldNavigateToTopMostReport?: boolean;
Expand Down

0 comments on commit 1e8b542

Please sign in to comment.