From 2b7df2307c2d522ab7292c33441236d6cef9f896 Mon Sep 17 00:00:00 2001 From: Asaad Mahmood Date: Thu, 12 Sep 2019 18:00:09 +0500 Subject: [PATCH] MM-18330 - Updating arrow prop (#3248) --- app/screens/channel_info/channel_info.js | 1 + app/screens/channel_info/channel_info_row.js | 36 +++++++++++++------- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/app/screens/channel_info/channel_info.js b/app/screens/channel_info/channel_info.js index 3938ea493..bd999dbb9 100644 --- a/app/screens/channel_info/channel_info.js +++ b/app/screens/channel_info/channel_info.js @@ -570,6 +570,7 @@ export default class ChannelInfo extends PureComponent { defaultMessage={defaultMessage} icon='times' iconColor='#CA3B27' + rightArrow={false} textId={i18nId} textColor='#CA3B27' theme={theme} diff --git a/app/screens/channel_info/channel_info_row.js b/app/screens/channel_info/channel_info_row.js index 06657859f..43e0e4f33 100644 --- a/app/screens/channel_info/channel_info_row.js +++ b/app/screens/channel_info/channel_info_row.js @@ -25,7 +25,7 @@ function createTouchableComponent(children, action) { } function channelInfoRow(props) { - const {action, defaultMessage, detail, icon, iconColor, image, imageTintColor, textColor, textId, togglable, theme, shouldRender, isLandscape} = props; + const {action, defaultMessage, detail, icon, iconColor, image, imageTintColor, rightArrow, textColor, textId, togglable, theme, shouldRender, isLandscape} = props; if (!shouldRender) { return null; @@ -52,6 +52,26 @@ function channelInfoRow(props) { ); } + let actionElement = null; + if (togglable) { + actionElement = ( + + ); + } + + if (rightArrow) { + actionElement = ( + + ); + } + const RowComponent = ( {iconElement} @@ -61,17 +81,7 @@ function channelInfoRow(props) { defaultMessage={defaultMessage} /> {detail} - {togglable ? - : - - } + {actionElement} ); @@ -94,6 +104,7 @@ channelInfoRow.propTypes = { iconColor: PropTypes.string, image: PropTypes.number, imageTintColor: PropTypes.string, + rightArrow: PropTypes.bool, textId: PropTypes.string.isRequired, togglable: PropTypes.bool, textColor: PropTypes.string, @@ -101,6 +112,7 @@ channelInfoRow.propTypes = { }; channelInfoRow.defaultProps = { + rightArrow: true, togglable: false, shouldRender: true, };