Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/components/EmptySelectionListContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type EmptySelectionListContentProps = {
contentType: string;
};

const CONTENT_TYPES = [CONST.IOU.TYPE.CREATE];
const CONTENT_TYPES = [CONST.IOU.TYPE.CREATE, CONST.IOU.TYPE.SUBMIT];
type ContentType = TupleToUnion<typeof CONTENT_TYPES>;

function isContentType(contentType: unknown): contentType is ContentType {
Expand All @@ -29,8 +29,8 @@ function EmptySelectionListContent({contentType}: EmptySelectionListContentProps
if (!isContentType(contentType)) {
return null;
}

const EmptySubtitle = <Text style={[styles.textAlignCenter]}>{translate(`emptyList.${contentType}.subtitleText`)}</Text>;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question, is contentType now being used at all anywhere?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we use it for validation: show the screen only for specific content types.

const translationKeyContentType = CONST.IOU.TYPE.CREATE;
const EmptySubtitle = <Text style={[styles.textAlignCenter]}>{translate(`emptyList.${translationKeyContentType}.subtitleText`)}</Text>;

return (
<ScrollView contentContainerStyle={[styles.flexGrow1]}>
Expand All @@ -39,7 +39,7 @@ function EmptySelectionListContent({contentType}: EmptySelectionListContentProps
icon={Illustrations.ToddWithPhones}
iconWidth={variables.emptySelectionListIconWidth}
iconHeight={variables.emptySelectionListIconHeight}
title={translate(`emptyList.${contentType}.title`)}
title={translate(`emptyList.${translationKeyContentType}.title`)}
shouldShowLink={false}
CustomSubtitle={EmptySubtitle}
containerStyle={[styles.mb8, styles.ph15]}
Expand Down