diff --git a/src/constants.js b/src/constants.js index 26659e3..6cbd629 100644 --- a/src/constants.js +++ b/src/constants.js @@ -140,6 +140,8 @@ const Constants = { TRUE_STRING: 'true', MINIMUM_TRANSACTION_BALANCE: 0.1, + + SHARE_BASE_URL: 'https://open.lbry.com', }; export default Constants; diff --git a/src/page/channel/view.js b/src/page/channel/view.js index 2a787be..4432c72 100644 --- a/src/page/channel/view.js +++ b/src/page/channel/view.js @@ -13,7 +13,7 @@ import { } from 'react-native'; import { TabView, SceneMap } from 'react-native-tab-view'; import { normalizeURI } from 'lbry-redux'; -import { navigateBack, getOrderBy } from 'utils/helper'; +import { navigateBack, getOrderBy, formatLbryUrlForWeb } from 'utils/helper'; import ChannelIconItem from 'component/channelIconItem'; import ClaimList from 'component/claimList'; import Colors from 'styles/colors'; @@ -172,6 +172,15 @@ class ChannelPage extends React.PureComponent { } }; + onSharePressed = () => { + const { claim } = this.props; + if (claim) { + const { canonical_url: canonicalUrl, short_url: shortUrl, permanent_url: permanentUrl } = claim; + const url = Constants.SHARE_BASE_URL + formatLbryUrlForWeb(canonicalUrl || shortUrl || permanentUrl); + NativeModules.UtilityModule.shareUrl(url); + } + }; + onDeletePressed = () => { const { abandonClaim, claim, navigation } = this.props; if (claim) { @@ -274,6 +283,12 @@ class ChannelPage extends React.PureComponent { onPress={this.onDeletePressed} /> )} +