Skip to content

Commit

Permalink
exclude reportMention style for chats not from group policy
Browse files Browse the repository at this point in the history
  • Loading branch information
robertKozik committed May 7, 2024
1 parent 9556b71 commit 84290e4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/components/Composer/index.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ function Composer(
// On Android the selection prop is required on the TextInput but this prop has issues on IOS
selection,
value,
isGroupPolicyReport = false,
...props
}: ComposerProps,
ref: ForwardedRef<TextInput>,
) {
const textInput = useRef<AnimatedMarkdownTextInputRef | null>(null);
const {isFocused, shouldResetFocus} = useResetComposerFocus(textInput);
const theme = useTheme();
const markdownStyle = useMarkdownStyle(value);
const markdownStyle = useMarkdownStyle(value, !isGroupPolicyReport ? ['mentionReport'] : []);
const styles = useThemeStyles();
const StyleUtils = useStyleUtils();

Expand Down
3 changes: 2 additions & 1 deletion src/components/Composer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,14 @@ function Composer(
isReportActionCompose = false,
isComposerFullSize = false,
shouldContainScroll = false,
isGroupPolicyReport = false,
...props
}: ComposerProps,
ref: ForwardedRef<TextInput | HTMLInputElement>,
) {
const theme = useTheme();
const styles = useThemeStyles();
const markdownStyle = useMarkdownStyle(value);
const markdownStyle = useMarkdownStyle(value, !isGroupPolicyReport ? ['mentionReport'] : []);
const StyleUtils = useStyleUtils();
const textRef = useRef<HTMLElement & RNText>(null);
const textInput = useRef<AnimatedMarkdownTextInputRef | null>(null);
Expand Down
3 changes: 3 additions & 0 deletions src/components/Composer/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ type ComposerProps = TextInputProps & {

/** Should make the input only scroll inside the element avoid scroll out to parent */
shouldContainScroll?: boolean;

/** Indicates whether the composer is in a group policy report. Used for disabling report mentioning style in markdown input */
isGroupPolicyReport?: boolean;
};

export type {TextSelection, ComposerProps};
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,7 @@ function ComposerWithSuggestions(
onLayout={onLayout}
onScroll={hideSuggestionMenu}
shouldContainScroll={Browser.isMobileSafari()}
isGroupPolicyReport={isGroupPolicyReport}
/>
</View>

Expand Down

0 comments on commit 84290e4

Please sign in to comment.