Skip to content

Commit

Permalink
fixed wrapping for native apps
Browse files Browse the repository at this point in the history
  • Loading branch information
jeet-dhandha committed Sep 19, 2023
1 parent 8ddec2d commit 33934c5
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/components/MenuItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ import * as Session from '../libs/actions/Session';
import Hoverable from './Hoverable';
import useWindowDimensions from '../hooks/useWindowDimensions';
import RenderHTML from './RenderHTML';
import getPlatform from '../libs/getPlatform';

const platform = getPlatform();
const isNative = platform === CONST.PLATFORM.IOS || platform === CONST.PLATFORM.ANDROID;

const propTypes = menuItemPropTypes;

Expand Down Expand Up @@ -247,11 +251,15 @@ const MenuItem = React.forwardRef((props, ref) => {
</Text>
)}
<View style={[styles.flexRow, styles.alignItemsCenter]}>
{Boolean(props.title) && (Boolean(props.shouldRenderAsHTML) || (Boolean(props.shouldParseTitle) && Boolean(html.length))) && (
<View style={styles.chatItemMessage}>
{Boolean(props.title) &&
(Boolean(props.shouldRenderAsHTML) || (Boolean(props.shouldParseTitle) && Boolean(html.length))) &&
(isNative ? (
<RenderHTML html={getProcessedTitle} />
</View>
)}
) : (
<View style={styles.chatItemMessage}>
<RenderHTML html={getProcessedTitle} />
</View>
))}
{!props.shouldRenderAsHTML && !html.length && Boolean(props.title) && (
<Text
style={titleTextStyle}
Expand Down

0 comments on commit 33934c5

Please sign in to comment.