From fa1b1737bbe735f6c67e52cc549aa241210ec78c Mon Sep 17 00:00:00 2001 From: btzr-io Date: Fri, 30 Jul 2021 00:00:33 -0500 Subject: [PATCH 01/19] fix inconsistent theme css vars: fixes #6738 --- ui/scss/component/menu-button.scss | 7 ++----- ui/scss/init/_base-theme.scss | 3 +-- ui/scss/themes/dark.scss | 3 +-- web/scss/themes/lbrytv/dark.scss | 1 + web/scss/themes/odysee/init/_base-theme.scss | 1 + 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/ui/scss/component/menu-button.scss b/ui/scss/component/menu-button.scss index bb94ec35e..5f32d66ad 100644 --- a/ui/scss/component/menu-button.scss +++ b/ui/scss/component/menu-button.scss @@ -51,10 +51,7 @@ padding: 0.3rem; .icon { - stroke: var(--color-menu); - } - - .comment__menu-icon--hovering { + stroke: var(--color-menu-icon); } &:focus, @@ -62,7 +59,7 @@ opacity: 1; background-color: var(--color-button-alt-bg); .icon { - stroke: var(--color-menu-hovering); + stroke: var(--color-menu-icon-active); } } } diff --git a/ui/scss/init/_base-theme.scss b/ui/scss/init/_base-theme.scss index 4a34619d0..58ca7b7a5 100644 --- a/ui/scss/init/_base-theme.scss +++ b/ui/scss/init/_base-theme.scss @@ -124,8 +124,7 @@ --color-menu-background: var(--color-header-background); --color-menu-background--active: var(--color-card-background-highlighted); --color-menu-icon: var(--color-navigation-link); - --color-menu: var(--color-gray-3); - --color-menu-hovering: var(--color-gray-6); + --color-menu-icon-active: var(--color-gray-6); // Comments --color-comment-highlighted: #fff2d9; diff --git a/ui/scss/themes/dark.scss b/ui/scss/themes/dark.scss index edc0bbf7c..bebc2af07 100644 --- a/ui/scss/themes/dark.scss +++ b/ui/scss/themes/dark.scss @@ -90,8 +90,7 @@ --color-menu-background: var(--color-header-background); --color-menu-background--active: var(--color-gray-7); --color-menu-icon: var(--color-gray-4); - --color-menu: var(--color-gray-5); - --color-menu-hovering: var(--color-gray-2); + --color-menu-icon-active: var(--color-gray-2); // Comments --color-comment-threadline: #434b54; diff --git a/web/scss/themes/lbrytv/dark.scss b/web/scss/themes/lbrytv/dark.scss index b244eefa6..ab79d895f 100644 --- a/web/scss/themes/lbrytv/dark.scss +++ b/web/scss/themes/lbrytv/dark.scss @@ -90,6 +90,7 @@ --color-menu-background: var(--color-header-background); --color-menu-background--active: var(--color-gray-7); --color-menu-icon: var(--color-gray-4); + --color-menu-icon-active: var(--color-gray-2); // Comments --color-comment-menu: var(--color-gray-5); diff --git a/web/scss/themes/odysee/init/_base-theme.scss b/web/scss/themes/odysee/init/_base-theme.scss index 02313f1e1..76096b53c 100644 --- a/web/scss/themes/odysee/init/_base-theme.scss +++ b/web/scss/themes/odysee/init/_base-theme.scss @@ -124,6 +124,7 @@ --color-menu-background: var(--color-header-background); --color-menu-background--active: var(--color-card-background-highlighted); --color-menu-icon: var(--color-navigation-link); + --color-menu-icon-active: var(--color-navigation-link); // Comments --color-comment-menu: var(--color-gray-3); From 415a522805e29bf27512e6b7dbe20c0e760e8f0e Mon Sep 17 00:00:00 2001 From: Baltazar Gomez Date: Fri, 30 Jul 2021 01:54:45 -0500 Subject: [PATCH 02/19] fix notification menu button styles --- ui/component/notification/view.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/component/notification/view.jsx b/ui/component/notification/view.jsx index a372c299d..889d43ac4 100644 --- a/ui/component/notification/view.jsx +++ b/ui/component/notification/view.jsx @@ -193,7 +193,7 @@ export default function Notification(props: Props) {
- e.stopPropagation()}> + e.stopPropagation()}> From 87ae041472daca5a4409acabe02f7c0868ec78c0 Mon Sep 17 00:00:00 2001 From: saltrafael Date: Mon, 19 Jul 2021 18:22:39 -0300 Subject: [PATCH 03/19] Add confirmation on comment removal --- CHANGELOG.md | 1 + ui/component/comment/view.jsx | 1 + ui/component/commentMenuList/index.js | 4 +-- ui/component/commentMenuList/view.jsx | 9 +++-- ui/constants/modal_types.js | 1 + ui/modal/modalRemoveComment/index.js | 11 ++++++ ui/modal/modalRemoveComment/view.jsx | 51 +++++++++++++++++++++++++++ ui/modal/modalRouter/view.jsx | 3 ++ 8 files changed, 76 insertions(+), 5 deletions(-) create mode 100644 ui/modal/modalRemoveComment/index.js create mode 100644 ui/modal/modalRemoveComment/view.jsx diff --git a/CHANGELOG.md b/CHANGELOG.md index ce020fc66..0b75535d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Show currently active playing item on playlist _community pr!_ ([#6453](https://github.com/lbryio/lbry-desktop/pull/6453)) - Add watch later to hover action for last used playlist on popup _community pr!_ ([#6274](https://github.com/lbryio/lbry-desktop/pull/6274)) - Open in desktop (web feature) _community pr!_ ([#6667](https://github.com/lbryio/lbry-desktop/pull/6667)) +- Add confirmation on comment removal _community pr!_ ([#6563](https://github.com/lbryio/lbry-desktop/pull/6563)) ### Changed - Use Canonical Url for copy link ([#6500](https://github.com/lbryio/lbry-desktop/pull/6500)) diff --git a/ui/component/comment/view.jsx b/ui/component/comment/view.jsx index 0b9fd71bc..5161382fa 100644 --- a/ui/component/comment/view.jsx +++ b/ui/component/comment/view.jsx @@ -270,6 +270,7 @@ function Comment(props: Props) { authorUri={authorUri} commentIsMine={commentIsMine} handleEditComment={handleEditComment} + supportAmount={supportAmount} />
diff --git a/ui/component/commentMenuList/index.js b/ui/component/commentMenuList/index.js index 105754466..5ebdf41b5 100644 --- a/ui/component/commentMenuList/index.js +++ b/ui/component/commentMenuList/index.js @@ -1,7 +1,6 @@ import { connect } from 'react-redux'; import { makeSelectChannelPermUrlForClaimUri, makeSelectClaimIsMine, makeSelectClaimForUri } from 'lbry-redux'; import { - doCommentAbandon, doCommentPin, doCommentModBlock, doCommentModBlockAsAdmin, @@ -10,6 +9,7 @@ import { } from 'redux/actions/comments'; import { doChannelMute } from 'redux/actions/blocked'; // import { doSetActiveChannel } from 'redux/actions/app'; +import { doOpenModal } from 'redux/actions/app'; import { doSetPlayingUri } from 'redux/actions/content'; import { selectActiveChannelClaim } from 'redux/selectors/app'; import { selectPlayingUri } from 'redux/selectors/content'; @@ -26,8 +26,8 @@ const select = (state, props) => ({ }); const perform = (dispatch) => ({ + openModal: (modal, props) => dispatch(doOpenModal(modal, props)), clearPlayingUri: () => dispatch(doSetPlayingUri({ uri: null })), - deleteComment: (commentId, creatorChannelUrl) => dispatch(doCommentAbandon(commentId, creatorChannelUrl)), muteChannel: (channelUri) => dispatch(doChannelMute(channelUri)), pinComment: (commentId, claimId, remove) => dispatch(doCommentPin(commentId, claimId, remove)), // setActiveChannel: channelId => dispatch(doSetActiveChannel(channelId)), diff --git a/ui/component/commentMenuList/view.jsx b/ui/component/commentMenuList/view.jsx index 222d3ad8a..e9f59bf4c 100644 --- a/ui/component/commentMenuList/view.jsx +++ b/ui/component/commentMenuList/view.jsx @@ -1,5 +1,6 @@ // @flow import * as ICONS from 'constants/icons'; +import * as MODALS from 'constants/modal_types'; import React from 'react'; import { MenuList, MenuItem } from '@reach/menu-button'; import ChannelThumbnail from 'component/channelThumbnail'; @@ -12,7 +13,6 @@ type Props = { authorUri: string, // full LBRY Channel URI: lbry://@channel#123... commentId: string, // sha256 digest identifying the comment commentIsMine: boolean, // if this comment was signed by an owned channel - deleteComment: (string, ?string) => void, isPinned: boolean, pinComment: (string, string, boolean) => Promise, muteChannel: (string) => void, @@ -28,6 +28,8 @@ type Props = { disableEdit?: boolean, disableRemove?: boolean, moderationDelegatorsById: { [string]: { global: boolean, delegators: { name: string, claimId: string } } }, + openModal: (id: string, {}) => void, + supportAmount?: any, }; function CommentMenuList(props: Props) { @@ -36,7 +38,6 @@ function CommentMenuList(props: Props) { authorUri, commentIsMine, commentId, - deleteComment, muteChannel, pinComment, clearPlayingUri, @@ -53,6 +54,8 @@ function CommentMenuList(props: Props) { disableEdit, disableRemove, moderationDelegatorsById, + openModal, + supportAmount, } = props; const contentChannelClaim = !claim @@ -80,7 +83,7 @@ function CommentMenuList(props: Props) { if (playingUri && playingUri.source === 'comment') { clearPlayingUri(); } - deleteComment(commentId, commentIsMine ? undefined : contentChannelPermanentUrl); + openModal(MODALS.CONFIRM_REMOVE_COMMENT, { commentId, commentIsMine, contentChannelPermanentUrl, supportAmount }); } function handleCommentBlock() { diff --git a/ui/constants/modal_types.js b/ui/constants/modal_types.js index c9972ec4c..c43f04399 100644 --- a/ui/constants/modal_types.js +++ b/ui/constants/modal_types.js @@ -46,3 +46,4 @@ export const CONFIRM_REMOVE_BTC_SWAP_ADDRESS = 'confirm_remove_btc_swap_address' export const COLLECTION_ADD = 'collection_add'; export const COLLECTION_DELETE = 'collection_delete'; export const CONFIRM_REMOVE_CARD = 'CONFIRM_REMOVE_CARD'; +export const CONFIRM_REMOVE_COMMENT = 'CONFIRM_REMOVE_COMMENT'; diff --git a/ui/modal/modalRemoveComment/index.js b/ui/modal/modalRemoveComment/index.js new file mode 100644 index 000000000..e7d775648 --- /dev/null +++ b/ui/modal/modalRemoveComment/index.js @@ -0,0 +1,11 @@ +import { connect } from 'react-redux'; +import { doHideModal } from 'redux/actions/app'; +import ModalRemoveComment from './view'; +import { doCommentAbandon } from 'redux/actions/comments'; + +const perform = (dispatch) => ({ + closeModal: () => dispatch(doHideModal()), + deleteComment: (commentId, creatorChannelUrl) => dispatch(doCommentAbandon(commentId, creatorChannelUrl)), +}); + +export default connect(null, perform)(ModalRemoveComment); diff --git a/ui/modal/modalRemoveComment/view.jsx b/ui/modal/modalRemoveComment/view.jsx new file mode 100644 index 000000000..d0832af7d --- /dev/null +++ b/ui/modal/modalRemoveComment/view.jsx @@ -0,0 +1,51 @@ +// @flow +import React from 'react'; +import { Modal } from 'modal/modal'; +import Button from 'component/button'; +import Card from 'component/common/card'; + +type Props = { + commentId: string, // sha256 digest identifying the comment + commentIsMine: boolean, // if this comment was signed by an owned channel + contentChannelPermanentUrl: any, + closeModal: () => void, + deleteComment: (string, ?string) => void, + supportAmount?: any, +}; + +function ModalRemoveComment(props: Props) { + const { commentId, commentIsMine, contentChannelPermanentUrl, closeModal, deleteComment, supportAmount } = props; + + return ( + + +

{__('Are you sure you want to remove this comment?')}

+ {Boolean(supportAmount) && ( +

{__('This comment has a support, the transaction cannot be undone.')}

+ )} + + } + actions={ + <> +
+
+ + } + /> +
+ ); +} + +export default ModalRemoveComment; diff --git a/ui/modal/modalRouter/view.jsx b/ui/modal/modalRouter/view.jsx index 0d6ab4e08..3f8e729f2 100644 --- a/ui/modal/modalRouter/view.jsx +++ b/ui/modal/modalRouter/view.jsx @@ -30,6 +30,7 @@ const ModalPublish = lazyImport(() => import('modal/modalPublish' /* webpackChun const ModalPublishPreview = lazyImport(() => import('modal/modalPublishPreview' /* webpackChunkName: "modalPublishPreview" */)); const ModalRemoveBtcSwapAddress = lazyImport(() => import('modal/modalRemoveBtcSwapAddress' /* webpackChunkName: "modalRemoveBtcSwapAddress" */)); const ModalRemoveCard = lazyImport(() => import('modal/modalRemoveCard' /* webpackChunkName: "modalRemoveCard" */)); +const ModalRemoveComment = lazyImport(() => import('modal/modalRemoveComment' /* webpackChunkName: "modalRemoveComment" */)); const ModalRemoveFile = lazyImport(() => import('modal/modalRemoveFile' /* webpackChunkName: "modalRemoveFile" */)); const ModalRevokeClaim = lazyImport(() => import('modal/modalRevokeClaim' /* webpackChunkName: "modalRevokeClaim" */)); const ModalRewardCode = lazyImport(() => import('modal/modalRewardCode' /* webpackChunkName: "modalRewardCode" */)); @@ -154,6 +155,8 @@ function ModalRouter(props: Props) { return ModalDeleteCollection; case MODALS.CONFIRM_REMOVE_CARD: return ModalRemoveCard; + case MODALS.CONFIRM_REMOVE_COMMENT: + return ModalRemoveComment; default: return null; } From a9a0bc9462198379416193ec20c7e32a11cbb153 Mon Sep 17 00:00:00 2001 From: saltrafael Date: Wed, 21 Jul 2021 11:26:31 -0300 Subject: [PATCH 04/19] Change warning --- ui/modal/modalRemoveComment/view.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/modal/modalRemoveComment/view.jsx b/ui/modal/modalRemoveComment/view.jsx index d0832af7d..f595be838 100644 --- a/ui/modal/modalRemoveComment/view.jsx +++ b/ui/modal/modalRemoveComment/view.jsx @@ -24,7 +24,7 @@ function ModalRemoveComment(props: Props) {

{__('Are you sure you want to remove this comment?')}

{Boolean(supportAmount) && ( -

{__('This comment has a support, the transaction cannot be undone.')}

+

{__('This comment has a tip associated with it which cannot be reverted.')}

)}
} From 95c7d4f935e7ce4549a1eff752177f27f19df36b Mon Sep 17 00:00:00 2001 From: Baltazar Gomez Date: Thu, 29 Jul 2021 12:13:34 -0500 Subject: [PATCH 05/19] add search api to .env defaults --- .env.defaults | 1 + 1 file changed, 1 insertion(+) diff --git a/.env.defaults b/.env.defaults index 8489daf19..f4396f2c7 100644 --- a/.env.defaults +++ b/.env.defaults @@ -12,6 +12,7 @@ LBRY_WEB_API=https://api.na-backend.odysee.com LBRY_WEB_STREAMING_API=https://cdn.lbryplayer.xyz LBRY_WEB_BUFFER_API=https://collector-service.api.lbry.tv/api/v1/events/video COMMENT_SERVER_API=https://comments.odysee.com/api/v2 +SEARCH_SERVER_API=https://lighthouse.odysee.com/search THUMBNAIL_CDN_URL=https://image-processor.vanwanet.com/optimize/ WELCOME_VERSION=1.0 From 172701aeba5dc103f1293e41de0317244310adfd Mon Sep 17 00:00:00 2001 From: Baltazar Gomez Date: Thu, 29 Jul 2021 12:14:57 -0500 Subject: [PATCH 06/19] add server api to config --- config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/config.js b/config.js index 7918cef01..ed1e005ea 100644 --- a/config.js +++ b/config.js @@ -13,6 +13,7 @@ const config = { 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, + SEARCH_SERVER_API: process.env.SEARCH_SERVER_API, COMMENT_SERVER_API: process.env.COMMENT_SERVER_API, WELCOME_VERSION: process.env.WELCOME_VERSION, DOMAIN: process.env.DOMAIN, From 9dd065a59548951c167dd96be6ce59468f03c6ac Mon Sep 17 00:00:00 2001 From: Baltazar Gomez Date: Thu, 29 Jul 2021 12:19:12 -0500 Subject: [PATCH 07/19] update lighthouse search api --- ui/redux/actions/search.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/redux/actions/search.js b/ui/redux/actions/search.js index 714907c5e..0da0039d0 100644 --- a/ui/redux/actions/search.js +++ b/ui/redux/actions/search.js @@ -5,7 +5,7 @@ import { buildURI, doResolveUris, batchActions, isURIValid, makeSelectClaimForUr import { makeSelectSearchUris, selectSearchValue } from 'redux/selectors/search'; import handleFetchResponse from 'util/handle-fetch'; import { getSearchQueryString } from 'util/query-params'; -import { SIMPLE_SITE } from 'config'; +import { SIMPLE_SITE, SEARCH_SERVER_API } from 'config'; type Dispatch = (action: any) => any; type GetState = () => { search: SearchState }; @@ -19,7 +19,7 @@ type SearchOptions = { }; let lighthouse = { - CONNECTION_STRING: 'https://lighthouse.lbry.com/search', + CONNECTION_STRING: SEARCH_SERVER_API, search: (queryString: string) => fetch(`${lighthouse.CONNECTION_STRING}?${queryString}`).then(handleFetchResponse), }; From b93caf4ebc2b5a86d5caa0d159e7734c82c0b2d1 Mon Sep 17 00:00:00 2001 From: zeppi Date: Fri, 30 Jul 2021 12:07:32 -0400 Subject: [PATCH 08/19] fix logo image --- ui/component/logo/view.jsx | 9 ++++++--- ui/scss/component/_header.scss | 5 +++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ui/component/logo/view.jsx b/ui/component/logo/view.jsx index 2251cd0e4..145219a1a 100644 --- a/ui/component/logo/view.jsx +++ b/ui/component/logo/view.jsx @@ -26,12 +26,12 @@ export default function Logo(props: Props) { ); if (type === 'small' || (isMobile && type !== 'embed')) { - return LOGO ? : ; + return LOGO ? : ; } else if (type === 'embed') { if (LOGO_TEXT_LIGHT) { return ( <> - + ); } else { @@ -41,7 +41,10 @@ export default function Logo(props: Props) { if (LOGO_TEXT_LIGHT && LOGO_TEXT_DARK) { return ( <> - + ); } else { diff --git a/ui/scss/component/_header.scss b/ui/scss/component/_header.scss index 207f14eac..201789375 100644 --- a/ui/scss/component/_header.scss +++ b/ui/scss/component/_header.scss @@ -71,6 +71,11 @@ display: flex; } +.header__navigation-logo { + height: var(--height-button); + max-width: fit-content; +} + .header__navigation-item { height: var(--height-button); display: flex; From b5fec393c6f3fcaf91002642838375d22c400e6d Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Sat, 31 Jul 2021 11:08:15 -0400 Subject: [PATCH 09/19] Fix crash --- ui/component/claimPreviewTile/view.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/component/claimPreviewTile/view.jsx b/ui/component/claimPreviewTile/view.jsx index 867fc89c7..d772241e8 100644 --- a/ui/component/claimPreviewTile/view.jsx +++ b/ui/component/claimPreviewTile/view.jsx @@ -120,7 +120,7 @@ function ClaimPreviewTile(props: Props) { const signingChannel = claim && claim.signing_channel; const isChannel = claim && claim.value_type === 'channel'; const channelUri = !isChannel ? signingChannel && signingChannel.permanent_url : claim && claim.permanent_url; - const channelTitle = signingChannel && (signingChannel.value.title || signingChannel.name); + const channelTitle = signingChannel && ((signingChannel.value && signingChannel.value.title) || signingChannel.name); // Aria-label value for claim preview let ariaLabelData = isChannel ? title : formatClaimPreviewTitle(title, channelTitle, date, mediaDuration); From 7802337655235a5174c4842c432e23d20b0259a2 Mon Sep 17 00:00:00 2001 From: btzr-io Date: Thu, 22 Jul 2021 15:09:28 -0500 Subject: [PATCH 10/19] prevent livestream api calls if no livestream claim exists: #6632 --- static/app-strings.json | 3 --- ui/component/livestreamLink/view.jsx | 18 +++++++++++++----- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/static/app-strings.json b/static/app-strings.json index e0e559fa5..4a1107b24 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -2064,9 +2064,6 @@ "Skip Navigation": "Skip Navigation", "Reset": "Reset", "Reset to original (previous) publish date": "Reset to original (previous) publish date", - "%title% by %channelTitle%": "%title% by %channelTitle%", - "%title% by %channelTitle% %ariaDate%": "%title% by %channelTitle% %ariaDate%", - "%title% by %channelTitle% %ariaDate%, %mediaDuration%": "%title% by %channelTitle% %ariaDate%, %mediaDuration%", "Search for something...": "Search for something...", "--end--": "--end--" } diff --git a/ui/component/livestreamLink/view.jsx b/ui/component/livestreamLink/view.jsx index 999239b51..201d6cfab 100644 --- a/ui/component/livestreamLink/view.jsx +++ b/ui/component/livestreamLink/view.jsx @@ -18,9 +18,11 @@ export default function LivestreamLink(props: Props) { const [livestreamClaim, setLivestreamClaim] = React.useState(false); const [isLivestreaming, setIsLivestreaming] = React.useState(false); const livestreamChannelId = (channelClaim && channelClaim.claim_id) || ''; // TODO: fail in a safer way, probably + const isChannelEmpty = !channelClaim || !channelClaim.meta || !channelClaim.meta.claims_in_channel; React.useEffect(() => { - if (livestreamChannelId) { + // Don't search empty channels + if (livestreamChannelId && !isChannelEmpty) { Lbry.claim_search({ channel_ids: [livestreamChannelId], has_no_source: true, @@ -35,7 +37,7 @@ export default function LivestreamLink(props: Props) { }) .catch(() => {}); } - }, [livestreamChannelId]); + }, [livestreamChannelId, isChannelEmpty]); React.useEffect(() => { function fetchIsStreaming() { @@ -53,17 +55,23 @@ export default function LivestreamLink(props: Props) { } let interval; - if (livestreamChannelId) { + // Only call livestream api if channel has livestream claims + if (livestreamChannelId && livestreamClaim) { if (!interval) fetchIsStreaming(); interval = setInterval(fetchIsStreaming, 10 * 1000); } - + // Prevent any more api calls on update + if (!livestreamChannelId || !livestreamClaim) { + if (interval) { + clearInterval(interval); + } + } return () => { if (interval) { clearInterval(interval); } }; - }, [livestreamChannelId]); + }, [livestreamChannelId, livestreamClaim]); if (!livestreamClaim || !isLivestreaming) { return null; From 9983777f86e88072ca1c5816ba09b1c813561fc6 Mon Sep 17 00:00:00 2001 From: btzr-io Date: Fri, 23 Jul 2021 01:47:01 -0500 Subject: [PATCH 11/19] faster claim search on livestreamLink --- ui/component/livestreamLink/view.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/component/livestreamLink/view.jsx b/ui/component/livestreamLink/view.jsx index 201d6cfab..27c1d8d7b 100644 --- a/ui/component/livestreamLink/view.jsx +++ b/ui/component/livestreamLink/view.jsx @@ -25,6 +25,8 @@ export default function LivestreamLink(props: Props) { if (livestreamChannelId && !isChannelEmpty) { Lbry.claim_search({ channel_ids: [livestreamChannelId], + page: 1, + no_totals: true, has_no_source: true, claim_type: ['stream'], order_by: CS.ORDER_BY_NEW_VALUE, From 37d9cbfbebf20ea80f5f9e6985acfad7fd01c6e2 Mon Sep 17 00:00:00 2001 From: Baltazar Gomez Date: Fri, 23 Jul 2021 12:47:59 -0500 Subject: [PATCH 12/19] limit claim_search results on livestreamLink --- ui/component/livestreamLink/view.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/component/livestreamLink/view.jsx b/ui/component/livestreamLink/view.jsx index 27c1d8d7b..08afa23b1 100644 --- a/ui/component/livestreamLink/view.jsx +++ b/ui/component/livestreamLink/view.jsx @@ -26,6 +26,7 @@ export default function LivestreamLink(props: Props) { Lbry.claim_search({ channel_ids: [livestreamChannelId], page: 1, + page_size: 1, no_totals: true, has_no_source: true, claim_type: ['stream'], From d462f96834f5b14e8250350e1444bc823592c0d9 Mon Sep 17 00:00:00 2001 From: btzr-io Date: Fri, 23 Jul 2021 23:50:20 -0500 Subject: [PATCH 13/19] improve twitter share --- static/app-strings.json | 1 + ui/component/socialShare/view.jsx | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/static/app-strings.json b/static/app-strings.json index 4a1107b24..5b312e69b 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -2065,5 +2065,6 @@ "Reset": "Reset", "Reset to original (previous) publish date": "Reset to original (previous) publish date", "Search for something...": "Search for something...", + "Show reply": "Show reply", "--end--": "--end--" } diff --git a/ui/component/socialShare/view.jsx b/ui/component/socialShare/view.jsx index 005387538..45739c49b 100644 --- a/ui/component/socialShare/view.jsx +++ b/ui/component/socialShare/view.jsx @@ -14,6 +14,12 @@ import { URL, 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 = { claim: StreamClaim, @@ -68,6 +74,16 @@ function SocialShare(props: Props) { ); const downloadUrl = `${generateDownloadUrl(name, claimId)}`; + // Tweet params + let tweetIntentParams = { + url: shareUrl, + via: IS_ODYSEE ? TWITTER_ODYSEE : TWITTER_LBRY, + text: title || claim.name, + hashtags: 'LBRY', + }; + // Generate twitter web intent url + const tweetIntent = TWITTER_INTENT_API + new URLSearchParams(tweetIntentParams).toString(); + function handleWebShareClick() { if (navigator.share) { navigator.share({ @@ -115,7 +131,7 @@ function SocialShare(props: Props) { iconSize={24} icon={ICONS.TWITTER} title={__('Share on Twitter')} - href={`https://twitter.com/intent/tweet?text=${encodedLbryURL}`} + href={tweetIntent} />