centralize lbrytv domain string

This commit is contained in:
jessop 2019-10-01 10:00:23 -04:00 committed by Sean Yesmunt
parent b74f149879
commit 068109038f
2 changed files with 13 additions and 7 deletions

View file

@ -3,6 +3,7 @@ import * as ICONS from 'constants/icons';
import React from 'react';
import Button from 'component/button';
import CopyableText from 'component/copyableText';
import { DOMAIN } from 'config';
type Props = {
claim: Claim,
@ -28,12 +29,12 @@ class SocialShare extends React.PureComponent<Props> {
const { claim } = this.props;
const { canonical_url: canonicalUrl, permanent_url: permanentUrl } = claim;
const { speechShareable, onDone } = this.props;
const lbryTvPrefix = 'https://beta.lbry.tv/';
const lbryPrefix = 'https://open.lbry.com/';
const lbryUri = canonicalUrl ? canonicalUrl.split('lbry://')[1] : permanentUrl.split('lbry://')[1];
const lbryWebUrl = lbryUri.replace(/#/g, ':');
const encodedLbryURL: string = `${lbryPrefix}${encodeURIComponent(lbryWebUrl)}`;
const lbryURL: string = `${lbryPrefix}${lbryWebUrl}`;
const lbryTvPrefix = DOMAIN;
const OPEN_URL = 'https://open.lbry.com/';
const lbryUrl = canonicalUrl ? canonicalUrl.split('lbry://')[1] : permanentUrl.split('lbry://')[1];
const lbryWebUrl = lbryUrl.replace(/#/g, ':');
const encodedLbryURL: string = `${OPEN_URL}${encodeURIComponent(lbryWebUrl)}`;
const lbryURL: string = `${OPEN_URL}${lbryWebUrl}`;
const encodedLbryTvUrl = `${lbryTvPrefix}${encodeURIComponent(lbryWebUrl)}`;
const lbryTvUrl = `${lbryTvPrefix}${lbryWebUrl}`;

View file

@ -703,6 +703,11 @@
"Creating channel...": "Creating channel...",
"Remember Password": "Remember Password",
"You will no longer see this at startup": "You will no longer see this at startup",
"From": "From",
"To": "To",
"Tip %amount% LBC": "Tip %amount% LBC",
"Not enough credits": "Not enough credits",
"You have %credit_amount% in unclaimed rewards.": "You have %credit_amount% in unclaimed rewards.",
"URI does not include name.": "URI does not include name.",
"to fix it. If that doesn't work, press CMD/CTRL-R to reset to the homepage.": "to fix it. If that doesn't work, press CMD/CTRL-R to reset to the homepage.",
"Add Email": "Add Email",
@ -719,4 +724,4 @@
"This will add a Support button along side tipping. Similar to tips, supports help %discovery_link% but the LBC is returned to your wallet if revoked. Both also help secure your %vanity_names_link%.": "This will add a Support button along side tipping. Similar to tips, supports help %discovery_link% but the LBC is returned to your wallet if revoked. Both also help secure your %vanity_names_link%.",
"Save Password": "Save Password",
"Automatically unlock your wallet on startup": "Automatically unlock your wallet on startup"
}
}