From d21e4aa83025bcd9b5ede6b76f480bf1904f6d0b Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Sun, 3 Jun 2018 13:46:43 +0100 Subject: [PATCH] Add URI to search result items. Update omnibar URI suggestions display. --- app/src/component/searchResultItem/view.js | 11 +++++++++-- app/src/component/uriBar/internal/uri-bar-item.js | 4 ++-- app/src/styles/search.js | 5 +++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/app/src/component/searchResultItem/view.js b/app/src/component/searchResultItem/view.js index 7d805a64..58c318aa 100644 --- a/app/src/component/searchResultItem/view.js +++ b/app/src/component/searchResultItem/view.js @@ -1,6 +1,7 @@ import React from 'react'; import { normalizeURI, parseURI } from 'lbry-redux'; -import { Text, TouchableOpacity, View } from 'react-native'; +import { ActivityIndicator, Text, TouchableOpacity, View } from 'react-native'; +import Colors from '../../styles/colors'; import FileItemMedia from '../fileItemMedia'; import NsfwOverlay from '../../component/nsfwOverlay'; import searchStyle from '../../styles/search'; @@ -39,7 +40,13 @@ class SearchResultItem extends React.PureComponent { thumbnail={metadata ? metadata.thumbnail : null} /> - {isResolvingUri && Loading...} + {isResolvingUri && ( + + {uri} + + + + )} {!isResolvingUri && {title || name}} {!isResolvingUri && channel && {channel}} diff --git a/app/src/component/uriBar/internal/uri-bar-item.js b/app/src/component/uriBar/internal/uri-bar-item.js index 71126bf9..bab7d037 100644 --- a/app/src/component/uriBar/internal/uri-bar-item.js +++ b/app/src/component/uriBar/internal/uri-bar-item.js @@ -8,7 +8,7 @@ import uriBarStyle from '../../../styles/uriBar'; class UriBarItem extends React.PureComponent { render() { const { item, onPress } = this.props; - const { type, value } = item; + const { shorthand, type, value } = item; let icon; switch (type) { @@ -29,7 +29,7 @@ class UriBarItem extends React.PureComponent { return ( {icon} - {value} + {shorthand || value} - {type === 'search' ? 'Search' : value} ) } diff --git a/app/src/styles/search.js b/app/src/styles/search.js index 8ace8954..e8b01f12 100644 --- a/app/src/styles/search.js +++ b/app/src/styles/search.js @@ -42,6 +42,11 @@ const searchStyle = StyleSheet.create({ fontFamily: 'Metropolis-SemiBold', fontSize: 16 }, + uri: { + fontFamily: 'Metropolis-SemiBold', + fontSize: 14, + marginBottom: 8 + }, publisher: { fontFamily: 'Metropolis-SemiBold', fontSize: 12, -- 2.45.2