improve no search results display
This commit is contained in:
parent
3aaab91b9d
commit
5e99a2346c
3 changed files with 24 additions and 8 deletions
|
@ -104,8 +104,7 @@ class SearchPage extends React.PureComponent {
|
||||||
<ActivityIndicator size="large" color={Colors.LbryGreen} style={searchStyle.loading} />
|
<ActivityIndicator size="large" color={Colors.LbryGreen} style={searchStyle.loading} />
|
||||||
</View>}
|
</View>}
|
||||||
|
|
||||||
{!isSearching && (!uris || uris.length === 0) &&
|
|
||||||
<Text style={searchStyle.noResultsText}>No results to display.</Text>}
|
|
||||||
{!isSearching &&
|
{!isSearching &&
|
||||||
<ScrollView
|
<ScrollView
|
||||||
style={searchStyle.scrollContainer}
|
style={searchStyle.scrollContainer}
|
||||||
|
@ -127,6 +126,10 @@ class SearchPage extends React.PureComponent {
|
||||||
navigation={navigation}
|
navigation={navigation}
|
||||||
onPress={() => navigateToUri(navigation, uri)}/>)
|
onPress={() => navigateToUri(navigation, uri)}/>)
|
||||||
) : null }
|
) : null }
|
||||||
|
{(!uris || uris.length === 0) &&
|
||||||
|
<View style={searchStyle.noResults}>
|
||||||
|
<Text style={searchStyle.noResultsText}>There are no results to display for <Text style={searchStyle.boldText}>{query}</Text>. Please try a different search term.</Text>
|
||||||
|
</View>}
|
||||||
</ScrollView>}
|
</ScrollView>}
|
||||||
<FloatingWalletBalance navigation={navigation} />
|
<FloatingWalletBalance navigation={navigation} />
|
||||||
</View>
|
</View>
|
||||||
|
|
|
@ -8,7 +8,7 @@ const searchStyle = StyleSheet.create({
|
||||||
},
|
},
|
||||||
scrollContainer: {
|
scrollContainer: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
marginTop: 60
|
marginTop: 60,
|
||||||
},
|
},
|
||||||
busyContainer: {
|
busyContainer: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
|
@ -16,6 +16,7 @@ const searchStyle = StyleSheet.create({
|
||||||
justifyContent: 'center'
|
justifyContent: 'center'
|
||||||
},
|
},
|
||||||
scrollPadding: {
|
scrollPadding: {
|
||||||
|
flex: 1,
|
||||||
paddingBottom: 16
|
paddingBottom: 16
|
||||||
},
|
},
|
||||||
resultItem: {
|
resultItem: {
|
||||||
|
@ -27,7 +28,6 @@ const searchStyle = StyleSheet.create({
|
||||||
marginRight: 8
|
marginRight: 8
|
||||||
},
|
},
|
||||||
featuredResultItem: {
|
featuredResultItem: {
|
||||||
flex: 1,
|
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'space-between',
|
||||||
paddingTop: 8,
|
paddingTop: 8,
|
||||||
|
@ -42,11 +42,22 @@ const searchStyle = StyleSheet.create({
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-UI-Regular',
|
||||||
fontSize: 16
|
fontSize: 16
|
||||||
},
|
},
|
||||||
|
noResults: {
|
||||||
|
flex: 1,
|
||||||
|
width: '100%',
|
||||||
|
height: '100%',
|
||||||
|
justifyContent: 'center',
|
||||||
|
alignItems: 'center'
|
||||||
|
},
|
||||||
noResultsText: {
|
noResultsText: {
|
||||||
textAlign: 'center',
|
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-UI-Regular',
|
||||||
fontSize: 14,
|
fontSize: 16,
|
||||||
position: 'absolute'
|
marginLeft: 16,
|
||||||
|
marginRight: 16
|
||||||
|
},
|
||||||
|
boldText: {
|
||||||
|
fontFamily: 'Inter-UI-SemiBold',
|
||||||
|
fontSize: 16
|
||||||
},
|
},
|
||||||
loading: {
|
loading: {
|
||||||
position: 'absolute'
|
position: 'absolute'
|
||||||
|
|
|
@ -20,10 +20,12 @@ const uriBarStyle = StyleSheet.create({
|
||||||
},
|
},
|
||||||
uriText: {
|
uriText: {
|
||||||
backgroundColor: Colors.VeryLightGrey,
|
backgroundColor: Colors.VeryLightGrey,
|
||||||
padding: 8,
|
|
||||||
borderRadius: 24,
|
borderRadius: 24,
|
||||||
|
paddingLeft: 12,
|
||||||
|
paddingRight: 12,
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-UI-Regular',
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
|
lineHeight: 18,
|
||||||
flex: 17
|
flex: 17
|
||||||
},
|
},
|
||||||
overlay: {
|
overlay: {
|
||||||
|
|
Loading…
Reference in a new issue