"Help" menu option should open help link in a mobile browser (#524)

This commit is contained in:
Carlos Tadeu Panato Junior 2017-05-11 23:17:33 +02:00 committed by enahum
parent 57aff3bc6b
commit 3252759175
2 changed files with 19 additions and 1 deletions

View file

@ -14,6 +14,7 @@ import DeviceInfo from 'react-native-device-info';
import MaterialIcon from 'react-native-vector-icons/MaterialIcons';
import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme';
import {preventDoubleTap} from 'app/utils/tap';
import SettingsItem from './settings_item';
@ -101,8 +102,13 @@ export default class Settings extends PureComponent {
this.props.actions.clearErrors();
};
openHelp = () => {
const {config} = this.props;
Linking.openURL(config.HelpLink);
}
render() {
const {actions, showTeamSelection, theme} = this.props;
const {actions, config, showTeamSelection, theme} = this.props;
const {goToAccountSettings, goToSelectTeam, goToAbout} = actions;
const style = getStyleSheet(theme);
@ -129,6 +135,17 @@ export default class Settings extends PureComponent {
theme={theme}
/>
}
{config.HelpLink &&
<SettingsItem
defaultMessage='Help'
i18nId='mobile.help.title'
iconName='help'
iconType='material'
onPress={() => preventDoubleTap(this.openHelp, this)}
separator={true}
theme={theme}
/>
}
<SettingsItem
defaultMessage='Report a Problem'
i18nId='sidebar_right_menu.report'

View file

@ -16,6 +16,7 @@
"about.teamEditiont1": "Enterprise Edition",
"about.title": "About Mattermost",
"about.version": "Version:",
"mobile.help.title": "Help",
"access_history.title": "Access History",
"activity_log.activeSessions": "Active Sessions",
"activity_log.browser": "Browser: {browser}",