diff --git a/.env.defaults b/.env.defaults index ea7120e6a..2ff979fae 100644 --- a/.env.defaults +++ b/.env.defaults @@ -68,6 +68,7 @@ AUTO_FOLLOW_CHANNELS=lbry://@lbry#3fda836a92faaceedfe398225fb9b2ee2ed1f01a ## FEATURES AND LIMITS SIMPLE_SITE=false +#BRANDED_SITE ENABLE_COMMENT_REACTIONS=true ENABLE_FILE_REACTIONS=false diff --git a/.lintstagedrc.json b/.lintstagedrc.json index f1722f87f..ae253a628 100644 --- a/.lintstagedrc.json +++ b/.lintstagedrc.json @@ -3,7 +3,7 @@ "ui/**/*.{js,jsx,scss,json}": ["prettier --write", "git add"], "web/**/*.{js,jsx,scss,json}": ["prettier --write", "git add"], "ui/**/*.{js,jsx}": ["eslint", "flow focus-check --color always", "git add"], - "web/**/*.{js,jsx,scss}": ["eslint", "git add"] + "web/**/*.{js,jsx}": ["eslint", "git add"] }, "ignore": ["node_modules", "web/dist/**/*", "dist/**/*", "package-lock.json"] } diff --git a/config.js b/config.js index 2620d4863..7918cef01 100644 --- a/config.js +++ b/config.js @@ -9,6 +9,7 @@ const config = { WEBPACK_ELECTRON_PORT: process.env.WEBPACK_ELECTRON_PORT, WEB_SERVER_PORT: process.env.WEB_SERVER_PORT, LBRY_WEB_API: process.env.LBRY_WEB_API, //api.na-backend.odysee.com', + LBRY_WEB_PUBLISH_API: process.env.LBRY_WEB_PUBLISH_API, LBRY_API_URL: process.env.LBRY_API_URL, //api.lbry.com', LBRY_WEB_STREAMING_API: process.env.LBRY_WEB_STREAMING_API, //cdn.lbryplayer.xyz', LBRY_WEB_BUFFER_API: process.env.LBRY_WEB_BUFFER_API, @@ -41,7 +42,6 @@ const config = { DEFAULT_LANGUAGE: process.env.DEFAULT_LANGUAGE, AUTO_FOLLOW_CHANNELS: process.env.AUTO_FOLLOW_CHANNELS, UNSYNCED_SETTINGS: process.env.UNSYNCED_SETTINGS, - AVATAR_DEFAULT: process.env.AVATAR_DEFAULT, // ENABLE FEATURES ENABLE_COMMENT_REACTIONS: process.env.ENABLE_COMMENT_REACTIONS === 'true', @@ -66,6 +66,7 @@ const config = { CUSTOM_HOMEPAGE: process.env.CUSTOM_HOMEPAGE === 'true', SHOW_TAGS_INTRO: process.env.SHOW_TAGS_INTRO === 'true', LIGHTHOUSE_DEFAULT_TYPES: process.env.LIGHTHOUSE_DEFAULT_TYPES, + BRANDED_SITE: process.env.BRANDED_SITE, }; config.URL_LOCAL = `http://localhost:${config.WEB_SERVER_PORT}`; diff --git a/ui/analytics.js b/ui/analytics.js index 7b3762c4d..69c52f3a5 100644 --- a/ui/analytics.js +++ b/ui/analytics.js @@ -12,7 +12,7 @@ import { generateInitialUrl } from 'util/url'; import { MATOMO_ID, MATOMO_URL, LBRY_WEB_BUFFER_API } from 'config'; const isProduction = process.env.NODE_ENV === 'production'; -const devInternalApis = process.env.LBRY_API_URL; +const devInternalApis = process.env.LBRY_API_URL && process.env.LBRY_API_URL.includes('dev'); export const SHARE_INTERNAL = 'shareInternal'; const SHARE_THIRD_PARTY = 'shareThirdParty'; diff --git a/ui/component/commentCreate/view.jsx b/ui/component/commentCreate/view.jsx index 1fce8fb04..8e113f269 100644 --- a/ui/component/commentCreate/view.jsx +++ b/ui/component/commentCreate/view.jsx @@ -43,8 +43,7 @@ type Props = { activeChannel: string, activeChannelClaim: ?ChannelClaim, bottom: boolean, - onSubmit: (string, string) => void, - livestream: boolean, + livestream?: boolean, embed?: boolean, toast: (string) => void, claimIsMine: boolean, @@ -66,17 +65,14 @@ export function CommentCreate(props: Props) { isReply, parentId, activeChannelClaim, - onSubmit, bottom, livestream, embed, - toast, claimIsMine, sendTip, doToast, } = props; - const buttonref: ElementRef = React.useRef(); - + const buttonRef: ElementRef = React.useRef(); const { push, location: { pathname }, @@ -92,11 +88,8 @@ export function CommentCreate(props: Props) { const [advancedEditor, setAdvancedEditor] = usePersistedState('comment-editor-mode', false); const hasChannels = channels && channels.length; const charCount = commentValue.length; - const [activeTab, setActiveTab] = React.useState(''); - const [tipError, setTipError] = React.useState(); - const disabled = isSubmitting || !activeChannelClaim || !commentValue.length; const [shouldDisableReviewButton, setShouldDisableReviewButton] = React.useState(); @@ -115,7 +108,7 @@ export function CommentCreate(props: Props) { const KEYCODE_ENTER = 13; if ((livestream || e.ctrlKey || e.metaKey) && e.keyCode === KEYCODE_ENTER) { e.preventDefault(); - buttonref.current.click(); + buttonRef.current.click(); } } @@ -154,8 +147,6 @@ export function CommentCreate(props: Props) { const activeChannelName = activeChannelClaim && activeChannelClaim.name; const activeChannelId = activeChannelClaim && activeChannelClaim.claim_id; - console.log(activeChannelClaim); - setIsSubmitting(true); if (activeTab === TAB_LBC) { @@ -191,8 +182,7 @@ export function CommentCreate(props: Props) { } const sourceClaimId = claim.claim_id; - - var roundedAmount = Math.round(tipAmount * 100) / 100; + const roundedAmount = Math.round(tipAmount * 100) / 100; Lbryio.call( 'customer', @@ -211,8 +201,6 @@ export function CommentCreate(props: Props) { 'post' ) .then((customerTipResponse) => { - console.log(customerTipResponse); - const paymentIntendId = customerTipResponse.payment_intent_id; handleCreateComment(null, paymentIntendId, stripeEnvironment); @@ -232,14 +220,14 @@ export function CommentCreate(props: Props) { // handleCreateComment(null); }) - .catch(function (error) { - var displayError = 'Sorry, there was an error in processing your payment!'; - - if (error.message !== 'payment intent failed to confirm') { - displayError = error.message; - } - - doToast({ message: displayError, isError: true }); + .catch((error) => { + doToast({ + message: + error.message !== 'payment intent failed to confirm' + ? error.message + : 'Sorry, there was an error in processing your payment!', + isError: true, + }); }); } } @@ -263,16 +251,12 @@ export function CommentCreate(props: Props) { setIsSupportComment(false); setCommentFailure(false); - if (onSubmit) { - onSubmit(commentValue, activeChannelClaim.name); - } - if (onDoneReplying) { onDoneReplying(); } } }) - .catch((e) => { + .catch(() => { setIsSubmitting(false); setCommentFailure(true); }); @@ -322,7 +306,7 @@ export function CommentCreate(props: Props) {