diff --git a/app/src/component/fileItemMedia/view.js b/app/src/component/fileItemMedia/view.js index 985a1f48..024de0e1 100644 --- a/app/src/component/fileItemMedia/view.js +++ b/app/src/component/fileItemMedia/view.js @@ -45,11 +45,23 @@ class FileItemMedia extends React.PureComponent { } } + isThumbnailValid = (thumbnail) => { + if (!thumbnail || ((typeof thumbnail) !== 'string')) { + return false; + } + + if (thumbnail.substring(0, 7) != 'http://' && thumbnail.substring(0, 8) != 'https://') { + return false; + } + + return true; + } + render() { let style = this.props.style; const { blurRadius, isResolvingUri, thumbnail, title, resizeMode } = this.props; const atStyle = this.state.autoThumbStyle; - if (thumbnail && ((typeof thumbnail) === 'string') && thumbnail.trim().length > 0 && !this.state.imageLoadFailed) { + if (this.isThumbnailValid(thumbnail) && !this.state.imageLoadFailed) { if (style == null) { style = fileItemMediaStyle.thumbnail; } diff --git a/app/src/component/uriBar/view.js b/app/src/component/uriBar/view.js index cbeca044..0e74511b 100644 --- a/app/src/component/uriBar/view.js +++ b/app/src/component/uriBar/view.js @@ -44,6 +44,11 @@ class UriBar extends React.PureComponent { const { updateSearchQuery, onSearchSubmitted, navigation } = this.props; let timeout = setTimeout(() => { + if (text.trim().length === 0) { + // don't do anything if the text is empty + return; + } + updateSearchQuery(text); if (!text.startsWith('lbry://')) { diff --git a/app/src/page/file/view.js b/app/src/page/file/view.js index bfa0fd6a..42da2f5a 100644 --- a/app/src/page/file/view.js +++ b/app/src/page/file/view.js @@ -358,6 +358,12 @@ class FilePage extends React.PureComponent { }, 500); } + renderTags = (tags) => { + return tags.map((tag, i) => ( + {tag} + )); + } + render() { const { claim, @@ -424,6 +430,12 @@ class FilePage extends React.PureComponent { ); } else { + + let tags = []; + if (claim && claim.value && claim.value.tags) { + tags = claim.value.tags; + } + const completed = fileInfo && fileInfo.completed; const isRewardContent = rewardedContentClaimIds.includes(claim.claim_id); const description = metadata.description ? metadata.description : null; @@ -630,8 +642,16 @@ class FilePage extends React.PureComponent { } {(this.state.showDescription && description && description.length > 0) && } - {(this.state.showDescription && description) && - {this.linkify(description)}} + {(this.state.showDescription && description) && ( + + {this.linkify(description)} + {tags && tags.length > 0 && ( + + Tags + {this.renderTags(tags)} + + )} + )} diff --git a/app/src/styles/filePage.js b/app/src/styles/filePage.js index 4ade08e6..f5889348 100644 --- a/app/src/styles/filePage.js +++ b/app/src/styles/filePage.js @@ -302,6 +302,23 @@ const filePageStyle = StyleSheet.create({ }, tipButton: { marginRight: 8 + }, + tagContainer: { + marginLeft: 12, + marginRight: 12, + flexDirection: 'row' + }, + tagTitle: { + fontFamily: 'Inter-UI-SemiBold', + flex: 0.2 + }, + tagList: { + fontFamily: 'Inter-UI-Regular', + flex: 0.8, + flexDirection: 'row' + }, + tagItem: { + marginRight: 16 } });