update doSearch calls

This commit is contained in:
Akinwale Ariwodola 2020-01-05 11:40:38 +01:00
parent 13136e606d
commit d7635dc7ee
7 changed files with 21 additions and 9 deletions

4
package-lock.json generated
View file

@ -7047,8 +7047,8 @@
} }
}, },
"lbry-redux": { "lbry-redux": {
"version": "github:lbryio/lbry-redux#2c569a729bb40d45249ca38150b00922162b7ce3", "version": "github:lbryio/lbry-redux#eb8fff0e5afd43be00822b3f476eea9e0eb7b075",
"from": "github:lbryio/lbry-redux#2c569a729bb40d45249ca38150b00922162b7ce3", "from": "github:lbryio/lbry-redux#eb8fff0e5afd43be00822b3f476eea9e0eb7b075",
"requires": { "requires": {
"proxy-polyfill": "0.1.6", "proxy-polyfill": "0.1.6",
"reselect": "^3.0.0", "reselect": "^3.0.0",

View file

@ -12,7 +12,7 @@
"base-64": "^0.1.0", "base-64": "^0.1.0",
"@expo/vector-icons": "^8.1.0", "@expo/vector-icons": "^8.1.0",
"gfycat-style-urls": "^1.0.3", "gfycat-style-urls": "^1.0.3",
"lbry-redux": "lbryio/lbry-redux#2c569a729bb40d45249ca38150b00922162b7ce3", "lbry-redux": "lbryio/lbry-redux#eb8fff0e5afd43be00822b3f476eea9e0eb7b075",
"lbryinc": "lbryio/lbryinc#053ca52f4f7f9bf8eb62a3581b183671a475ad1c", "lbryinc": "lbryio/lbryinc#053ca52f4f7f9bf8eb62a3581b183671a475ad1c",
"lodash": ">=4.17.11", "lodash": ">=4.17.11",
"merge": ">=1.2.1", "merge": ">=1.2.1",

View file

@ -18,7 +18,7 @@ const select = (state, props) => ({
const perform = dispatch => ({ const perform = dispatch => ({
resolveUris: uris => dispatch(doResolveUris(uris)), resolveUris: uris => dispatch(doResolveUris(uris)),
searchRecommended: query => dispatch(doSearch(query, 20, undefined, true, false)), searchRecommended: (query, claimId) => dispatch(doSearch(query, 20, undefined, true, { related_to: claimId }, false)),
}); });
export default connect( export default connect(

View file

@ -13,9 +13,9 @@ export default class RelatedContent extends React.PureComponent {
}; };
componentDidMount() { componentDidMount() {
const { title, searchRecommended } = this.props; const { title, claimId, searchRecommended } = this.props;
if (title) { if (title && claimId) {
searchRecommended(title); searchRecommended(title, claimId);
} }
} }

View file

@ -991,6 +991,7 @@ class FilePage extends React.PureComponent {
uri={claim && claim.permanent_url ? claim.permanent_url : uri} uri={claim && claim.permanent_url ? claim.permanent_url : uri}
style={filePageStyle.filePriceContainer} style={filePageStyle.filePriceContainer}
textStyle={filePageStyle.filePriceText} textStyle={filePageStyle.filePriceText}
iconStyle={filePageStyle.filePriceIcon}
/> />
)} )}
@ -1223,7 +1224,13 @@ class FilePage extends React.PureComponent {
<View onLayout={this.setRelatedContentPosition} /> <View onLayout={this.setRelatedContentPosition} />
{this.state.showRecommended && ( {this.state.showRecommended && (
<RelatedContent navigation={navigation} title={title} uri={fullUri} fullUri={fullUri} /> <RelatedContent
navigation={navigation}
claimId={claim.claim_id}
title={title}
uri={fullUri}
fullUri={fullUri}
/>
)} )}
</ScrollView> </ScrollView>
)} )}

View file

@ -28,7 +28,7 @@ const select = state => ({
}); });
const perform = dispatch => ({ const perform = dispatch => ({
search: query => dispatch(doSearch(query, numSearchResults, null, false, false)), search: query => dispatch(doSearch(query, numSearchResults, null, false, {}, false)),
claimSearch: options => dispatch(doClaimSearch(options)), claimSearch: options => dispatch(doClaimSearch(options)),
updateSearchQuery: query => dispatch(doUpdateSearchQuery(query)), updateSearchQuery: query => dispatch(doUpdateSearchQuery(query)),
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_SEARCH)), pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_SEARCH)),

View file

@ -170,6 +170,8 @@ const filePageStyle = StyleSheet.create({
filePriceContainer: { filePriceContainer: {
backgroundColor: Colors.NextLbryGreen, backgroundColor: Colors.NextLbryGreen,
justifyContent: 'center', justifyContent: 'center',
alignItems: 'center',
flexDirection: 'row',
position: 'absolute', position: 'absolute',
right: 16, right: 16,
top: 16, top: 16,
@ -183,6 +185,9 @@ const filePageStyle = StyleSheet.create({
textAlign: 'center', textAlign: 'center',
color: '#0c604b', color: '#0c604b',
}, },
filePriceIcon: {
marginRight: 2,
},
actions: { actions: {
flexDirection: 'row', flexDirection: 'row',
justifyContent: 'space-between', justifyContent: 'space-between',