diff --git a/ui/js/component/fileCardStream/index.js b/ui/js/component/fileCardStream/index.js index 14e3dc7f9..1a183846f 100644 --- a/ui/js/component/fileCardStream/index.js +++ b/ui/js/component/fileCardStream/index.js @@ -17,6 +17,9 @@ import { import { makeSelectFileInfoForUri, } from 'selectors/file_info' +import { + makeSelectResolvingUri, +} from 'selectors/content' import FileCardStream from './view' const makeSelect = () => { @@ -24,6 +27,8 @@ const makeSelect = () => { const selectFileInfoForUri = makeSelectFileInfoForUri() const selectMetadataForUri = makeSelectMetadataForUri() const selectSourceForUri = makeSelectSourceForUri() + const selectResolvingUri = makeSelectResolvingUri() + const select = (state, props) => ({ claim: selectClaimForUri(state, props), fileInfo: selectFileInfoForUri(state, props), @@ -32,6 +37,7 @@ const makeSelect = () => { hasSignature: false, metadata: selectMetadataForUri(state, props), source: selectSourceForUri(state, props), + isResolvingUri: selectResolvingUri(state, props), }) return select diff --git a/ui/js/component/fileCardStream/view.jsx b/ui/js/component/fileCardStream/view.jsx index c3954d9b7..61f580739 100644 --- a/ui/js/component/fileCardStream/view.jsx +++ b/ui/js/component/fileCardStream/view.jsx @@ -56,24 +56,36 @@ class FileCardStream extends React.Component { return null; } - // if (!this.props.metadata) { - // return null - // } + const { + metadata, + isResolvingUri, + navigate, + hidePrice, + claim, + } = this.props const uri = lbryuri.normalize(this.props.uri); - const metadata = this.props.metadata; const isConfirmed = !!metadata; const title = isConfirmed ? metadata.title : uri; const obscureNsfw = this.props.obscureNsfw && isConfirmed && metadata.nsfw; const primaryUrl = 'show=' + uri; + let description = "" + if (isConfirmed) { + description = metadata.description + } else if (isResolvingUri) { + description = "Loading..." + } else { + description = This file is pending confirmation + } + return (
- this.props.navigate(primaryUrl)} className="card__link"> + navigate(primaryUrl)} className="card__link">
{title}
- { !this.props.hidePrice ? : null} + { !hidePrice ? : null}
@@ -82,11 +94,7 @@ class FileCardStream extends React.Component {
}
- - {isConfirmed - ? metadata.description - : This file is pending confirmation.} - + {description}
{this.state.showNsfwHelp && this.state.hovered diff --git a/ui/js/component/fileTileStream/index.js b/ui/js/component/fileTileStream/index.js index d212dfdae..faf50f08b 100644 --- a/ui/js/component/fileTileStream/index.js +++ b/ui/js/component/fileTileStream/index.js @@ -20,6 +20,9 @@ import { import { selectObscureNsfw, } from 'selectors/app' +import { + makeSelectResolvingUri, +} from 'selectors/content' import FileTileStream from './view' const makeSelect = () => { @@ -29,6 +32,7 @@ const makeSelect = () => { const selectAvailabilityForUri = makeSelectAvailabilityForUri() const selectMetadataForUri = makeSelectMetadataForUri() const selectSourceForUri = makeSelectSourceForUri() + const selectResolvingUri = makeSelectResolvingUri() const select = (state, props) => ({ claim: selectClaimForUri(state, props), @@ -38,6 +42,7 @@ const makeSelect = () => { obscureNsfw: selectObscureNsfw(state), metadata: selectMetadataForUri(state, props), source: selectSourceForUri(state, props), + resolvingUri: selectResolvingUri(state, props), }) return select diff --git a/ui/js/page/discover/view.jsx b/ui/js/page/discover/view.jsx index e668855d2..5c4c4e511 100644 --- a/ui/js/page/discover/view.jsx +++ b/ui/js/page/discover/view.jsx @@ -18,7 +18,7 @@ const FeaturedCategory = (props) => {

{category} {category && category.match(/^community/i) && }

- {names && names.map(name => )} + {names && names.map(name => )}
} diff --git a/ui/js/selectors/content.js b/ui/js/selectors/content.js index be38c21b3..87b91182d 100644 --- a/ui/js/selectors/content.js +++ b/ui/js/selectors/content.js @@ -96,3 +96,19 @@ export const shouldFetchPublishedContent = createSelector( return true } ) + +export const selectResolvingUris = createSelector( + _selectState, + (state) => state.resolvingUris || [] +) + +const selectResolvingUri = (state, props) => { + return selectResolvingUris(state).indexOf(props.uri) != -1 +} + +export const makeSelectResolvingUri = () => { + return createSelector( + selectResolvingUri, + (resolving) => resolving + ) +}