Skip to content

Commit

Permalink
Merge pull request #40845 from GandalfGwaihir/issue40348
Browse files Browse the repository at this point in the history
[Fix]: Preview with `HTML tags` can be seen in LHN chat preview
  • Loading branch information
tylerkaraszewski authored Apr 30, 2024
2 parents 33e73ef + dc3119f commit a7f8e68
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/LHNOptionsList/OptionRowLHN.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {useFocusEffect} from '@react-navigation/native';
import ExpensiMark from 'expensify-common/lib/ExpensiMark';
import React, {useCallback, useRef, useState} from 'react';
import type {GestureResponderEvent, ViewStyle} from 'react-native';
import {StyleSheet, View} from 'react-native';
Expand Down Expand Up @@ -28,6 +29,8 @@ import CONST from '@src/CONST';
import {isEmptyObject} from '@src/types/utils/EmptyObject';
import type {OptionRowLHNProps} from './types';

const parser = new ExpensiMark();

function OptionRowLHN({reportID, isFocused = false, onSelectRow = () => {}, optionItem, viewMode = 'default', style, onLayout = () => {}, hasDraftComment}: OptionRowLHNProps) {
const theme = useTheme();
const styles = useThemeStyles();
Expand Down Expand Up @@ -59,8 +62,8 @@ function OptionRowLHN({reportID, isFocused = false, onSelectRow = () => {}, opti
const textUnreadStyle = optionItem?.isUnread && optionItem.notificationPreference !== CONST.REPORT.NOTIFICATION_PREFERENCE.MUTE ? [textStyle, styles.sidebarLinkTextBold] : [textStyle];
const displayNameStyle = [styles.optionDisplayName, styles.optionDisplayNameCompact, styles.pre, textUnreadStyle, style];
const alternateTextStyle = isInFocusMode
? [textStyle, styles.optionAlternateText, styles.pre, styles.textLabelSupporting, styles.optionAlternateTextCompact, styles.ml2, style]
: [textStyle, styles.optionAlternateText, styles.pre, styles.textLabelSupporting, style];
? [textStyle, styles.optionAlternateText, styles.textLabelSupporting, styles.optionAlternateTextCompact, styles.ml2, style]
: [textStyle, styles.optionAlternateText, styles.textLabelSupporting, style];

const contentContainerStyles = isInFocusMode ? [styles.flex1, styles.flexRow, styles.overflowHidden, StyleUtils.getCompactContentContainerStyles()] : [styles.flex1];
const sidebarInnerRowStyle = StyleSheet.flatten<ViewStyle>(
Expand Down Expand Up @@ -221,7 +224,7 @@ function OptionRowLHN({reportID, isFocused = false, onSelectRow = () => {}, opti
numberOfLines={1}
accessibilityLabel={translate('accessibilityHints.lastChatMessagePreview')}
>
{optionItem.alternateText}
{parser.htmlToText(optionItem.alternateText)}
</Text>
) : null}
</View>
Expand Down

0 comments on commit a7f8e68

Please sign in to comment.