diff --git a/app/src/component/suggestedSubscriptions/view.js b/app/src/component/suggestedSubscriptions/view.js index b51e1af3..18c55fe4 100644 --- a/app/src/component/suggestedSubscriptions/view.js +++ b/app/src/component/suggestedSubscriptions/view.js @@ -1,6 +1,7 @@ import React from 'react'; import { ActivityIndicator, SectionList, Text, View } from 'react-native'; import { normalizeURI } from 'lbry-redux'; +import { navigateToUri } from 'utils/helper'; import SubscribeButton from 'component/subscribeButton'; import SuggestedSubscriptionItem from 'component/suggestedSubscriptionItem'; import Colors from 'styles/colors'; @@ -36,7 +37,9 @@ class SuggestedSubscriptions extends React.PureComponent { const channelUri = normalizeURI(titleParts[1]); return ( <View style={subscriptionsStyle.titleRow}> - <Link style={subscriptionsStyle.channelTitle} text={channelName} href={channelUri} /> + <Link style={subscriptionsStyle.channelTitle} text={channelName} onPress={() => { + navigateToUri(navigation, normalizeURI(channelUri)); + }} /> <SubscribeButton style={subscriptionsStyle.subscribeButton} uri={channelUri} name={channelName} /> </View> ) diff --git a/app/src/component/uriBar/view.js b/app/src/component/uriBar/view.js index 2d11fc0d..5a2ec52a 100644 --- a/app/src/component/uriBar/view.js +++ b/app/src/component/uriBar/view.js @@ -101,10 +101,24 @@ class UriBar extends React.PureComponent { } let style = [uriBarStyle.overlay]; - if (this.state.focused) { + /*if (this.state.focused) { style.push(uriBarStyle.inFocus); } + {(this.state.focused && !this.state.directSearch) && ( + <View style={uriBarStyle.suggestions}> + <FlatList style={uriBarStyle.suggestionList} + data={suggestions} + keyboardShouldPersistTaps={'handled'} + keyExtractor={(item, value) => item.value} + renderItem={({item}) => ( + <UriBarItem + item={item} + navigation={navigation} + onPress={() => this.handleItemPress(item)} + />)} /> + </View>)}*/ + return ( <View style={style}> <View style={uriBarStyle.uriContainer}> @@ -153,19 +167,6 @@ class UriBar extends React.PureComponent { } }}/> </View> - {(this.state.focused && !this.state.directSearch) && ( - <View style={uriBarStyle.suggestions}> - <FlatList style={uriBarStyle.suggestionList} - data={suggestions} - keyboardShouldPersistTaps={'handled'} - keyExtractor={(item, value) => item.value} - renderItem={({item}) => ( - <UriBarItem - item={item} - navigation={navigation} - onPress={() => this.handleItemPress(item)} - />)} /> - </View>)} </View> ); } diff --git a/app/src/page/file/view.js b/app/src/page/file/view.js index 921e5c96..8b2813a4 100644 --- a/app/src/page/file/view.js +++ b/app/src/page/file/view.js @@ -591,6 +591,10 @@ class FilePage extends React.PureComponent { show={DateTime.SHOW_DATE} /> </View> <View style={filePageStyle.subscriptionRow}> + <Button style={[filePageStyle.actionButton, filePageStyle.tipButton]} + theme={"light"} + icon={"gift"} + onPress={() => this.setState({ showTipView: true })} /> <SubscribeButton style={filePageStyle.actionButton} uri={fullChannelUri} @@ -603,6 +607,26 @@ class FilePage extends React.PureComponent { </View> } + {this.state.showTipView && <View style={filePageStyle.divider} />} + {this.state.showTipView && + <View style={filePageStyle.tipCard}> + <View style={filePageStyle.row}> + <View style={filePageStyle.amountRow}> + <TextInput ref={ref => this.tipAmountInput = ref} + onChangeText={value => this.setState({tipAmount: value})} + keyboardType={'numeric'} + value={this.state.tipAmount} + style={[filePageStyle.input, filePageStyle.tipAmountInput]} /> + <Text style={[filePageStyle.text, filePageStyle.currency]}>LBC</Text> + </View> + <Link style={[filePageStyle.link, filePageStyle.cancelTipLink]} text={'Cancel'} onPress={() => this.setState({ showTipView: false })} /> + <Button text={'Send a tip'} + style={[filePageStyle.button, filePageStyle.sendButton]} + disabled={!canSendTip} + onPress={this.handleSendTip} /> + </View> + </View>} + {(this.state.showDescription && description && description.length > 0) && <View style={filePageStyle.divider} />} {(this.state.showDescription && description) && <Text style={filePageStyle.description} selectable={true}>{this.linkify(description)}</Text>} @@ -610,23 +634,6 @@ class FilePage extends React.PureComponent { <View onLayout={this.setRelatedContentPosition} /> <RelatedContent navigation={navigation} uri={uri} /> </ScrollView> - {this.state.showTipView && <View style={filePageStyle.tipCard}> - <View style={filePageStyle.row}> - <View style={filePageStyle.amountRow}> - <TextInput ref={ref => this.tipAmountInput = ref} - onChangeText={value => this.setState({tipAmount: value})} - keyboardType={'numeric'} - value={this.state.tipAmount} - style={[filePageStyle.input, filePageStyle.tipAmountInput]} /> - <Text style={[filePageStyle.text, filePageStyle.currency]}>LBC</Text> - </View> - <Link style={[filePageStyle.link, filePageStyle.cancelTipLink]} text={'Cancel'} onPress={() => this.setState({ showTipView: false })} /> - <Button text={'Send tip'} - style={[filePageStyle.button, filePageStyle.sendButton]} - disabled={!canSendTip} - onPress={this.handleSendTip} /> - </View> - </View>} </View> )} {!this.state.fullscreenMode && <FloatingWalletBalance navigation={navigation} />} diff --git a/app/src/page/search/view.js b/app/src/page/search/view.js index b2364078..9717d5d9 100644 --- a/app/src/page/search/view.js +++ b/app/src/page/search/view.js @@ -55,7 +55,15 @@ class SearchPage extends React.PureComponent { onSearchSubmitted={this.handleSearchSubmitted} /> {!isSearching && (!uris || uris.length === 0) && <Text style={searchStyle.noResultsText}>No results to display.</Text>} - <ScrollView style={searchStyle.scrollContainer} contentContainerStyle={searchStyle.scrollPadding}> + {isSearching && + <View style={searchStyle.busyContainer}> + <ActivityIndicator size="large" color={Colors.LbryGreen} style={searchStyle.loading} /> + </View>} + {!isSearching && + <ScrollView + style={searchStyle.scrollContainer} + contentContainerStyle={searchStyle.scrollPadding} + keyboardShouldPersistTaps={'handled'}> {this.state.currentUri && <FileListItem key={this.state.currentUri} @@ -72,8 +80,7 @@ class SearchPage extends React.PureComponent { navigation={navigation} onPress={() => navigateToUri(navigation, uri)}/>) ) : null } - </ScrollView> - {isSearching && <ActivityIndicator size="large" color={Colors.LbryGreen} style={searchStyle.loading} /> } + </ScrollView>} <FloatingWalletBalance navigation={navigation} /> </View> ); diff --git a/app/src/styles/filePage.js b/app/src/styles/filePage.js index b5d0a789..0aeedd80 100644 --- a/app/src/styles/filePage.js +++ b/app/src/styles/filePage.js @@ -246,11 +246,8 @@ const filePageStyle = StyleSheet.create({ color: "rgba(64, 184, 154, .2)" }, tipCard: { - backgroundColor: Colors.White, - position: 'absolute', - top: containedMediaHeightWithControls - 16, width: '100%', - paddingTop: 8, + marginTop: -12, paddingBottom: 8, paddingLeft: 16, paddingRight: 16 @@ -298,6 +295,9 @@ const filePageStyle = StyleSheet.create({ fontFamily: 'Inter-UI-Regular', fontSize: 16, lineHeight: 24 + }, + tipButton: { + marginRight: 8 } }); diff --git a/app/src/styles/search.js b/app/src/styles/search.js index 0b7bcdfa..441ca42d 100644 --- a/app/src/styles/search.js +++ b/app/src/styles/search.js @@ -4,15 +4,16 @@ import Colors from 'styles/colors'; const searchStyle = StyleSheet.create({ container: { flex: 1, - justifyContent: 'center', - alignItems: 'center' }, scrollContainer: { flex: 1, - width: '100%', - height: '100%', marginTop: 60 }, + busyContainer: { + flex: 1, + alignItems: 'center', + justifyContent: 'center' + }, scrollPadding: { paddingBottom: 16 }, diff --git a/app/src/styles/uriBar.js b/app/src/styles/uriBar.js index e930e64d..e3a729bc 100644 --- a/app/src/styles/uriBar.js +++ b/app/src/styles/uriBar.js @@ -30,7 +30,7 @@ const uriBarStyle = StyleSheet.create({ }, overlay: { position: 'absolute', - backgroundColor: 'transparent', + backgroundColor: '#cc0000', top: 0, width: '100%', zIndex: 200,