MM-10951: Change user visible channel delete strings to archive. (#1785)

* Change user visible channel delete strings to archive.

* Show the archive icon in the channel info view.
This commit is contained in:
George Goldberg 2018-07-03 17:50:27 +01:00 committed by Elias Nahum
parent 85da9fa305
commit 6d006e01e3
3 changed files with 31 additions and 14 deletions

View file

@ -183,10 +183,10 @@ export default class ChannelInfo extends PureComponent {
});
};
} else if (eventType === 'delete') {
title = {id: 'mobile.channel_info.alertTitleDeleteChannel', defaultMessage: 'Delete {term}'};
title = {id: 'mobile.channel_info.alertTitleDeleteChannel', defaultMessage: 'Archive {term}'};
message = {
id: 'mobile.channel_info.alertMessageDeleteChannel',
defaultMessage: 'Are you sure you want to delete the {term} {name}?',
defaultMessage: 'Are you sure you want to archive the {term} {name}?',
};
onPressAction = async () => {
const result = await this.props.actions.deleteChannel(channel.id);
@ -196,7 +196,7 @@ export default class ChannelInfo extends PureComponent {
result.error,
{
id: 'mobile.channel_info.delete_failed',
defaultMessage: "We couldn't delete the channel {displayName}. Please check your connection and try again.",
defaultMessage: "We couldn't archive the channel {displayName}. Please check your connection and try again.",
},
{
displayName: channel.display_name,
@ -464,9 +464,9 @@ export default class ChannelInfo extends PureComponent {
<View style={style.footer}>
<ChannelInfoRow
action={this.handleDelete}
defaultMessage='Delete Channel'
icon='trash'
iconColor='#CA3B27'
defaultMessage='Archive Channel'
image={require('assets/images/status/archive_avatar.png')}
imageTintColor={changeOpacity(theme.sidebarText, 0.5)}
textId='mobile.routes.channelInfo.delete_channel'
textColor='#CA3B27'
theme={theme}

View file

@ -4,6 +4,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import {
Image,
Switch,
Text,
TouchableHighlight,
@ -23,7 +24,7 @@ function createTouchableComponent(children, action) {
}
function channelInfoRow(props) {
const {action, defaultMessage, detail, icon, iconColor, textColor, textId, togglable, theme, shouldRender} = props;
const {action, defaultMessage, detail, icon, iconColor, image, imageTintColor, textColor, textId, togglable, theme, shouldRender} = props;
if (!shouldRender) {
return null;
@ -31,14 +32,28 @@ function channelInfoRow(props) {
const style = getStyleSheet(theme);
const RowComponent = (
<View style={style.container}>
let iconElement = null;
if (image == null) {
iconElement = (
<Icon
name={icon}
size={15}
color={iconColor || changeOpacity(theme.centerChannelColor, 0.5)}
style={style.leftIcon}
/>
);
} else {
iconElement = (
<Image
source={image}
style={{width: 15, height: 15, tintColor: imageTintColor || changeOpacity(theme.sidebarText, 0.5)}}
/>
);
}
const RowComponent = (
<View style={style.container}>
{iconElement}
<FormattedText
style={[style.label, {color: textColor || theme.centerChannelColor}]}
id={textId}
@ -74,8 +89,10 @@ channelInfoRow.propTypes = {
PropTypes.number,
PropTypes.bool,
]),
icon: PropTypes.string.isRequired,
icon: PropTypes.string,
iconColor: PropTypes.string,
image: PropTypes.number,
imageTintColor: PropTypes.string,
textId: PropTypes.string.isRequired,
togglable: PropTypes.bool,
textColor: PropTypes.string,

View file

@ -2311,13 +2311,13 @@
"mobile.announcement_banner.title": "Announcement",
"mobile.channel.markAsRead": "Mark As Read",
"mobile.channel_drawer.search": "Jump to...",
"mobile.channel_info.alertMessageDeleteChannel": "Are you sure you want to delete the {term} {name}?",
"mobile.channel_info.alertMessageDeleteChannel": "Are you sure you want to archive the {term} {name}?",
"mobile.channel_info.alertMessageLeaveChannel": "Are you sure you want to leave the {term} {name}?",
"mobile.channel_info.alertNo": "No",
"mobile.channel_info.alertTitleDeleteChannel": "Delete {term}",
"mobile.channel_info.alertTitleDeleteChannel": "Archive {term}",
"mobile.channel_info.alertTitleLeaveChannel": "Leave {term}",
"mobile.channel_info.alertYes": "Yes",
"mobile.channel_info.delete_failed": "We couldn't delete the channel {displayName}. Please check your connection and try again.",
"mobile.channel_info.delete_failed": "We couldn't archive the channel {displayName}. Please check your connection and try again.",
"mobile.channel_info.edit": "Edit Channel",
"mobile.channel_info.privateChannel": "Private Channel",
"mobile.channel_info.publicChannel": "Public Channel",
@ -2542,7 +2542,7 @@
"mobile.retry_message": "Refreshing messages failed. Pull up to try again.",
"mobile.routes.channelInfo": "Info",
"mobile.routes.channelInfo.createdBy": "Created by {creator} on ",
"mobile.routes.channelInfo.delete_channel": "Delete Channel",
"mobile.routes.channelInfo.delete_channel": "Archive Channel",
"mobile.routes.channelInfo.favorite": "Favorite",
"mobile.routes.channel_members.action": "Remove Members",
"mobile.routes.channel_members.action_message": "You must select at least one member to remove from the channel.",