diff --git a/src/components/DisplayNames/index.js b/src/components/DisplayNames/index.js index fd23a011bf69..4cf6fe235521 100644 --- a/src/components/DisplayNames/index.js +++ b/src/components/DisplayNames/index.js @@ -71,7 +71,7 @@ class DisplayNames extends PureComponent { // No need for any complex text-splitting, just return a simple Text component return ( {this.props.fullTitle} @@ -100,7 +100,7 @@ class DisplayNames extends PureComponent { > {/* // We need to get the refs to all the names which will be used to correct the horizontal position of the tooltip */} - this.childRefs[index] = el} style={this.props.textStyles}> + this.childRefs[index] = el} style={[...this.props.textStyles, styles.preWrap]}> {displayName} diff --git a/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js b/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js index 4f4f18d53da5..fbda8b4941dd 100755 --- a/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js +++ b/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js @@ -44,6 +44,10 @@ const customHTMLElementModels = { tagName: 'email-comment', mixedUAStyles: {whiteSpace: 'normal'}, }), + strong: defaultHTMLElementModels.span.extend({ + tagName: 'strong', + mixedUAStyles: {whiteSpace: 'pre'}, + }), }; const defaultViewProps = {style: [styles.alignItemsStart, styles.userSelectText]}; diff --git a/src/components/Header.js b/src/components/Header.js index a69317122aad..01752e8e0740 100644 --- a/src/components/Header.js +++ b/src/components/Header.js @@ -34,7 +34,7 @@ const Header = props => ( {/* If there's no subtitle then display a fragment to avoid an empty space which moves the main title */} {_.isString(props.subtitle) - ? Boolean(props.subtitle) && {props.subtitle} + ? Boolean(props.subtitle) && {props.subtitle} : props.subtitle} {props.shouldShowEnvironmentBadge && ( diff --git a/src/components/LHNOptionsList/OptionRowLHN.js b/src/components/LHNOptionsList/OptionRowLHN.js index c57d51d29eb2..d1d7830f312e 100644 --- a/src/components/LHNOptionsList/OptionRowLHN.js +++ b/src/components/LHNOptionsList/OptionRowLHN.js @@ -67,13 +67,13 @@ const OptionRowLHN = (props) => { : styles.sidebarLinkText; const textUnreadStyle = optionItem.isUnread ? [textStyle, styles.sidebarLinkTextBold] : [textStyle]; - const displayNameStyle = StyleUtils.combineStyles([styles.optionDisplayName, styles.optionDisplayNameCompact, ...textUnreadStyle], props.style); + const displayNameStyle = StyleUtils.combineStyles([styles.optionDisplayName, styles.optionDisplayNameCompact, styles.pre, ...textUnreadStyle], props.style); const textPillStyle = props.isFocused ? [styles.ml1, StyleUtils.getBackgroundColorWithOpacityStyle(themeColors.icon, 0.5)] : [styles.ml1]; const alternateTextStyle = StyleUtils.combineStyles(props.viewMode === CONST.OPTION_MODE.COMPACT - ? [textStyle, styles.optionAlternateText, styles.textLabelSupporting, styles.optionAlternateTextCompact, styles.ml2] - : [textStyle, styles.optionAlternateText, styles.textLabelSupporting], props.style); + ? [textStyle, styles.optionAlternateText, styles.pre, styles.textLabelSupporting, styles.optionAlternateTextCompact, styles.ml2] + : [textStyle, styles.optionAlternateText, styles.pre, styles.textLabelSupporting], props.style); const contentContainerStyles = props.viewMode === CONST.OPTION_MODE.COMPACT ? [styles.flex1, styles.flexRow, styles.overflowHidden, styles.alignItemsCenter] : [styles.flex1]; diff --git a/src/components/MenuItem.js b/src/components/MenuItem.js index 33563bb029be..2942f250ce83 100644 --- a/src/components/MenuItem.js +++ b/src/components/MenuItem.js @@ -58,6 +58,7 @@ const MenuItem = (props) => { (props.icon ? styles.ml3 : undefined), (props.shouldShowBasicTitle ? undefined : styles.textStrong), (props.interactive && props.disabled ? {...styles.disabledText, ...styles.userSelectNone} : undefined), + styles.pre, ], props.style); const descriptionTextStyle = StyleUtils.combineStyles([ styles.textLabelSupporting, diff --git a/src/components/OptionRow.js b/src/components/OptionRow.js index 532ae783bdd6..d64569840f8d 100644 --- a/src/components/OptionRow.js +++ b/src/components/OptionRow.js @@ -118,8 +118,8 @@ class OptionRow extends Component { : styles.sidebarLinkText; const textUnreadStyle = (this.props.boldStyle || this.props.option.boldStyle) ? [textStyle, styles.sidebarLinkTextBold] : [textStyle]; - const displayNameStyle = StyleUtils.combineStyles(styles.optionDisplayName, textUnreadStyle, this.props.style); - const alternateTextStyle = StyleUtils.combineStyles(textStyle, styles.optionAlternateText, styles.textLabelSupporting, this.props.style); + const displayNameStyle = StyleUtils.combineStyles(styles.optionDisplayName, textUnreadStyle, this.props.style, styles.pre); + const alternateTextStyle = StyleUtils.combineStyles(textStyle, styles.optionAlternateText, styles.textLabelSupporting, this.props.style, styles.pre); const contentContainerStyles = [styles.flex1]; const sidebarInnerRowStyle = StyleSheet.flatten([ styles.chatLinkRowPressable, diff --git a/src/pages/DetailsPage.js b/src/pages/DetailsPage.js index dcc6d74270b0..15e372c7201b 100755 --- a/src/pages/DetailsPage.js +++ b/src/pages/DetailsPage.js @@ -147,7 +147,7 @@ class DetailsPage extends React.PureComponent { )} {details.displayName && ( - + {isSMSLogin ? this.props.toLocalPhone(details.displayName) : details.displayName} )} diff --git a/src/pages/ReportDetailsPage.js b/src/pages/ReportDetailsPage.js index 5089b87c2742..87bedcd76135 100644 --- a/src/pages/ReportDetailsPage.js +++ b/src/pages/ReportDetailsPage.js @@ -139,7 +139,7 @@ class ReportDetailsPage extends Component { displayNamesWithTooltips={displayNamesWithTooltips} tooltipEnabled numberOfLines={1} - textStyles={[styles.textHeadline, styles.mb2, styles.textAlignCenter]} + textStyles={[styles.textHeadline, styles.mb2, styles.textAlignCenter, styles.pre]} shouldUseFullTitle={isChatRoom || isPolicyExpenseChat} /> @@ -149,6 +149,7 @@ class ReportDetailsPage extends Component { styles.optionAlternateText, styles.textLabelSupporting, styles.mb2, + styles.pre, ]} numberOfLines={1} > diff --git a/src/pages/ReportSettingsPage.js b/src/pages/ReportSettingsPage.js index 73469a441c1e..657000c690f8 100644 --- a/src/pages/ReportSettingsPage.js +++ b/src/pages/ReportSettingsPage.js @@ -192,7 +192,7 @@ class ReportSettingsPage extends Component { {this.props.translate('newRoomPage.roomName')} - + {this.props.report.reportName} @@ -213,7 +213,7 @@ class ReportSettingsPage extends Component { {this.props.translate('workspace.common.workspace')} - + {linkedWorkspace.name} diff --git a/src/pages/home/HeaderView.js b/src/pages/home/HeaderView.js index e1bfd267d8f2..899b85370928 100644 --- a/src/pages/home/HeaderView.js +++ b/src/pages/home/HeaderView.js @@ -123,7 +123,7 @@ const HeaderView = (props) => { displayNamesWithTooltips={displayNamesWithTooltips} tooltipEnabled numberOfLines={1} - textStyles={[styles.headerText, styles.textNoWrap]} + textStyles={[styles.headerText, styles.pre]} shouldUseFullTitle={isChatRoom || isPolicyExpenseChat} /> {(isChatRoom || isPolicyExpenseChat) && ( @@ -132,6 +132,7 @@ const HeaderView = (props) => { styles.sidebarLinkText, styles.optionAlternateText, styles.textLabelSupporting, + styles.pre, ]} numberOfLines={1} > diff --git a/src/pages/home/report/ParticipantLocalTime.js b/src/pages/home/report/ParticipantLocalTime.js index a93d2e57adcc..ab1b3dcc4b5d 100644 --- a/src/pages/home/report/ParticipantLocalTime.js +++ b/src/pages/home/report/ParticipantLocalTime.js @@ -65,6 +65,7 @@ class ParticipantLocalTime extends PureComponent { style={[ styles.chatItemComposeSecondaryRowSubText, styles.chatItemComposeSecondaryRowOffset, + styles.pre, ]} numberOfLines={1} > diff --git a/src/pages/home/report/ReportActionItemFragment.js b/src/pages/home/report/ReportActionItemFragment.js index c4f593517df5..04a57a1178a2 100644 --- a/src/pages/home/report/ReportActionItemFragment.js +++ b/src/pages/home/report/ReportActionItemFragment.js @@ -140,7 +140,7 @@ const ReportActionItemFragment = (props) => { {Str.htmlDecode(props.fragment.text)} diff --git a/src/pages/settings/InitialSettingsPage.js b/src/pages/settings/InitialSettingsPage.js index 6d6db5a498f3..998e0d691c4b 100755 --- a/src/pages/settings/InitialSettingsPage.js +++ b/src/pages/settings/InitialSettingsPage.js @@ -274,7 +274,7 @@ class InitialSettingsPage extends React.Component { - + {this.props.currentUserPersonalDetails.displayName ? this.props.currentUserPersonalDetails.displayName : Str.removeSMSDomain(this.props.session.email)} diff --git a/src/pages/workspace/WorkspaceInitialPage.js b/src/pages/workspace/WorkspaceInitialPage.js index fea68a5af262..2ea58c90c720 100644 --- a/src/pages/workspace/WorkspaceInitialPage.js +++ b/src/pages/workspace/WorkspaceInitialPage.js @@ -220,6 +220,7 @@ class WorkspaceInitialPage extends React.Component { style={[ styles.textHeadline, styles.alignSelfCenter, + styles.pre, ]} > {this.props.policy.name} diff --git a/src/styles/styles.js b/src/styles/styles.js index 841c02f5b11d..6252a9c6fd7a 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -323,6 +323,7 @@ const styles = { textHeadline: { ...headlineFont, + ...whiteSpace.preWrap, color: themeColors.heading, fontSize: variables.fontSizeXLarge, }, @@ -2888,6 +2889,7 @@ const styles = { flexShrink: 0, maxWidth: variables.badgeMaxWidth, fontSize: variables.fontSizeSmall, + ...whiteSpace.pre, ...spacing.ph2, }, diff --git a/src/styles/utilities/whiteSpace/index.js b/src/styles/utilities/whiteSpace/index.js index 7a7ac524d2cc..a7051cda6c21 100644 --- a/src/styles/utilities/whiteSpace/index.js +++ b/src/styles/utilities/whiteSpace/index.js @@ -5,4 +5,7 @@ export default { preWrap: { whiteSpace: 'pre-wrap', }, + pre: { + whiteSpace: 'pre', + }, };