From aaf24d30d6dce4bc61b74a9bf64148b0417453a1 Mon Sep 17 00:00:00 2001 From: VickyStash Date: Tue, 30 Jul 2024 08:51:16 +0200 Subject: [PATCH 1/3] Fix emojis overlap with each other --- src/components/Composer/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Composer/index.tsx b/src/components/Composer/index.tsx index 4e192e908458..c7f109eea9fe 100755 --- a/src/components/Composer/index.tsx +++ b/src/components/Composer/index.tsx @@ -345,9 +345,10 @@ function Composer( scrollStyleMemo, StyleUtils.getComposerMaxHeightStyle(maxLines, isComposerFullSize), isComposerFullSize ? ({height: '100%', maxHeight: 'none' as DimensionValue} as TextStyle) : undefined, + doesTextContainOnlyEmojis ? styles.onlyEmojisTextLineHeight : undefined, ], - [style, styles.rtlTextRenderForSafari, scrollStyleMemo, StyleUtils, maxLines, isComposerFullSize], + [style, doesTextContainOnlyEmojis, styles.onlyEmojisTextLineHeight, styles.rtlTextRenderForSafari, scrollStyleMemo, StyleUtils, maxLines, isComposerFullSize], ); return ( From 95aa3a1436ea01f90ab1565ac37aa84775a6f6b6 Mon Sep 17 00:00:00 2001 From: VickyStash Date: Tue, 30 Jul 2024 09:22:01 +0200 Subject: [PATCH 2/3] Fix "Write something..." display --- src/components/Composer/index.native.tsx | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/components/Composer/index.native.tsx b/src/components/Composer/index.native.tsx index 9c380eb336c3..5423216a8876 100644 --- a/src/components/Composer/index.native.tsx +++ b/src/components/Composer/index.native.tsx @@ -12,6 +12,7 @@ import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import updateIsFullComposerAvailable from '@libs/ComposerUtils/updateIsFullComposerAvailable'; import * as EmojiUtils from '@libs/EmojiUtils'; +import CONST from '@src/CONST'; import type {ComposerProps} from './types'; const excludeNoStyles: Array = []; @@ -39,6 +40,10 @@ function Composer( ) { const textInput = useRef(null); const {isFocused, shouldResetFocusRef} = useResetComposerFocus(textInput); + const doesTextContainEmojis = useMemo(() => { + const emojisRegex = new RegExp(CONST.REGEX.EMOJIS, CONST.REGEX.EMOJIS.flags.concat('g')); + return emojisRegex.test(value ?? ''); + }, [value]); const doesTextContainOnlyEmojis = useMemo(() => EmojiUtils.containsOnlyEmojis(value ?? ''), [value]); const theme = useTheme(); const markdownStyle = useMarkdownStyle(doesTextContainOnlyEmojis, !isGroupPolicyReport ? excludeReportMentionStyle : excludeNoStyles); @@ -73,10 +78,17 @@ function Composer( }, [shouldClear, onClear]); const maxHeightStyle = useMemo(() => StyleUtils.getComposerMaxHeightStyle(maxLines, isComposerFullSize), [StyleUtils, isComposerFullSize, maxLines]); - const composerStyle = useMemo( - () => StyleSheet.flatten([style, doesTextContainOnlyEmojis ? styles.onlyEmojisTextLineHeight : styles.emojisWithTextLineHeight]), - [style, doesTextContainOnlyEmojis, styles], - ); + const composerStyle = useMemo(() => { + let lineHeightStyle; + + if (doesTextContainOnlyEmojis) { + lineHeightStyle = styles.onlyEmojisTextLineHeight; + } else if (doesTextContainEmojis) { + lineHeightStyle = styles.emojisWithTextLineHeight; + } + + return StyleSheet.flatten([style, lineHeightStyle]); + }, [style, doesTextContainEmojis, doesTextContainOnlyEmojis, styles]); return ( Date: Tue, 30 Jul 2024 11:04:22 +0200 Subject: [PATCH 3/3] Fix emoji is cut off in workspace description --- src/components/TextInput/BaseTextInput/index.native.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/TextInput/BaseTextInput/index.native.tsx b/src/components/TextInput/BaseTextInput/index.native.tsx index 59f205da023f..03c33e93c5b0 100644 --- a/src/components/TextInput/BaseTextInput/index.native.tsx +++ b/src/components/TextInput/BaseTextInput/index.native.tsx @@ -348,6 +348,7 @@ function BaseTextInput( inputProps.secureTextEntry && styles.secureInput, !isMultiline && {height, lineHeight: undefined}, + isMultiline && isMarkdownEnabled ? {lineHeight: variables.lineHeightEmojisWithTextComposer} : null, // Stop scrollbar flashing when breaking lines with autoGrowHeight enabled. ...(autoGrowHeight