diff --git a/.env.defaults b/.env.defaults index f4396f2c7..b9e7b2b1c 100644 --- a/.env.defaults +++ b/.env.defaults @@ -38,6 +38,8 @@ SITE_NAME=lbry.tv SITE_DESCRIPTION=Meet LBRY, an open, free, and community-controlled content wonderland. SITE_HELP_EMAIL=help@lbry.com LOGO_TITLE=lbry.tv +## Social media +TWITTER_ACCOUNT=LBRYcom ## IMAGE ASSETS YRBL_HAPPY_IMG_URL=https://cdn.lbryplayer.xyz/api/v3/streams/free/yrbl-happy/7aa50a7e5adaf48691935d55e45d697547392929/839d9a diff --git a/config.js b/config.js index ed1e005ea..cb72012b8 100644 --- a/config.js +++ b/config.js @@ -24,6 +24,8 @@ const config = { SITE_NAME: process.env.SITE_NAME, SITE_DESCRIPTION: process.env.SITE_DESCRIPTION, SITE_HELP_EMAIL: process.env.SITE_HELP_EMAIL, + // SOCIAL MEDIA + TWITTER_ACCOUNT: process.env.TWITTER_ACCOUNT, // LOGO LOGO_TITLE: process.env.LOGO_TITLE, FAVICON: process.env.FAVICON, @@ -70,7 +72,7 @@ const config = { BRANDED_SITE: process.env.BRANDED_SITE, }; -config.URL_LOCAL = `http://localhost:${config.WEB_SERVER_PORT}`; config.URL_DEV = `http://localhost:${config.WEBPACK_WEB_PORT}`; +config.URL_LOCAL = `http://localhost:${config.WEB_SERVER_PORT}`; module.exports = config; diff --git a/ui/component/socialShare/view.jsx b/ui/component/socialShare/view.jsx index 45739c49b..9849bc098 100644 --- a/ui/component/socialShare/view.jsx +++ b/ui/component/socialShare/view.jsx @@ -9,16 +9,13 @@ import { useIsMobile } from 'effects/use-screensize'; import { FormField } from 'component/common/form'; import { hmsToSeconds, secondsToHms } from 'util/time'; import { generateLbryContentUrl, generateLbryWebUrl, generateEncodedLbryURL, generateShareUrl } from 'util/url'; -import { URL, SHARE_DOMAIN_URL } from 'config'; +import { URL, TWITTER_ACCOUNT, SHARE_DOMAIN_URL } from 'config'; const SHARE_DOMAIN = SHARE_DOMAIN_URL || URL; const IOS = !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform); const SUPPORTS_SHARE_API = typeof navigator.share !== 'undefined'; -const IS_ODYSEE = SHARE_DOMAIN === 'https://odysee.com'; // Twitter share -const TWITTER_LBRY = 'LBRYcom'; -const TWITTER_ODYSEE = 'OdyseeTeam'; const TWITTER_INTENT_API = 'https://twitter.com/intent/tweet?'; type Props = { @@ -77,10 +74,15 @@ function SocialShare(props: Props) { // Tweet params let tweetIntentParams = { url: shareUrl, - via: IS_ODYSEE ? TWITTER_ODYSEE : TWITTER_LBRY, text: title || claim.name, hashtags: 'LBRY', }; + + if (TWITTER_ACCOUNT) { + // $FlowFixMe + tweetIntentParams.via = TWITTER_ACCOUNT; + } + // Generate twitter web intent url const tweetIntent = TWITTER_INTENT_API + new URLSearchParams(tweetIntentParams).toString();