Skip to content
Snippets Groups Projects
Commit 6ab5ecdf authored by IlarionHalushka's avatar IlarionHalushka Committed by Diego Mello
Browse files

[FEATURE] Share app (#1109)

parent 7b2185d3
No related branches found
No related tags found
No related merge requests found
export const PLAY_MARKET_LINK = 'https://play.google.com/store/apps/details?id=chat.rocket.reactnative';
export const APP_STORE_LINK = 'https://itunes.apple.com/app/rocket-chat-experimental/id1272915472?ls=1&mt=8';
export const LICENSE_LINK = 'https://github.com/RocketChat/Rocket.Chat.ReactNative/blob/develop/LICENSE';
import React from 'react';
import {
View, Linking, ScrollView, AsyncStorage, SafeAreaView, Switch
View, Linking, ScrollView, AsyncStorage, SafeAreaView, Switch, Share
} from 'react-native';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
......@@ -14,14 +14,14 @@ import { DisclosureImage } from '../../containers/DisclosureIndicator';
import Separator from '../../containers/Separator';
import I18n from '../../i18n';
import { MARKDOWN_KEY } from '../../lib/rocketchat';
import { getReadableVersion, getDeviceModel } from '../../utils/deviceInfo';
import { getReadableVersion, getDeviceModel, isAndroid } from '../../utils/deviceInfo';
import openLink from '../../utils/openLink';
import scrollPersistTaps from '../../utils/scrollPersistTaps';
import { showErrorAlert } from '../../utils/info';
import styles from './styles';
import sharedStyles from '../Styles';
import { PLAY_MARKET_LINK, APP_STORE_LINK, LICENSE_LINK } from '../../constants/links';
const LICENSE_LINK = 'https://github.com/RocketChat/Rocket.Chat.ReactNative/blob/develop/LICENSE';
const SectionSeparator = React.memo(() => <View style={styles.sectionSeparatorBorder} />);
class SettingsView extends React.Component {
......@@ -62,6 +62,10 @@ class SettingsView extends React.Component {
}
}
shareApp = () => {
Share.share({ message: isAndroid ? PLAY_MARKET_LINK : APP_STORE_LINK });
}
onPressLicense = () => openLink(LICENSE_LINK)
renderDisclosure = () => <DisclosureImage />
......@@ -105,18 +109,19 @@ class SettingsView extends React.Component {
/>
<Separator />
<ListItem
title={I18n.t('Theme')}
title={I18n.t('Share_this_app')}
onPress={this.shareApp}
showActionIndicator
disabled
testID='settings-view-theme'
testID='settings-view-share-app'
/>
<Separator />
<ListItem
title={I18n.t('Share_this_app')}
title={I18n.t('Theme')}
showActionIndicator
disabled
testID='settings-view-share-app'
testID='settings-view-theme'
/>
<Separator />
<SectionSeparator />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment