Automated cherry pick of #3640 (#3725)

* MM-19837 Remove Opacity from AtMention Markdown

Removed the opacity that was set on the base text style for the markdown on AtMention for system messages.

* MM-19837 Updated opacity for AtMention

The baseTextStyle being used to set the opacity is used across the entire text format, so for this change where an AtMention is used, I added a new opacity to overwrite the on applied by the baseTextStyle.
This commit is contained in:
Mattermost Build 2019-12-18 19:10:08 +01:00 committed by Miguel Alatzar
parent f0047386f6
commit f0e1931d32
2 changed files with 12 additions and 2 deletions

View file

@ -110,12 +110,14 @@ class FormattedMarkdownText extends React.PureComponent {
}
renderAtMention = ({context, mentionName}) => {
const style = getStyleSheet(this.props.theme);
return (
<AtMention
mentionStyle={this.props.textStyles.mention}
mentionName={mentionName}
onPostPress={this.props.onPostPress}
textStyle={this.computeTextStyle(this.props.baseTextStyle, context)}
textStyle={[this.computeTextStyle(this.props.baseTextStyle, context), style.atMentionOpacity]}
/>
);
}
@ -139,6 +141,9 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
fontSize: 15,
lineHeight: 22,
},
atMentionOpacity: {
opacity: 1,
},
};
});

View file

@ -199,10 +199,12 @@ export default class Markdown extends PureComponent {
return this.renderText({context, literal: `@${mentionName}`});
}
const style = getStyleSheet(this.props.theme);
return (
<AtMention
mentionStyle={this.props.textStyles.mention}
textStyle={this.computeTextStyle(this.props.baseTextStyle, context)}
textStyle={[this.computeTextStyle(this.props.baseTextStyle, context), style.atMentionOpacity]}
isSearchResult={this.props.isSearchResult}
mentionName={mentionName}
onPostPress={this.props.onPostPress}
@ -462,5 +464,8 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
color: editedColor,
opacity: editedOpacity,
},
atMentionOpacity: {
opacity: 1,
},
};
});