Skip to content

Commit

Permalink
add isGroupPolicyReport prop
Browse files Browse the repository at this point in the history
  • Loading branch information
dukenv0307 committed Apr 22, 2024
1 parent c95b4aa commit cd0f980
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type ComposerWithSuggestionsEditProps = ComposerProps & {
measureParentContainer: (callback: MeasureInWindowOnSuccessCallback) => void;
value: string;
selection: Selection;
isGroupPolicyReport: boolean;
};

function ComposerWithSuggestionsEdit(
Expand All @@ -45,6 +46,7 @@ function ComposerWithSuggestionsEdit(
updateDraft,
measureParentContainer,
id = undefined,
isGroupPolicyReport,
}: ComposerWithSuggestionsEditProps,
ref: ForwardedRef<TextInput>,
) {
Expand Down Expand Up @@ -87,6 +89,7 @@ function ComposerWithSuggestionsEdit(
selection={selection}
setSelection={setSelection}
resetKeyboardInput={resetKeyboardInput}
isGroupPolicyReport={isGroupPolicyReport}
/>
</>
);
Expand Down
1 change: 1 addition & 0 deletions src/pages/home/report/ReportActionItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,7 @@ function ReportActionItem({
action={action}
draftMessage={draftMessage}
reportID={report.reportID}
isGroupChatPolicy={ReportUtils.isGroupPolicy(report)}
index={index}
ref={textInputRef}
// Avoid defining within component due to an existing Onyx bug
Expand Down
6 changes: 5 additions & 1 deletion src/pages/home/report/ReportActionItemMessageEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ type ReportActionItemMessageEditProps = {
/** ReportID that holds the comment we're editing */
reportID: string;

/** If current composer is connected with report from group policy */
isGroupPolicyReport: boolean;

/** Position index of the report action in the overall report FlatList view */
index: number;

Expand All @@ -77,7 +80,7 @@ const isMobileSafari = Browser.isMobileSafari();
const shouldUseForcedSelectionRange = shouldUseEmojiPickerSelection();

function ReportActionItemMessageEdit(
{action, draftMessage, reportID, index, shouldDisableEmojiPicker = false, preferredSkinTone = CONST.EMOJI_DEFAULT_SKIN_TONE}: ReportActionItemMessageEditProps,
{action, draftMessage, reportID, isGroupPolicyReport, index, shouldDisableEmojiPicker = false, preferredSkinTone = CONST.EMOJI_DEFAULT_SKIN_TONE}: ReportActionItemMessageEditProps,
forwardedRef: ForwardedRef<(TextInput & HTMLTextAreaElement) | undefined>,
) {
const theme = useTheme();
Expand Down Expand Up @@ -526,6 +529,7 @@ function ReportActionItemMessageEdit(
suggestionsRef={suggestionsRef}
updateDraft={updateDraft}
measureParentContainer={measureContainer}
isGroupPolicyReport={isGroupPolicyReport}
/>
</View>
<View style={styles.editChatItemEmojiWrapper}>
Expand Down

0 comments on commit cd0f980

Please sign in to comment.