diff --git a/package.json b/package.json index 2a5b24b0d..ef67f3d16 100644 --- a/package.json +++ b/package.json @@ -130,7 +130,7 @@ "imagesloaded": "^4.1.4", "json-loader": "^0.5.4", "lbry-format": "https://github.com/lbryio/lbry-format.git", - "lbry-redux": "lbryio/lbry-redux#916ef0f6474f8666d491df75516621b6ffcfbfce", + "lbry-redux": "lbryio/lbry-redux#adebb2d6259e9f69ca055a8a8c0c01fac0af6124", "lbryinc": "lbryio/lbryinc#6a59102c52673502569d2c43bd4ee58c315fb2e4", "lint-staged": "^7.0.2", "localforage": "^1.7.1", diff --git a/static/app-strings.json b/static/app-strings.json index 86a06ed2d..9fc91fa9e 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -942,4 +942,4 @@ "Is Controlling": "Is Controlling", "Claim ID": "Claim ID", "Official YouTube Creator - Last updated %time_ago%": "Official YouTube Creator - Last updated %time_ago%" -} \ No newline at end of file +} diff --git a/ui/component/claimList/view.jsx b/ui/component/claimList/view.jsx index 45ce7eba7..dd73b3a5f 100644 --- a/ui/component/claimList/view.jsx +++ b/ui/component/claimList/view.jsx @@ -31,6 +31,7 @@ type Props = { headerLabel?: string | Node, showUnresolvedClaims?: boolean, renderProperties: ?(Claim) => Node, + includeSupportAction?: boolean, }; export default function ClaimList(props: Props) { @@ -51,6 +52,7 @@ export default function ClaimList(props: Props) { headerLabel, showUnresolvedClaims, renderProperties, + includeSupportAction, } = props; const [scrollBottomCbMap, setScrollBottomCbMap] = useState({}); const [currentSort, setCurrentSort] = usePersistedState(persistedStorageKey, SORT_NEW); @@ -134,6 +136,7 @@ export default function ClaimList(props: Props) { key={uri} uri={uri} type={type} + includeSupportAction={includeSupportAction} showUnresolvedClaim={showUnresolvedClaims} properties={renderProperties || (type !== 'small' ? undefined : false)} showUserBlocked={showHiddenByUser} diff --git a/ui/component/claimListDiscover/view.jsx b/ui/component/claimListDiscover/view.jsx index d5afa5124..b5ddb6c7b 100644 --- a/ui/component/claimListDiscover/view.jsx +++ b/ui/component/claimListDiscover/view.jsx @@ -51,6 +51,7 @@ type Props = { headerLabel?: string | Node, name?: string, renderProperties?: Claim => Node, + includeSupportAction?: boolean, }; function ClaimListDiscover(props: Props) { @@ -74,6 +75,7 @@ function ClaimListDiscover(props: Props) { header, name, renderProperties, + includeSupportAction, } = props; const didNavigateForward = history.action === 'PUSH'; const [page, setPage] = useState(1); @@ -282,6 +284,7 @@ function ClaimListDiscover(props: Props) { pageSize={PAGE_SIZE} empty={noResults} renderProperties={renderProperties} + includeSupportAction={includeSupportAction} />
diff --git a/ui/component/claimPreview/view.jsx b/ui/component/claimPreview/view.jsx index b9c6923ab..14755c4db 100644 --- a/ui/component/claimPreview/view.jsx +++ b/ui/component/claimPreview/view.jsx @@ -14,6 +14,7 @@ import ClaimTags from 'component/claimTags'; import SubscribeButton from 'component/subscribeButton'; import ChannelThumbnail from 'component/channelThumbnail'; import BlockButton from 'component/blockButton'; +import ClaimSupportButton from 'component/claimSupportButton'; import useGetThumbnail from 'effects/use-get-thumbnail'; import ClaimPreviewTitle from 'component/claimPreviewTitle'; import ClaimPreviewSubtitle from 'component/claimPreviewSubtitle'; @@ -56,6 +57,7 @@ type Props = { getFile: string => void, customShouldHide?: Claim => boolean, showUnresolvedClaim?: boolean, + includeSupportAction?: boolean, }; const ClaimPreview = forwardRef((props: Props, ref: any) => { @@ -87,6 +89,7 @@ const ClaimPreview = forwardRef((props: Props, ref: any) => { streamingUrl, customShouldHide, showUnresolvedClaim, + includeSupportAction, } = props; const shouldFetch = claim === undefined || (claim !== null && claim.value_type === 'channel' && isEmpty(claim.meta) && !pending); @@ -279,6 +282,7 @@ const ClaimPreview = forwardRef((props: Props, ref: any) => { {!hideBlock && isChannel && !isSubscribed && !claimIsMine && ( )} + {includeSupportAction && }
)} diff --git a/ui/component/claimSupportButton/index.js b/ui/component/claimSupportButton/index.js new file mode 100644 index 000000000..1e3b76ec0 --- /dev/null +++ b/ui/component/claimSupportButton/index.js @@ -0,0 +1,10 @@ +import { connect } from 'react-redux'; +import { doOpenModal } from 'redux/actions/app'; +import ClaimSupportButton from './view'; + +export default connect( + null, + { + doOpenModal, + } +)(ClaimSupportButton); diff --git a/ui/component/claimSupportButton/view.jsx b/ui/component/claimSupportButton/view.jsx new file mode 100644 index 000000000..6c9999e55 --- /dev/null +++ b/ui/component/claimSupportButton/view.jsx @@ -0,0 +1,25 @@ +// @flow +import * as MODALS from 'constants/modal_types'; +import * as ICONS from 'constants/icons'; +import React from 'react'; +import Button from 'component/button'; + +type Props = { + uri: string, + doOpenModal: (string, {}) => void, +}; + +export default function ClaimSupportButton(props: Props) { + const { doOpenModal, uri } = props; + + return ( +