Fix warnings on channel info row Formatted Text (#5644)

This commit is contained in:
Daniel Espino García 2021-09-23 21:55:34 +02:00 committed by GitHub
parent 1287357e7c
commit aa776e4ae6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 7 deletions

View file

@ -169,7 +169,6 @@ class Option extends React.PureComponent<OptionProps, OptionState> {
action={this.onPress}
defaultMessage={binding.label}
theme={theme}
textId={binding.app_id + binding.location}
image={binding.icon ? {uri: binding.icon} : null}
/>
</>

View file

@ -79,17 +79,24 @@ function channelInfoRow(props) {
);
}
const labelStyle = [style.label, {color: textColor || theme.centerChannelColor}];
let label = <Text style={labelStyle}>{defaultMessage}</Text>;
if (textId) {
label = (
<FormattedText
style={labelStyle}
id={textId}
defaultMessage={defaultMessage}
/>
);
}
const RowComponent = (
<View
testID={testID}
style={style.container}
>
{iconElement}
<FormattedText
style={[style.label, {color: textColor || theme.centerChannelColor}]}
id={textId}
defaultMessage={defaultMessage}
/>
{label}
<Text style={style.detail}>{detail}</Text>
{actionElement}
</View>
@ -120,7 +127,7 @@ channelInfoRow.propTypes = {
imageTintColor: PropTypes.string,
isLandscape: PropTypes.bool,
rightArrow: PropTypes.bool,
textId: PropTypes.string.isRequired,
textId: PropTypes.string,
togglable: PropTypes.bool,
textColor: PropTypes.string,
theme: PropTypes.object.isRequired,