From 72cbd6302bb862a6677ce6b94bd36c38c23f0b76 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Thu, 7 Nov 2019 16:12:34 +0530 Subject: [PATCH 001/302] Video Reply icon on all view and Video Click validation --- RootNavigationContainer.js | 2 +- src/assets/reply_video.png | Bin 0 -> 1339 bytes .../CommonComponents/ReplyVideo/index.js | 61 ++++++++++++++++++ .../CommonComponents/ReplyVideo/styles.js | 24 +++++++ .../FullScreeVideoRow.js | 2 + src/components/Home/HomeFeedRow.js | 2 + .../UserVideoHistory/UserVideoHistoryRow.js | 2 + src/services/ReduxGetters.js | 11 ++++ 8 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 src/assets/reply_video.png create mode 100644 src/components/CommonComponents/ReplyVideo/index.js create mode 100644 src/components/CommonComponents/ReplyVideo/styles.js diff --git a/RootNavigationContainer.js b/RootNavigationContainer.js index 5b155d86..fa75a362 100644 --- a/RootNavigationContainer.js +++ b/RootNavigationContainer.js @@ -203,7 +203,7 @@ const ProfilePushStack = createStackNavigator( WalletSettingScreen: WalletSettingScreen, WalletDetails: WalletDetails, VideoTags: VideoTags, - FullScreenVideoCollection: FullScreenVideoCollection + FullScreenVideoCollection: FullScreenVideoCollection }, { headerLayoutPreset: 'center' diff --git a/src/assets/reply_video.png b/src/assets/reply_video.png new file mode 100644 index 0000000000000000000000000000000000000000..a792e83c26b3630376055b04eccf81a417eec674 GIT binary patch literal 1339 zcmeAS@N?(olHy`uVBq!ia0vp^H9(xg!3-peU6)h=spkPcA+G=b{|7Sv|NHm<*RTJv zxj-%oNG$wc+x7qQbreCeIgwfa(@Osr*8gvvgvE@Us{dy$VG-YZ1dAYCsI2AxwtfGP zoPr8Wn)83EG`kpQn`O#)b0!e7rWmN>82p*`oRVofVmp(rn*f zJUylK;njotK?)CLrs``lFfecTba4#HxOencX8B|XiMEIBuQo(9I(RsJ^S!-h*4ncC ztJiG*|NlP2?5g211AT)7e=VQKsH-Q=oGI>gC2yDM_fK~&cBL+hns(}x>sibFCE0hS zRkH#M7F(}-rNtEd_0^7SjV}(ZulKP9&5Acqd6eevyktwCCcAk%>yZ@(CX*kvoqqaa zU$)AD>EdESsj)iAkM8jZ&8jr~(8}levb&?=dgGBfc`SEUI2DC9cb%79a{QUfp7O2` ztGAtn{fbLxs2_-yT@tZev`v~X=&WJW$2dXF@Heavzo#yV`}wc(PRa>|G`sfyDJN9E z70YkuKCzC_iks8U{{O&el(V7Re?sQu`j2g0KEcv5`7cjc?ENaf->qVO|NV7` ztE>O;PTcjc+1#7s?dw?=X8YfGd0p|4mg)Qt+6TWsb6W9FcF*@3@$a?Zc>DC3^7?IGj_c|k*~)&0h0{I5 z-(vYui!;3MP9L@}p4ISMdXEBkeesb*uDE~%XQ6Y}HU5XpOJdFHen{zORLDAeS}b=w z+MaRxpr!Be+ZUcbn6vD$mDYrcx$cLxcbw+m-#k@5ukmTSvB>8?XXpMYkZu0+!L04) zL)nU-cT--?cvfD$bzw%OZG;xrl+%0UR{mo%|6DaQBDcWx{Bu*UV7U)F_lTcZ%<(_kDjx^|l0y@yg%3SP*{m(RS90MK3w)JtOsG|2)iG9kR4ya|swQ?R`-=D+jajKnM4~&+2l>}53A(K|S4rR0V|~ctdGoi&h!%ZbE~v&X ztu_PKgZ?XR(J|n z?fdVt`P|thJhJQGU3m4>H>tJnI%C{TThG1=g|iEz)^8PYEc(bOA0_(d%BRBV7VBoS zy~};MO?}U*r;oKo9Wt*3w46Nt)@TjmTkq4y-EZ9p*!0@G?1jlsrVKq@V9~(f>FVdQ I&MBb@0HEmi1poj5 literal 0 HcmV?d00001 diff --git a/src/components/CommonComponents/ReplyVideo/index.js b/src/components/CommonComponents/ReplyVideo/index.js new file mode 100644 index 00000000..847b5de6 --- /dev/null +++ b/src/components/CommonComponents/ReplyVideo/index.js @@ -0,0 +1,61 @@ +import React, { PureComponent } from 'react'; +import {TouchableOpacity , Image, View, Text} from "react-native"; +import { connect } from 'react-redux'; + +import reduxGetter from '../../../services/ReduxGetters'; +import inlineStyles from './styles'; +import multipleClickHandler from "../../../services/MultipleClickHandler"; +import pricer from '../../../services/Pricer'; +import reply_video from '../../../assets/reply_video.png'; +import Utilities from '../../../services/Utilities'; +import CurrentUser from '../../../models/CurrentUser'; + +const mapStateToProps = (state , ownProps) => { + return { + isCreatorApproved : reduxGetter.isCreatorApproved(ownProps.userId), + isVideoUserActivated : Utilities.isUserActivated(reduxGetter.getUserActivationStatus(ownProps.userId)), + isCurrentUserActivated : CurrentUser.isUserActivated(), + balance : state.balance, + requiredPepo : reduxGetter.getVideoReplyAmount(ownProps.videoId, state), + videoReplyCount : reduxGetter.getVideoReplyCount(ownProps.videoId, state) + } +}; + +class ReplyVideo extends PureComponent { + + constructor(props){ + super(props); + }; + + isDisabled = () => { + return this.props.isCreatorApproved != 1 || !this.props.isVideoUserActivated || !this.props.isCurrentUserActivated || !this.hasSufficientBalance(); + }; + + hasSufficientBalance = () => { + return this.getBalanceToNumber() >= this.props.requiredPepo ? true : false; + }; + + getBalanceToNumber = () => { + return (this.props.balance && Math.floor(Number(pricer.getFromDecimal(this.props.balance)))) || 0; + }; + + replyVideo = ()=> { + + }; + + render(){ + return ( + + {this.props.videoReplyCount} + this.replyVideo())} > + + + ); + } + +}; + +export default connect(mapStateToProps)(ReplyVideo); diff --git a/src/components/CommonComponents/ReplyVideo/styles.js b/src/components/CommonComponents/ReplyVideo/styles.js new file mode 100644 index 00000000..20f8a946 --- /dev/null +++ b/src/components/CommonComponents/ReplyVideo/styles.js @@ -0,0 +1,24 @@ +import DefaultStyleGenerator from '../../../theme/styles/DefaultStyleGenerator'; +import Colors from '../../../theme/styles/Colors'; + +let stylesMap = { + + replyIconWrapper : { + marginBottom: 5, + height: 50, + width: 50, + alignItems: 'center', + justifyContent: 'center' + }, + videoReplyCount : { + fontSize: 18, + color: Colors.white, + alignSelf: 'center', + textShadowColor: 'rgba(0, 0, 0, 0.65)', + textShadowOffset: {width: 1, height: 1}, + textShadowRadius: 1, + fontFamily: 'AvenirNext-DemiBold' + } +}; + +export default styles = DefaultStyleGenerator.generate(stylesMap); diff --git a/src/components/FullScreenVideoCollection/FullScreeVideoRow.js b/src/components/FullScreenVideoCollection/FullScreeVideoRow.js index 0dbf318a..41bc2e97 100644 --- a/src/components/FullScreenVideoCollection/FullScreeVideoRow.js +++ b/src/components/FullScreenVideoCollection/FullScreeVideoRow.js @@ -16,6 +16,7 @@ import inlineStyles from './styles'; import utilities from '../../services/Utilities'; import OptionsIcon from '../../assets/options_self_video.png'; +import ReplyVideo from '../CommonComponents/ReplyVideo'; class FullScreeVideoRow extends PureComponent { @@ -87,6 +88,7 @@ class FullScreeVideoRow extends PureComponent { userId={this.userId} videoId={this.videoId} /> + diff --git a/src/components/Home/HomeFeedRow.js b/src/components/Home/HomeFeedRow.js index 7814e81a..ec220cb3 100644 --- a/src/components/Home/HomeFeedRow.js +++ b/src/components/Home/HomeFeedRow.js @@ -15,6 +15,7 @@ import VideoAmountStat from '../CommonComponents/VideoAmoutStat'; import inlineStyles from './styles'; import utilities from '../../services/Utilities'; import ReportVideo from "../CommonComponents/ReportVideo"; +import ReplyVideo from '../CommonComponents/ReplyVideo'; class HomeFeedRow extends PureComponent { constructor(props) { @@ -93,6 +94,7 @@ class HomeFeedRow extends PureComponent { userId={this.userId} videoId={this.videoId} /> + diff --git a/src/components/UserVideoHistory/UserVideoHistoryRow.js b/src/components/UserVideoHistory/UserVideoHistoryRow.js index 9a3b88a1..83e32143 100644 --- a/src/components/UserVideoHistory/UserVideoHistoryRow.js +++ b/src/components/UserVideoHistory/UserVideoHistoryRow.js @@ -16,6 +16,7 @@ import inlineStyles from './styles'; import utilities from '../../services/Utilities'; import OptionsIcon from '../../assets/options_self_video.png'; +import ReplyVideo from '../CommonComponents/ReplyVideo'; class UserVideoHistoryRow extends PureComponent { @@ -84,6 +85,7 @@ class UserVideoHistoryRow extends PureComponent { userId={this.props.userId} videoId={this.props.videoId} /> + diff --git a/src/services/ReduxGetters.js b/src/services/ReduxGetters.js index 26581708..35acbd9f 100644 --- a/src/services/ReduxGetters.js +++ b/src/services/ReduxGetters.js @@ -57,6 +57,7 @@ class ReduxGetters { state = state || Store.getState(); return deepGet(state, `twitter_entities.id_${id}.handle`); } + getUserTwitterHandleLink(id, state) { state = state || Store.getState(); return deepGet(state, `twitter_entities.id_${id}.link`); @@ -422,6 +423,16 @@ class ReduxGetters { return deepGet(state, `tag_entities.id_${id}`); } + getVideoReplyCount(id, state){ + state = state || Store.getState(); + return deepGet(state, `video_stat_entities.id_${id}.reply_count`, 0); + } + + getVideoReplyAmount(id, state){ + state = state || Store.getState(); + return deepGet(state, `video_stat_entities.id_${id}.reply_amount`, 0); + } + } export default new ReduxGetters(); From 9e8afed13c270c8b7f434fcf11c1c7e012867684 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Thu, 7 Nov 2019 18:28:34 +0530 Subject: [PATCH 002/302] add video replies screen --- RootNavigationContainer.js | 5 + .../CommonComponents/ReplyVideo/index.js | 5 +- .../UserVideoHistory/UserVideoHistoryRow.js | 3 +- src/components/VideoReplies/index.js | 273 ++++++++++++++++++ src/components/VideoReplies/styles.js | 18 ++ 5 files changed, 300 insertions(+), 4 deletions(-) create mode 100644 src/components/VideoReplies/index.js create mode 100644 src/components/VideoReplies/styles.js diff --git a/RootNavigationContainer.js b/RootNavigationContainer.js index fa75a362..e8c0e626 100644 --- a/RootNavigationContainer.js +++ b/RootNavigationContainer.js @@ -56,6 +56,7 @@ import CouchMarks from './src/components/CouchMarks'; import RedemptiomScreen from './src/components/Redemption'; import VideoTags from './src/components/VideoTags'; import FullScreenVideoCollection from './src/components/FullScreenVideoCollection'; +import VideoReplies from './src/components/VideoReplies'; const customTabHiddenRoutes = [ 'CaptureVideo', @@ -132,6 +133,7 @@ const HomePushStack = createStackNavigator( HomeScreen: HomeScreen, UsersProfileScreen: UsersProfileScreen, UserVideoHistory: UserVideoHistory, + VideoReplies: VideoReplies, SupportingListScreen: SupportingListScreen, SupportersListScreen: SupportersListScreen, VideoTags: VideoTags, @@ -165,6 +167,7 @@ const NotificationPushStack = createStackNavigator( NotificationScreen: NotificationScreen, UsersProfileScreen: UsersProfileScreen, UserVideoHistory: UserVideoHistory, + VideoReplies: VideoReplies, VideoPlayer: VideoPlayer, SupportingListScreen: SupportingListScreen, SupportersListScreen: SupportersListScreen, @@ -192,6 +195,7 @@ const ProfilePushStack = createStackNavigator( { ProfileScreen: ProfileScreen, UserVideoHistory: UserVideoHistory, + VideoReplies: VideoReplies, SupportingListScreen: SupportingListScreen, SupportersListScreen: SupportersListScreen, UsersProfileScreen: UsersProfileScreen, @@ -242,6 +246,7 @@ const SearchPushStack = createStackNavigator( SupportingListScreen: SupportingListScreen, SupportersListScreen: SupportersListScreen, UserVideoHistory: UserVideoHistory, + VideoReplies: VideoReplies, VideoTags: VideoTags, FullScreenVideoCollection: FullScreenVideoCollection }, diff --git a/src/components/CommonComponents/ReplyVideo/index.js b/src/components/CommonComponents/ReplyVideo/index.js index 847b5de6..63f3054f 100644 --- a/src/components/CommonComponents/ReplyVideo/index.js +++ b/src/components/CommonComponents/ReplyVideo/index.js @@ -1,6 +1,7 @@ import React, { PureComponent } from 'react'; import {TouchableOpacity , Image, View, Text} from "react-native"; import { connect } from 'react-redux'; +import {withNavigation} from "react-navigation"; import reduxGetter from '../../../services/ReduxGetters'; import inlineStyles from './styles'; @@ -40,7 +41,7 @@ class ReplyVideo extends PureComponent { }; replyVideo = ()=> { - + this.props.navigation.push('VideoReplies'); }; render(){ @@ -58,4 +59,4 @@ class ReplyVideo extends PureComponent { }; -export default connect(mapStateToProps)(ReplyVideo); +export default connect(mapStateToProps)(withNavigation(ReplyVideo)); diff --git a/src/components/UserVideoHistory/UserVideoHistoryRow.js b/src/components/UserVideoHistory/UserVideoHistoryRow.js index 83e32143..0a39cd95 100644 --- a/src/components/UserVideoHistory/UserVideoHistoryRow.js +++ b/src/components/UserVideoHistory/UserVideoHistoryRow.js @@ -1,5 +1,5 @@ import React, { PureComponent } from 'react'; -import { View, TouchableOpacity, Image } from 'react-native'; +import { View } from 'react-native'; import { withNavigation } from 'react-navigation'; import VideoWrapper from '../Home/VideoWrapper'; import ShareIcon from "../CommonComponents/ShareIcon"; @@ -15,7 +15,6 @@ import ShareVideo from '../../services/shareVideo'; import inlineStyles from './styles'; import utilities from '../../services/Utilities'; -import OptionsIcon from '../../assets/options_self_video.png'; import ReplyVideo from '../CommonComponents/ReplyVideo'; diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js new file mode 100644 index 00000000..793a2992 --- /dev/null +++ b/src/components/VideoReplies/index.js @@ -0,0 +1,273 @@ +import React, { PureComponent } from 'react'; +import { + View, + TouchableWithoutFeedback, + FlatList, + ActivityIndicator, + Text, + Dimensions, + Image, + TouchableOpacity +} from "react-native"; +import {SafeAreaView, withNavigation} from "react-navigation"; +import FastImage from 'react-native-fast-image'; +import LinearGradient from "react-native-linear-gradient"; + +import reduxGetters from "../../services/ReduxGetters"; +import AppConfig from "../../constants/AppConfig"; +import Pricer from '../../services/Pricer'; +import Pagination from "../../services/Pagination"; +import {fetchUser} from "../../helpers/helpers"; +import multipleClickHandler from '../../services/MultipleClickHandler'; +import plusIcon from '../../assets/user-video-capture-icon-selected.png'; +import inlineStyles from './styles'; +import pepoWhiteIcon from '../../assets/pepo-white-icon.png' +import CurrentUser from "../../models/CurrentUser"; +import DeleteVideo from "../../components/CommonComponents/DeleteVideo"; +import Colors from '../../theme/styles/Colors'; +import crossIcon from '../../assets/cross_icon.png'; + +const HeaderLeft = (props) => { + return ( + { + props.navigation.goBack(); + }} + style={inlineStyles.crossIconWrapper} + > + + + ); + }; + + const HeaderRight = (props) => { + return ({ + props.navigation.push('CaptureVideo') + }} style={inlineStyles.crossIconWrapper} > + + ) + }; + + const HeaderTitle = (props) => { + return ( + + + Replies to Frankie + + Send a reply with Pepo5 + + ); + }; + +class VideoReplyFlatList extends PureComponent { + static navigationOptions = (props) => { + return { + headerStyle: inlineStyles.headerStyles, + headerLeft: , + headerRight: , + headerTitle: + }; + }; + + constructor(props){ + super(props); + this.videoReplyPagination = new Pagination( this._fetchUrlVideoHistory() ); + this.paginationEvent = this.videoReplyPagination.event; + + this.state = { + list : this.videoReplyPagination.getList(), + refreshing : false, + loadingNext: false + } + this.listRef = null ; + } + + componentDidMount(){ + this.paginationEvent.on("onBeforeRefresh" , this.beforeRefresh.bind(this) ); + this.paginationEvent.on("onRefresh" , this.onRefresh.bind(this) ); + this.paginationEvent.on("onRefreshError" , this.onRefreshError.bind(this)); + this.paginationEvent.on("onBeforeNext" , this.beforeNext.bind(this)); + this.paginationEvent.on("onNext" , this.onNext.bind(this) ); + this.paginationEvent.on("onNextError" , this.onNextError.bind(this)); + if( this.props.refreshEvent) { + this.props.refreshEvent.on("refresh" , ()=> { + this.listRef.scrollToOffset({offset: 0}); + this.refresh(); + }); + } + this.videoReplyPagination.initPagination(); + } + + componentWillUnmount(){ + this.paginationEvent.removeListener('onBeforeRefresh'); + this.paginationEvent.removeListener('onRefresh'); + this.paginationEvent.removeListener('onRefreshError'); + this.paginationEvent.removeListener('onBeforeNext'); + this.paginationEvent.removeListener('onNext'); + this.paginationEvent.removeListener('onNextError'); + if( this.props.refreshEvent) { + this.props.refreshEvent.removeListener("refresh"); + } + } + + _fetchUrlVideoHistory(){ + return `/users/${this.props.userId}/video-history` ; + } + + getVideoBtAmount(videoId){ + return Pricer.displayAmountWithKFomatter( Pricer.getFromDecimal( reduxGetters.getVideoBt(videoId) ) ) ; + } + + onPullToRefresh = () => { + fetchUser(this.props.userId , this.onUserFetch ); + } + + onUserFetch =(res) => { + this.props.onUserFetch && this.props.onUserFetch(res); + } + + beforeRefresh = ( ) => { + this.props.beforeRefresh && this.props.beforeRefresh(); + this.onPullToRefresh(); + this.setState({ refreshing : true }); + } + + onRefresh = ( res ) => { + const list = this.videoReplyPagination.getList() ; + this.props.onRefresh && this.props.onRefresh( list , res ); + this.setState({ refreshing : false , list : list }); + } + + onRefreshError = ( error ) => { + this.setState({ refreshing : false }); + } + + beforeNext =() => { + this.setState({ loadingNext : true }); + } + + onNext = ( res ) => { + this.setState({ loadingNext : false , list : this.videoReplyPagination.getList() }); + } + + onNextError = ( error ) => { + this.setState({ loadingNext : false }); + } + + getNext = () => { + this.videoReplyPagination.getNext(); + } + + refresh = () => { + this.videoReplyPagination.refresh(); + } + + isCurrentUser = () => { + return this.props.userId === CurrentUser.getUserId(); + } + + removeVideo = (videoId, index) => { + if (index > -1) { + this.videoReplyPagination.deleteItem(videoId , "payload.video_id"); + let array = [...this.state.list]; // make a separate copy of the array + array.splice(index, 1); + this.setState({list: array}); + this.props.onDelete(array); + } + } + + _keyExtractor = (item, index) => `id_${item}`; + + _renderItem = ({ item, index }) => { + const videoId = reduxGetters.getUserVideoId(item), + imageUrl = reduxGetters.getVideoImgUrl( videoId, null , AppConfig.userVideos.userScreenCoverImageWidth ) ; + return ( + { this.onVideoClick( item, index ); } )} + > + + + + + { this.isCurrentUser() && + {this.removeVideo(videoId , index )}} /> + } + + + + + {this.getVideoBtAmount(videoId)} + + + + + + ); + }; + + renderFooter = () => { + if (!this.state.loadingNext) return null; + return ; + }; + + onVideoClick = ( item, index ) => { + const clonedInstance = this.videoReplyPagination.fetchServices.cloneInstance(); + this.props.navigation.push("UserVideoHistory", { + fetchServices : clonedInstance, + currentIndex: index, + userId: this.props.userId + }); + } + + listHeaderComponent = () => { + return ( + + {this.props.listHeaderComponent} + {this.state.list.length > 0 && this.props.listHeaderSubComponent } + + ) + } + + render(){ + return( + + {this.listRef = ref } } + ListHeaderComponent={this.listHeaderComponent()} + data={this.state.list} + onEndReached={this.getNext} + onRefresh={this.refresh} + keyExtractor={this._keyExtractor} + refreshing={this.state.refreshing} + onEndReachedThreshold={9} + renderItem={this._renderItem} + ListFooterComponent={this.renderFooter} + numColumns={2} + /> + + ); + } + +} + +export default withNavigation( VideoReplyFlatList ); diff --git a/src/components/VideoReplies/styles.js b/src/components/VideoReplies/styles.js new file mode 100644 index 00000000..197ee159 --- /dev/null +++ b/src/components/VideoReplies/styles.js @@ -0,0 +1,18 @@ +import DefaultStyleGenerator from '../../theme/styles/DefaultStyleGenerator'; +import Colors from '../../theme/styles/Colors'; + +let stylesMap = { + iconWrapper: { + flex: 1, + alignItems: 'center', + justifyContent: 'center', + height: 60, + width: 60 + }, + crossIconSkipFont: { + height: 20, + width: 20 + } +}; + +export default styles = DefaultStyleGenerator.generate(stylesMap); From 8311c6e1cfbf4b75ce1a485740144eb1f01631ab Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Thu, 7 Nov 2019 20:33:04 +0530 Subject: [PATCH 003/302] code changes --- RootNavigationContainer.js | 9 +- .../CommonComponents/ReplyVideo/index.js | 2 +- src/components/VideoReplies/VideoReplyList.js | 208 ++++++++++++++++++ src/components/VideoReplies/index.js | 15 +- src/components/VideoReplies/styles.js | 137 +++++++++++- 5 files changed, 361 insertions(+), 10 deletions(-) create mode 100644 src/components/VideoReplies/VideoReplyList.js diff --git a/RootNavigationContainer.js b/RootNavigationContainer.js index e8c0e626..6ae61be2 100644 --- a/RootNavigationContainer.js +++ b/RootNavigationContainer.js @@ -57,6 +57,7 @@ import RedemptiomScreen from './src/components/Redemption'; import VideoTags from './src/components/VideoTags'; import FullScreenVideoCollection from './src/components/FullScreenVideoCollection'; import VideoReplies from './src/components/VideoReplies'; +import VideoReplyList from './src/components/VideoReplies/VideoReplyList'; const customTabHiddenRoutes = [ 'CaptureVideo', @@ -64,7 +65,9 @@ const customTabHiddenRoutes = [ 'InviteCodeScreen', 'AddEmailScreen', 'InAppBrowserComponent', - 'CouchMarks' + 'CouchMarks', + 'VideoReplies', + 'VideoReplyList' ]; const modalStackConfig = { @@ -134,6 +137,7 @@ const HomePushStack = createStackNavigator( UsersProfileScreen: UsersProfileScreen, UserVideoHistory: UserVideoHistory, VideoReplies: VideoReplies, + VideoReplyList: VideoReplyList, SupportingListScreen: SupportingListScreen, SupportersListScreen: SupportersListScreen, VideoTags: VideoTags, @@ -168,6 +172,7 @@ const NotificationPushStack = createStackNavigator( UsersProfileScreen: UsersProfileScreen, UserVideoHistory: UserVideoHistory, VideoReplies: VideoReplies, + VideoReplyList: VideoReplyList, VideoPlayer: VideoPlayer, SupportingListScreen: SupportingListScreen, SupportersListScreen: SupportersListScreen, @@ -196,6 +201,7 @@ const ProfilePushStack = createStackNavigator( ProfileScreen: ProfileScreen, UserVideoHistory: UserVideoHistory, VideoReplies: VideoReplies, + VideoReplyList: VideoReplyList, SupportingListScreen: SupportingListScreen, SupportersListScreen: SupportersListScreen, UsersProfileScreen: UsersProfileScreen, @@ -247,6 +253,7 @@ const SearchPushStack = createStackNavigator( SupportersListScreen: SupportersListScreen, UserVideoHistory: UserVideoHistory, VideoReplies: VideoReplies, + VideoReplyList: VideoReplyList, VideoTags: VideoTags, FullScreenVideoCollection: FullScreenVideoCollection }, diff --git a/src/components/CommonComponents/ReplyVideo/index.js b/src/components/CommonComponents/ReplyVideo/index.js index 63f3054f..a518c584 100644 --- a/src/components/CommonComponents/ReplyVideo/index.js +++ b/src/components/CommonComponents/ReplyVideo/index.js @@ -41,7 +41,7 @@ class ReplyVideo extends PureComponent { }; replyVideo = ()=> { - this.props.navigation.push('VideoReplies'); + this.props.navigation.push('VideoReplies',{'userId': this.props.userId }); }; render(){ diff --git a/src/components/VideoReplies/VideoReplyList.js b/src/components/VideoReplies/VideoReplyList.js new file mode 100644 index 00000000..36b181d0 --- /dev/null +++ b/src/components/VideoReplies/VideoReplyList.js @@ -0,0 +1,208 @@ +import React , {PureComponent} from "react"; +import {FlatList , View , TouchableOpacity, Image} from "react-native"; +import deepGet from "lodash/get"; +import reduxGetters from "../../services/ReduxGetters"; +import Pagination from "../../services/Pagination"; + +import UserVideoHistoryRow from "../UserVideoHistory/UserVideoHistoryRow"; +import TopStatus from "../../components/Home/TopStatus"; + +import inlineStyles from "./styles"; +import CurrentUser from "../../models/CurrentUser"; + +import historyBack from '../../assets/user-video-history-back-icon.png'; + +const maxVideosThreshold = 3; + +class VideoReplyList extends PureComponent{ + + static navigationOptions = (options) => { + return { + headerBackTitle: null, + header: null + }; + }; + + constructor(props){ + super(props); + this.userId = this.props.navigation.getParam("userId"); + this.videoHistoryPagination = new Pagination( this._fetchUrlVideoHistory(), {} , this.props.navigation.getParam("fetchServices")); + this.paginationEvent = this.videoHistoryPagination.event; + this.currentIndex = this.props.navigation.getParam("currentIndex"); + this.isScrolled = false ; + this.willFocusSubscription = null ; + this.flatlistRef = null; + + this.state = { + list : this.videoHistoryPagination.getList(), + activeIndex: this.currentIndex, + refreshing : false, + loadingNext: false + }; + this.isActiveScreen = true; + } + + _fetchUrlVideoHistory(){ + return `/users/${this.userId}/video-history` ; + } + + componentDidMount(){ + this.paginationEvent.on("onBeforeRefresh" , this.beforeRefresh.bind(this) ); + this.paginationEvent.on("onRefresh" , this.onRefresh.bind(this) ); + this.paginationEvent.on("onRefreshError" , this.onRefreshError.bind(this) ); + this.paginationEvent.on("onBeforeNext" , this.beforeNext.bind(this) ); + this.paginationEvent.on("onNext" , this.onNext.bind(this) ); + this.paginationEvent.on("onNextError" , this.onNextError.bind(this) ); + + //This is an hack for reset scroll for flatlist. Need to debug a bit more. + this.willFocusSubscription = this.props.navigation.addListener('willFocus', (payload) => { + const offset = this.state.activeIndex > 0 ? inlineStyles.fullScreen.height * this.state.activeIndex : 0 ; + this.flatlistRef && this.flatlistRef.scrollToOffset({offset: offset , animated: false}); + this.isActiveScreen = true ; + }); + + this.willBlurSubscription = this.props.navigation.addListener('willBlur', (payload) => { + this.isActiveScreen = false ; + }); + } + + componentWillUnmount(){ + this.paginationEvent.removeListener('onBeforeRefresh'); + this.paginationEvent.removeListener('onRefresh'); + this.paginationEvent.removeListener('onRefreshError'); + this.paginationEvent.removeListener('onBeforeNext'); + this.paginationEvent.removeListener('onNext'); + this.paginationEvent.removeListener('onNextError'); + this.willFocusSubscription && this.willFocusSubscription.remove(); + this.willBlurSubscription && this.willBlurSubscription.remove(); + } + + shouldPlay = () => { + return this.isActiveScreen; + }; + + beforeRefresh = ( ) => { + this.setState({ refreshing : true }); + } + + onRefresh = ( res ) => { + this.setState({ refreshing : false , list : this.videoHistoryPagination.getList() }); + } + + onRefreshError = ( error ) => { + this.setState({ refreshing : false }); + } + + beforeNext =() => { + this.isScrolled = false; + this.setState({ loadingNext : true }); + } + + onNext = ( res ) => { + this.setState({ loadingNext : false , list : this.videoHistoryPagination.getList() }); + } + + onNextError = ( error ) => { + this.setState({ loadingNext : false }); + } + + getNext = () => { + if(!this.isScrolled) return; + this.videoHistoryPagination.getNext(); + } + + refresh = () => { + this.videoHistoryPagination.refresh(); + } + + _keyExtractor = (item, index) => { + return `id_${item}`; + }; + + _renderItem = ({ item, index }) => { + const videoId = reduxGetters.getUserVideoId(item) ; + return ; + }; + + onViewableItemsChanged = (data) => { + this.currentIndex = deepGet(data, 'viewableItems[0].index') || 0; + } + + setActiveIndex() { + this.setState({ activeIndex: this.currentIndex }); + } + + onMomentumScrollEndCallback = () => { + this.setActiveIndex(); + }; + + onMomentumScrollBeginCallback = () => { + this.isScrolled = true; + } + + onScrollToIndexFailed =( info) => { + console.log("======onScrollToIndexFailed=====" , info ); + } + + getItemLayout= (data, index) => { + return {length: inlineStyles.fullScreen.height, offset: inlineStyles.fullScreen.height * index, index} ; + } + + isCurrentUser(){ + return this.userId == CurrentUser.getUserId(); + } + + closeVideo = () => { + this.navigateBack(); + }; + + navigateBack() { + this.props.navigation.goBack(); + } + + onScrollToTop = () => { + this.setActiveIndex(); + } + + render() { + + return( + + {!this.isCurrentUser() && } + {this.flatlistRef = ref }} + onEndReachedThreshold={7} + onViewableItemsChanged={this.onViewableItemsChanged} + onMomentumScrollEnd={this.onMomentumScrollEndCallback} + onMomentumScrollBegin={this.onMomentumScrollBeginCallback} + renderItem={this._renderItem} + style={[inlineStyles.fullScreen , {backgroundColor: "#000"}]} + showsVerticalScrollIndicator={false} + onScrollToTop={this.onScrollToTop} + + initialScrollIndex={this.state.activeIndex} + getItemLayout={this.getItemLayout} + onScrollToIndexFailed={this.onScrollToIndexFailed} + /> + + + + + ); + } + +} + +export default VideoReplyList ; diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index 793a2992..51b5d876 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -9,7 +9,7 @@ import { Image, TouchableOpacity } from "react-native"; -import {SafeAreaView, withNavigation} from "react-navigation"; +import {SafeAreaView} from "react-navigation"; import FastImage from 'react-native-fast-image'; import LinearGradient from "react-native-linear-gradient"; @@ -59,7 +59,7 @@ const HeaderLeft = (props) => { ); }; -class VideoReplyFlatList extends PureComponent { +class VideoRepliesScreen extends PureComponent { static navigationOptions = (props) => { return { headerStyle: inlineStyles.headerStyles, @@ -71,7 +71,7 @@ class VideoReplyFlatList extends PureComponent { constructor(props){ super(props); - this.videoReplyPagination = new Pagination( this._fetchUrlVideoHistory() ); + this.videoReplyPagination = new Pagination( this._fetchUrlVideoReplies() ); this.paginationEvent = this.videoReplyPagination.event; this.state = { @@ -110,8 +110,9 @@ class VideoReplyFlatList extends PureComponent { } } - _fetchUrlVideoHistory(){ - return `/users/${this.props.userId}/video-history` ; + _fetchUrlVideoReplies(){ + const userId = this.props.navigation.getParam('userId'); + return `/users/${userId}/video-history`; } getVideoBtAmount(videoId){ @@ -232,7 +233,7 @@ class VideoReplyFlatList extends PureComponent { onVideoClick = ( item, index ) => { const clonedInstance = this.videoReplyPagination.fetchServices.cloneInstance(); - this.props.navigation.push("UserVideoHistory", { + this.props.navigation.push("VideoReplyList", { fetchServices : clonedInstance, currentIndex: index, userId: this.props.userId @@ -270,4 +271,4 @@ class VideoReplyFlatList extends PureComponent { } -export default withNavigation( VideoReplyFlatList ); +export default VideoRepliesScreen; diff --git a/src/components/VideoReplies/styles.js b/src/components/VideoReplies/styles.js index 197ee159..243d60dc 100644 --- a/src/components/VideoReplies/styles.js +++ b/src/components/VideoReplies/styles.js @@ -1,5 +1,17 @@ +import { Dimensions, StatusBar, NativeModules } from 'react-native'; + import DefaultStyleGenerator from '../../theme/styles/DefaultStyleGenerator'; import Colors from '../../theme/styles/Colors'; +import { ifIphoneX, getBottomSpace } from 'react-native-iphone-x-helper'; +import { CUSTOM_TAB_Height } from '../../theme/constants'; +import NotchHelper from "../../helpers/NotchHelper"; + +const {width, height} = Dimensions.get('window'); +const statusBarHeight = StatusBar.currentHeight; + +let RNDeviceInfo = NativeModules.RNDeviceInfo; +let modalDeviceName = RNDeviceInfo.model === "Redmi Note 7 Pro" && RNDeviceInfo.brand === "xiaomi"; +let btmSpace = modalDeviceName ? 5 : 0; let stylesMap = { iconWrapper: { @@ -12,7 +24,130 @@ let stylesMap = { crossIconSkipFont: { height: 20, width: 20 + }, + videoStatsContainer: { + padding: 5, + flexDirection: 'row', + alignItems: 'center', + width: '100%' + }, + deleteButton: { + height: 24, + width: 40, + justifyContent: 'center', + alignItems: 'center' + }, + videoStatsTxt: { + color: Colors.white, + fontSize: 16, + fontFamily: 'AvenirNext-Regular', + marginLeft: 2 + }, + fullScreen: { + width: width, + ...ifIphoneX( + { + height: height - CUSTOM_TAB_Height - getBottomSpace([true]) + }, + { + height: + NotchHelper.hasNotch() + ? height + statusBarHeight - CUSTOM_TAB_Height - btmSpace + : height - CUSTOM_TAB_Height + } + ) + }, + fullHeightWidth: { + width: "100%", + height: "100%" + }, + touchablesBtns: { + alignSelf: 'flex-end', + marginBottom: -15, + zIndex: 1 + }, + pepoTxCount: { + fontSize: 18, + color: Colors.white, + alignSelf: 'center', + marginTop: 3, + marginBottom: 15 + }, + txElem: { + marginBottom: 20 + }, + bottomContainer: { + width: width, + position: 'absolute', + bottom: 0 + }, + bottomBg: { + backgroundColor: 'rgba(0, 0, 0, 0.6)', + borderTopLeftRadius: 20, + minHeight: height * 0.05, + paddingHorizontal: 12 + }, + handle: { + fontSize: 15, + paddingBottom: 3, + color: Colors.white, + fontFamily: 'AvenirNext-DemiBold', + fontWeight: '700' + }, + bottomBgTxt: { + color: Colors.white + }, + raisedSupported: { + backgroundColor: Colors.wildWatermelon2, + borderTopLeftRadius: 25, + borderBottomRightRadius: 25, + paddingHorizontal: 8, + minWidth: 120, + height: 40, + alignItems: 'center', + justifyContent: 'center', + marginRight: 10 + }, + raisedSupportedTxt: { + color: Colors.white, + fontSize: 14, + fontFamily: 'AvenirNext-DemiBold' + }, + btnText: { + color: Colors.white + }, + playIconSkipFont: { + position: 'absolute', + height: 25, + width: 25, + top: height * 0.5 - 12, + left: width * 0.5 - 12 + }, + historyBackSkipFont:{ + ...ifIphoneX({ + top: 55, + }, { + top: 25, + }), + width: 29, + height: 34, + position: 'absolute', + left: 10, + alignItems: 'center', + justifyContent: 'center' + }, + optionsIconSkipFont:{ + ...ifIphoneX({ + top: 70, + }, { + top: 40, + }), + position: 'absolute', + right: 10, + height :10, + width:23, + zIndex: 1, } }; -export default styles = DefaultStyleGenerator.generate(stylesMap); +export default styles = DefaultStyleGenerator.generate(stylesMap); \ No newline at end of file From d0e795ecdf906c94a6a6a397b05bb7cadf0ec35e Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Fri, 8 Nov 2019 12:58:49 +0530 Subject: [PATCH 004/302] code changes --- src/components/UserVideoHistory/UserVideoHistoryRow.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/UserVideoHistory/UserVideoHistoryRow.js b/src/components/UserVideoHistory/UserVideoHistoryRow.js index 0a39cd95..af06a254 100644 --- a/src/components/UserVideoHistory/UserVideoHistoryRow.js +++ b/src/components/UserVideoHistory/UserVideoHistoryRow.js @@ -84,7 +84,7 @@ class UserVideoHistoryRow extends PureComponent { userId={this.props.userId} videoId={this.props.videoId} /> - + From 4a531aeae670811fe87ebd9e64d9bdb723dd2a36 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Fri, 8 Nov 2019 15:36:25 +0530 Subject: [PATCH 005/302] integrate with backend api for video reply icon --- src/components/CommonComponents/ReplyVideo/index.js | 5 +++-- src/services/ReduxGetters.js | 9 +++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/components/CommonComponents/ReplyVideo/index.js b/src/components/CommonComponents/ReplyVideo/index.js index a518c584..5ef35746 100644 --- a/src/components/CommonComponents/ReplyVideo/index.js +++ b/src/components/CommonComponents/ReplyVideo/index.js @@ -18,7 +18,8 @@ const mapStateToProps = (state , ownProps) => { isCurrentUserActivated : CurrentUser.isUserActivated(), balance : state.balance, requiredPepo : reduxGetter.getVideoReplyAmount(ownProps.videoId, state), - videoReplyCount : reduxGetter.getVideoReplyCount(ownProps.videoId, state) + videoReplyCount : reduxGetter.getVideoReplyCount(ownProps.videoId, state), + isReplyAllowed : reduxGetter.getVideoReplyAllowed(ownProps.videoId, state) } }; @@ -29,7 +30,7 @@ class ReplyVideo extends PureComponent { }; isDisabled = () => { - return this.props.isCreatorApproved != 1 || !this.props.isVideoUserActivated || !this.props.isCurrentUserActivated || !this.hasSufficientBalance(); + return !this.props.isReplyAllowed || this.props.isCreatorApproved != 1 || !this.props.isVideoUserActivated || !this.props.isCurrentUserActivated || !this.hasSufficientBalance(); }; hasSufficientBalance = () => { diff --git a/src/services/ReduxGetters.js b/src/services/ReduxGetters.js index 35acbd9f..9ee6f4d2 100644 --- a/src/services/ReduxGetters.js +++ b/src/services/ReduxGetters.js @@ -425,12 +425,17 @@ class ReduxGetters { getVideoReplyCount(id, state){ state = state || Store.getState(); - return deepGet(state, `video_stat_entities.id_${id}.reply_count`, 0); + return deepGet(state, `video_stat_entities.id_${id}.total_replies`, 0); } getVideoReplyAmount(id, state){ state = state || Store.getState(); - return deepGet(state, `video_stat_entities.id_${id}.reply_amount`, 0); + return deepGet(state, `video_stat_entities.id_${id}.per_reply_amount_in_wei`, 0); + } + + getVideoReplyAllowed(id, state){ + state = state || Store.getState(); + return deepGet(state, `video_stat_entities.id_${id}.is_reply_allowed`, 0); } } From 903578c249c30ae5f988ba4c979c1609dfe58c15 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Fri, 8 Nov 2019 16:58:35 +0530 Subject: [PATCH 006/302] code changes --- src/components/CommonComponents/ReplyVideo/index.js | 2 +- src/components/FullScreenVideoCollection/FullScreeVideoRow.js | 4 ---- src/components/VideoCollections/index.js | 2 -- src/services/ReduxGetters.js | 2 +- 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/components/CommonComponents/ReplyVideo/index.js b/src/components/CommonComponents/ReplyVideo/index.js index 5ef35746..b9b272fe 100644 --- a/src/components/CommonComponents/ReplyVideo/index.js +++ b/src/components/CommonComponents/ReplyVideo/index.js @@ -42,7 +42,7 @@ class ReplyVideo extends PureComponent { }; replyVideo = ()=> { - this.props.navigation.push('VideoReplies',{'userId': this.props.userId }); + this.props.navigation.push('VideoReplies',{'videoId': this.props.videoId , 'userId': this.props.userId}); }; render(){ diff --git a/src/components/FullScreenVideoCollection/FullScreeVideoRow.js b/src/components/FullScreenVideoCollection/FullScreeVideoRow.js index 41bc2e97..c960e7b9 100644 --- a/src/components/FullScreenVideoCollection/FullScreeVideoRow.js +++ b/src/components/FullScreenVideoCollection/FullScreeVideoRow.js @@ -22,12 +22,8 @@ import ReplyVideo from '../CommonComponents/ReplyVideo'; class FullScreeVideoRow extends PureComponent { constructor(props) { super(props); - console.log("this.props", this.props); this.userId = deepGet(this.props.payload, 'user_id'); this.videoId = deepGet(this.props.payload, 'video_id'); - - - } refetchVideo = () => { diff --git a/src/components/VideoCollections/index.js b/src/components/VideoCollections/index.js index 319099c9..d92aee0c 100644 --- a/src/components/VideoCollections/index.js +++ b/src/components/VideoCollections/index.js @@ -199,8 +199,6 @@ class VideoCollections extends PureComponent { this.listRef.scrollToOffset({offset: 0}); } - - setListRef = (listRef) => { this.listRef = listRef; }; diff --git a/src/services/ReduxGetters.js b/src/services/ReduxGetters.js index 9ee6f4d2..0493ea24 100644 --- a/src/services/ReduxGetters.js +++ b/src/services/ReduxGetters.js @@ -435,7 +435,7 @@ class ReduxGetters { getVideoReplyAllowed(id, state){ state = state || Store.getState(); - return deepGet(state, `video_stat_entities.id_${id}.is_reply_allowed`, 0); + return deepGet(state, `video_stat_entities.id_${id}.is_reply_allowed`, true); } } From f6aeabc37ea01a2462d9f21a74bfb2db5f92a595 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Fri, 8 Nov 2019 17:01:27 +0530 Subject: [PATCH 007/302] minor changes --- src/components/VideoReplies/index.js | 14 +++++++------- src/components/VideoReplies/styles.js | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index 51b5d876..84eaa971 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -33,9 +33,9 @@ const HeaderLeft = (props) => { onPress={() => { props.navigation.goBack(); }} - style={inlineStyles.crossIconWrapper} + style={inlineStyles.iconWrapper} > - + ); }; @@ -43,8 +43,8 @@ const HeaderLeft = (props) => { const HeaderRight = (props) => { return ({ props.navigation.push('CaptureVideo') - }} style={inlineStyles.crossIconWrapper} > - + }} style={inlineStyles.iconWrapper} > + ) }; @@ -188,7 +188,7 @@ class VideoRepliesScreen extends PureComponent { { this.isCurrentUser() && {this.removeVideo(videoId , index )}} /> @@ -213,7 +213,7 @@ class VideoRepliesScreen extends PureComponent { locations={[0, 0.5, 1]} start={{ x: 0, y: 0 }} end={{ x: 0, y: 1 }} - style={{width: (Dimensions.get('window').width - 6) / 3, margin: 1, position: 'absolute', bottom: 0, left: 0}} + style={{width: (Dimensions.get('window').width - 6) / 2, margin: 1, position: 'absolute', bottom: 0, left: 0}} > diff --git a/src/components/VideoReplies/styles.js b/src/components/VideoReplies/styles.js index 243d60dc..1839bb91 100644 --- a/src/components/VideoReplies/styles.js +++ b/src/components/VideoReplies/styles.js @@ -21,7 +21,7 @@ let stylesMap = { height: 60, width: 60 }, - crossIconSkipFont: { + iconSkipFont: { height: 20, width: 20 }, From 792badca52c961f3be4e365c817febe56555dabf Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Fri, 8 Nov 2019 19:17:25 +0530 Subject: [PATCH 008/302] Mentions UI --- src/components/Bio/index.js | 12 +- src/components/Bio/style.js | 22 +++- .../CommonComponents/TagsInput/index.js | 103 ++++++++++++------ .../FanVideoDetails/VideoDescription.js | 6 +- src/components/FanVideoDetails/VideoLink.js | 2 +- src/components/FanVideoDetails/index.js | 9 +- src/components/FanVideoDetails/styles.js | 18 ++- 7 files changed, 115 insertions(+), 57 deletions(-) diff --git a/src/components/Bio/index.js b/src/components/Bio/index.js index c268dfaa..9816e5a4 100644 --- a/src/components/Bio/index.js +++ b/src/components/Bio/index.js @@ -1,5 +1,5 @@ import React, { PureComponent } from 'react'; -import { View, Text, ScrollView } from 'react-native'; +import {View, Text} from 'react-native'; import { withNavigation } from 'react-navigation'; import BackArrow from '../CommonComponents/BackArrow'; @@ -51,8 +51,9 @@ class BioScreen extends PureComponent { render() { return ( - + - {this.state.count} /300 - - + /> + {this.state.count} /300 + ); } } diff --git a/src/components/Bio/style.js b/src/components/Bio/style.js index 792eb83a..97e8d038 100644 --- a/src/components/Bio/style.js +++ b/src/components/Bio/style.js @@ -5,18 +5,32 @@ let stylesMap = { multilineTextInput:{ height : 100 , textAlignVertical:'top', - paddingTop:20 + padding: 15, + paddingTop: 15, + marginTop: 0 }, suggestionText:{ - fontWeight:"normal", + fontFamily: 'AvenirNext-Regular', color:Colors.midNightblue, - fontSize:18 + fontSize:16 + }, + dropDownStyle: { + width: '100%', + shadowColor: '#000', + shadowOffset: { + width: 0, + height: 1 + }, + shadowOpacity: 0.2, + shadowRadius: 1.5, + elevation: 1 }, suggestionTextWrapper : { - marginTop:20 + marginVertical: 9 }, countStyle:{ fontSize:10, + marginTop: 5, textAlign:'right' } }; diff --git a/src/components/CommonComponents/TagsInput/index.js b/src/components/CommonComponents/TagsInput/index.js index b300f45c..63878530 100644 --- a/src/components/CommonComponents/TagsInput/index.js +++ b/src/components/CommonComponents/TagsInput/index.js @@ -1,8 +1,10 @@ import React, { PureComponent } from 'react'; -import { TouchableOpacity, FlatList } from 'react-native'; +import {TouchableOpacity, FlatList, View, Dimensions} from 'react-native'; import PepoApi from '../../../services/PepoApi'; import CustomTextInput from './CustomTextInput'; +import ReduxGetters from '../../../services/ReduxGetters'; +import deepGet from 'lodash/get'; class TagsInput extends PureComponent { constructor(props) { @@ -33,6 +35,20 @@ class TagsInput extends PureComponent { }, 300); }; + fetchMentions = (keyword) => { + clearTimeout(this.reqTimer); + const reqParam = keyword.substr(1); + this.reqTimer = setTimeout(() => { + if (!reqParam) return; + new PepoApi('/search/at-mention') + .get('q=' + reqParam) + .then((res) => { + this.openSuggestionsPanel(res); + }) + .catch((error) => {}); + }, 300); + }; + getWordAtIndex(str, pos) { // Perform type conversions. str = String(str); @@ -55,18 +71,21 @@ class TagsInput extends PureComponent { currentIndexChar = val.charAt(location), isValidChar = this.isValidChar(currentIndexChar), wordAtIndex = this.getWordAtIndex(val, location), - isHashTag = this.isHashTag(wordAtIndex); - if (isValidChar && isHashTag) { + isHashTag = this.isHashTag(wordAtIndex), + isMention = this.isMention(wordAtIndex); + if (isValidChar && isHashTag || isMention) { this.wordIndex = location; this.indexWord = wordAtIndex; this.startTracking(); - this.fetchHashTags(wordAtIndex); + isHashTag && this.fetchHashTags(wordAtIndex); + isMention && this.fetchMentions(wordAtIndex); } else { this.closeSuggestionsPanel(); } this.changeValue(val); }; + setCustomInputRef = ( ref )=> { this.customTextInputRef = ref; } @@ -80,9 +99,17 @@ class TagsInput extends PureComponent { }; isHashTag(val) { - const hastagRegex = /(?:\s|^)#[A-Za-z0-9\-\.\_]+(?:\s|$)/g; - return hastagRegex.test(val); - } + const hastagRegex = /(?:\s|^)#[A-Za-z0-9\-\.\_]+(?:\s|$)/g; + return hastagRegex.test(val); + }; + + isMention(val){ + if(this.props.mentions && this.props.mentions.includes("@")) { + const mentionRegex = /(?:\s|^)@[A-Za-z0-9\-\.\_]+(?:\s|$)/g; + return mentionRegex.test(val); + } + return false; + }; isValidChar(val) { const spaceRegex = /\s/g; @@ -121,7 +148,7 @@ class TagsInput extends PureComponent { _renderItem = ({ item }) => { const SearchResultRowComponent = this.props.searchResultRowComponent; return ( - this.onSuggestionTap(item)}> + this.onSuggestionTap(item)} style={{paddingLeft: 8}}> ); @@ -172,34 +199,38 @@ class TagsInput extends PureComponent { render() { return ( - - { - this.props.submitEvent(this.value); - }} - locationGetter={this.locationGetter} - onChangeText={this.onChangeText} - placeholderText={this.props.placeholderText} - autoFocus={this.props.autoFocus} - maxLength={this.props.maxLength} - /> - {this.props.children} - - - } - stickyHeaderIndices={[0]} - /> + + { + this.props.submitEvent(this.value); + }} + locationGetter={this.locationGetter} + onChangeText={this.onChangeText} + placeholderText={this.props.placeholderText} + autoFocus={this.props.autoFocus} + maxLength={this.props.maxLength} + /> + + + + ); } } diff --git a/src/components/FanVideoDetails/VideoDescription.js b/src/components/FanVideoDetails/VideoDescription.js index 8e6f1930..7294bca0 100644 --- a/src/components/FanVideoDetails/VideoDescription.js +++ b/src/components/FanVideoDetails/VideoDescription.js @@ -1,5 +1,5 @@ import React, { PureComponent } from 'react'; -import { View, Text } from 'react-native'; +import {View, Text} from 'react-native'; import inlineStyles from './styles'; import TagsInput from '../CommonComponents/TagsInput'; @@ -23,12 +23,14 @@ class VideoDescription extends PureComponent { horizontal={false} initialValue={this.value} onChangeVal={this.onChangeValue} - placeholderText="Add a description. You can include #tags." + placeholderText="Write something about your video" submitEvent={this.submitEvent} searchResultRowComponent={SearchResultRowComponent} textInputStyles={inlineStyles.videoDescription} + dropdownStyle={inlineStyles.dropDownStyle} maxLength={110} autoFocus={false} + mentions={["#" , "@"]} /> ); diff --git a/src/components/FanVideoDetails/VideoLink.js b/src/components/FanVideoDetails/VideoLink.js index 3dcd20f5..058ac4aa 100644 --- a/src/components/FanVideoDetails/VideoLink.js +++ b/src/components/FanVideoDetails/VideoLink.js @@ -31,7 +31,7 @@ class VideoLink extends Component { ellipsizeMode={'tail'} returnKeyType="done" returnKeyLabel="Done" - placeholder="Add a link (optional)" + placeholder="Add a link to your video" onChangeText={this.onChangeValue} value={this.state.value} autoCapitalize={'none'} diff --git a/src/components/FanVideoDetails/index.js b/src/components/FanVideoDetails/index.js index 6a2de143..2d1afc8f 100644 --- a/src/components/FanVideoDetails/index.js +++ b/src/components/FanVideoDetails/index.js @@ -37,7 +37,7 @@ const mapStateToProps = (state, ownProps) => { class FanVideoDetails extends Component { static navigationOptions = ({ navigation }) => { return { - title: 'Post', + title: 'Details', headerStyle: { backgroundColor: Colors.white, borderBottomWidth: 0, @@ -199,11 +199,12 @@ class FanVideoDetails extends Component { - + + Link - + {this.state.error} { this.enableStartUploadFlag(); })} diff --git a/src/components/FanVideoDetails/styles.js b/src/components/FanVideoDetails/styles.js index d7a9a900..993a8497 100644 --- a/src/components/FanVideoDetails/styles.js +++ b/src/components/FanVideoDetails/styles.js @@ -43,18 +43,28 @@ let stylesMap = { marginLeft: 10, marginTop: 0, padding: 0, + paddingTop: 0, + position: 'relative', paddingLeft: 0, height: 100 }, + dropDownStyle: { + marginLeft: -90, + width: Dimensions.get('window').width, + shadowColor: '#000', + shadowOffset: { width: -1, height: 1 }, + shadowOpacity: 0.2, + elevation: 1 + }, suggestionText: { - fontWeight: 'bold', color: Colors.midNightblue, - fontSize: 18 + fontSize: 16, + fontFamily: 'AvenirNext-Regular' }, suggestionTextWrapper: { - marginTop: 20 + marginVertical: 9 }, - linkText: { color: Colors.softBlue, flex: 1 } + linkText: { color: Colors.softBlue, flex: 3} }; export default styles = DefaultStyleGenerator.generate(stylesMap); From 26315195569798329d5310883a414366537f68ef Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Fri, 8 Nov 2019 20:52:39 +0530 Subject: [PATCH 009/302] reply video entity --- src/components/CaptureVideo/index.js | 108 ++++++++++++- src/components/PreviewRecordedVideo/index.js | 1 - src/components/VideoRecorder/index.js | 157 ++++++++++++------- src/services/Utilities.js | 16 +- 4 files changed, 209 insertions(+), 73 deletions(-) diff --git a/src/components/CaptureVideo/index.js b/src/components/CaptureVideo/index.js index 524b56ba..47b562ea 100644 --- a/src/components/CaptureVideo/index.js +++ b/src/components/CaptureVideo/index.js @@ -2,6 +2,20 @@ import React, { Component } from 'react'; import VideoRecorder from '../VideoRecorder'; import PreviewRecordedVideo from '../PreviewRecordedVideo'; import FanVideoDetails from '../FanVideoDetails'; +import Store from "../../store"; +import {upsertRecordedVideo} from "../../actions"; +import utilities from '../../services/Utilities'; +import CurrentUser from '../../models/CurrentUser'; + + +const VideoTypesConfig = { + 'post' : { + 'type': 'post' + }, + 'reply': { + 'type': 'reply' + } +}; class CaptureVideo extends Component { static navigationOptions = { @@ -14,8 +28,39 @@ class CaptureVideo extends Component { videoUri: '', actionSheetOnRecordVideo: true, modalVisible: true, - acceptedCameraTnC: null + acceptedCameraTnC: null, + showReplyCoachScreen: false }; + this.isVideoTypeReply = null; + this.replyReceiverUserId = null; + this.replyReceiverVideoId = null; + this.amountToSendWithReply = null; + this.videoType = null; + + this.setReplyVideoParams(); + + } + + componentDidMount () { + + if (! this.isVideoTypeReply) { + utilities.getItem(`${CurrentUser.getUserId()}-accepted-camera-t-n-c`).then((terms) => { + this.setState({ acceptedCameraTnC: terms }); + }); + } + + } + + setReplyVideoParams(){ + this.isVideoTypeReply = this.props.navigation.getParam("videoTypeReply"); + if (this.isVideoTypeReply){ + this.replyReceiverUserId = this.props.navigation.getParam("replyReceiverUserId"); + this.replyReceiverVideoId = this.props.navigation.getParam("replyReceiverVideoId"); + this.amountToSendWithReply = this.props.navigation.getParam("amountToSendWithReply"); + this.setState({showReplyCoachScreen: this.props.navigation.getParam("showReplyCoachScreen")}); + } else { + // Do nothing. + } } goToRecordScreen() { @@ -26,15 +71,43 @@ class CaptureVideo extends Component { }); } - goToPreviewScreen(videoUri) { - this.setState({ + + proceedWithExistingVideo(recordedVideoObj) { + this.videoType = recordedVideoObj.video_type || VideoTypesConfig.post.type; + this.setState ({ recordingScreen: false, - videoUri + videoUri: recordedVideoObj.raw_video }); } + saveVideoPrimaryInfo = () => { + if (this.isVideoTypeReply) { + this.videoType = VideoTypesConfig.reply.type; + Store.dispatch(upsertRecordedVideo({ video_type: VideoTypesConfig.reply.type, reply_obj: this.getReplyOptions()})); + } else { + this.videoType = VideoTypesConfig.post.type; + Store.dispatch(upsertRecordedVideo({ video_type: VideoTypesConfig.post.type })); + } + }; + + goToDetailsScreen() { - this.props.navigation.push('FanVideoDetails'); + if (this.videoType === VideoTypesConfig.post.type){ + this.props.navigation.push('FanVideoDetails'); + } else if (this.videoType === VideoTypesConfig.reply.type){ + this.props.navigation.push('FanVideoReplyDetails'); + } + } + + getReplyOptions(){ + // Reply options are received to View when user click on Record video (Plus icon). + let replyOptions = {}; + if ( this.isVideoTypeReply ) { + replyOptions['replyReceiverUserId'] = this.replyReceiverUserId; + replyOptions['replyReceiverVideoId'] = this.replyReceiverVideoId; + replyOptions['amountToSendWithReply']= this.amountToSendWithReply; + } + return replyOptions; } modalRequestClose = () => { @@ -45,6 +118,22 @@ class CaptureVideo extends Component { } }; + getActionSheetText = (videoObject) => { + if (videoObject.video_type === VideoTypesConfig.reply.type){ + return 'get language from UX'; + } else if (videoObject.video_type === VideoTypesConfig.post.type) { + return 'You have already recorded video'; + } + }; + + goToPreviewScreen = (videoUri) => { + this.setState({ + recordingScreen: false, + videoUri + }); + }; + + getCurrentView() { if (this.state.recordingScreen) { return ( @@ -53,11 +142,14 @@ class CaptureVideo extends Component { this.videoRecorder = recorder; }} acceptedCameraTnC={this.state.acceptedCameraTnC} - goToPreviewScreen={(videoUri) => { - this.goToPreviewScreen(videoUri); - }} + proceedWithExistingVideo={this.proceedWithExistingVideo} + saveVideoPrimaryInfo={this.saveVideoPrimaryInfo} + goToPreviewScreen={this.goToPreviewScreen} actionSheetOnRecordVideo={this.state.actionSheetOnRecordVideo} + getActionSheetText={this.getActionSheetText} navigation={this.props.navigation} + isVideoTypeReply={this.isVideoTypeReply} + /> ); } else { diff --git a/src/components/PreviewRecordedVideo/index.js b/src/components/PreviewRecordedVideo/index.js index cfed2368..7f7c5399 100644 --- a/src/components/PreviewRecordedVideo/index.js +++ b/src/components/PreviewRecordedVideo/index.js @@ -102,7 +102,6 @@ class PreviewRecordedVideo extends Component { this.props.goToRecordScreen(); } else if (buttonIndex == ACTION_SHEET_DESCTRUCTIVE_INDEX) { this.props.navigation.goBack(null); - // videoUploaderComponent.emit('hide'); Store.dispatch( upsertRecordedVideo({ do_discard: true diff --git a/src/components/VideoRecorder/index.js b/src/components/VideoRecorder/index.js index 9bedc331..39a59a38 100644 --- a/src/components/VideoRecorder/index.js +++ b/src/components/VideoRecorder/index.js @@ -39,44 +39,56 @@ class VideoRecorder extends Component { progress: 0, recordingInProgress: false, acceptedCameraTnC: this.props.acceptedCameraTnC, - cameraFrontMode: true + cameraFrontMode: true, + isLocalVideoPresent: false }; this.camera = null; - this.recordedVideo = null; + this.recordedVideoObj = reduxGetters.getRecordedVideo(); } _handleAppStateChange = (nextAppState) => { nextAppState === 'background' && this.cancleVideoHandling(); }; + + isStaleReduxObjectPresent(){ + let acceptableKeys = ['reply_obj', 'video_type']; + for (let key in this.recordedVideoObj) { + if (! acceptableKeys.includes(key)){ + return true; + } + } + return false; + } + async componentDidMount() { - if (this.props.acceptedCameraTnC === null) { - utilities.getItem(`${CurrentUser.getUserId()}-accepted-camera-t-n-c`).then((terms) => { - this.setState({ acceptedCameraTnC: terms }); - }); - } + + // if (!this.props.isVideoTypeReply) { + // if (this.props.acceptedCameraTnC === null) { + // utilities.getItem(`${CurrentUser.getUserId()}-accepted-camera-t-n-c`).then((terms) => { + // this.setState({ acceptedCameraTnC: terms }); + // }); + // } + // } + BackHandler.addEventListener('hardwareBackPress', this._handleBackPress); AppState.addEventListener('change', this._handleAppStateChange); if (this.props.actionSheetOnRecordVideo) { - let recordedVideoObj = reduxGetters.getRecordedVideo(); - this.recordedVideo = recordedVideoObj.raw_video; - let isFileExists = false; + let isFileExists = await this.ifLocalVideoPresent(); const oThis = this; - - // this.showActionSheet(); - if (this.recordedVideo) { - isFileExists = await RNFS.exists(this.recordedVideo); - } if (isFileExists) { + this.setState({ isLocalVideoPresent: true }); setTimeout(function() { oThis.showActionSheet(); }, 100); - } else if (Object.keys(recordedVideoObj).length > 0) { + } else if (this.isStaleReduxObjectPresent()) { Store.dispatch( upsertRecordedVideo({ do_discard: true }) ); + } else { + this.props.saveVideoPrimaryInfo(); } } } @@ -85,7 +97,7 @@ class VideoRecorder extends Component { ActionSheet.show( { options: ACTION_SHEET_BUTTONS, - title: 'You have already recorded video' + title: this.props.getActionSheetText(this.recordedVideoObj) }, (buttonIndex) => { if (buttonIndex == ACTION_SHEET_RESHOOT_INDEX) { @@ -98,7 +110,7 @@ class VideoRecorder extends Component { ); } else if (buttonIndex == ACTION_SHEET_CONTINUE_INDEX) { //navigate to previous page - this.props.goToPreviewScreen(this.recordedVideo); + this.props.proceedWithExistingVideo(this.recordedVideoObj); } } ); @@ -129,6 +141,72 @@ class VideoRecorder extends Component { this.setState({ cameraFrontMode: !this.state.cameraFrontMode }); }; + + ifLocalVideoPresent = async () => { + let recordedVideo = this.recordedVideoObj.raw_video; + let isFileExists = false; + if (recordedVideo) { + isFileExists = await RNFS.exists(recordedVideo); + } + return isFileExists; + }; + + + showCoachForPosting = () => { + // If already recorded video present in local, do not show coach. + console.log('showCoachForPosting :::'); + if (this.state.isLocalVideoPresent) return; + + if (this.props.isVideoTypeReply) { + // TODO: return coach for posting + // if (no video reply present) { return Coach } + } else { + if (this.state.acceptedCameraTnC !== 'true'){ + return + + Submit your first video + + + Create a 30 second video update. Share what you're working on, what excites you, or anything on your + mind. + + + + + Approval process + + + The Pepo team will review your first video before it is shared publicly. We'll get in touch with you + ASAP! + + + + + + Get Started + + + + + + + + } + } + }; + cameraView() { return ( @@ -154,48 +232,7 @@ class VideoRecorder extends Component { defaultVideoQuality={RNCamera.Constants.VideoQuality[AppConfig.cameraConstants.VIDEO_QUALITY]} defaultMuted={false} > - {this.state.acceptedCameraTnC != 'true' && ( - - - Submit your first video - - - Create a 30 second video update. Share what you're working on, what excites you, or anything on your - mind. - - - - - Approval process - - - The Pepo team will review your first video before it is shared publicly. We'll get in touch with you - ASAP! - - - - - - Get Started - - - - - - - )} + {this.showCoachForPosting()} {this.showCameraActions()} diff --git a/src/services/Utilities.js b/src/services/Utilities.js index 9d81505b..1a8ef925 100644 --- a/src/services/Utilities.js +++ b/src/services/Utilities.js @@ -25,13 +25,13 @@ os = os.toLowerCase(); let recursiveMaxCount = 0; -let checkVideoPermission = function(navigation) { +let checkVideoPermission = function(navigation, params ) { CameraPermissionsApi.requestPermission('camera').then((cameraResult) => { CameraPermissionsApi.requestPermission('microphone').then((microphoneResult) => { if (cameraResult == 'authorized' && microphoneResult == 'authorized') { console.log('checkVideoPermission:cameraResult', cameraResult); console.log('checkVideoPermission:microphoneResult', microphoneResult); - navigation.navigate('CaptureVideo'); + navigation.navigate('CaptureVideo', params); } else if ( (Platform.OS == 'ios' && (cameraResult == 'denied' || microphoneResult == 'denied')) || cameraResult == 'restricted' || @@ -135,15 +135,23 @@ export default { return this.getLastChildRoutename(routes[index]); }, - handleVideoUploadModal(previousTabIndex, navigation) { + getActiveTab( navigation ){ + if( !navigation ) return ; + let activeIndex = deepGet(navigation , 'state.index'), + route = deepGet(navigation , `state.routes[${activeIndex}]`); + return route && route["routeName"]; + }, + + handleVideoUploadModal(previousTabIndex, navigation, params = {}) { if (reduxGetters.getVideoProcessingStatus() == true && previousTabIndex == 0) { + // TODO: check if video or reply and accordingly emit corresponding event. FlyerEventEmitter.emit('onShowProfileFlyer', { id: 2 }); } else if (reduxGetters.getVideoProcessingStatus() == true) { Toast.show({ text: 'Video uploading in progress.' }); } else { - checkVideoPermission(navigation); + checkVideoPermission(navigation, params); } }, From 13ec739b3511482f4fe6a517167f418bd352b0b1 Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Fri, 8 Nov 2019 20:56:27 +0530 Subject: [PATCH 010/302] reply video entity --- src/components/CaptureVideo/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/CaptureVideo/index.js b/src/components/CaptureVideo/index.js index 47b562ea..afe88ad6 100644 --- a/src/components/CaptureVideo/index.js +++ b/src/components/CaptureVideo/index.js @@ -80,6 +80,7 @@ class CaptureVideo extends Component { }); } + saveVideoPrimaryInfo = () => { if (this.isVideoTypeReply) { this.videoType = VideoTypesConfig.reply.type; From 85c6d0b4f09d847e5978d31fd3b57b64039f722c Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Fri, 8 Nov 2019 21:06:13 +0530 Subject: [PATCH 011/302] code changes --- RootNavigationContainer.js | 12 +- .../CommonComponents/ReplyVideo/index.js | 6 +- .../FullScreenVideoCollection/index.js | 2 +- src/components/Search/index.js | 4 +- src/components/TopsList/index.js | 2 +- src/components/VideoCollections/index.js | 2 +- src/components/VideoReplies/index.js | 331 +++++++++--------- src/components/VideoReplies/styles.js | 150 +------- .../VideoRepliesFullScreen/VideoReply.js | 109 ++++++ .../index.js} | 142 +++++--- .../VideoRepliesFullScreen/styles.js | 118 +++++++ src/components/VideoTags/index.js | 2 +- 12 files changed, 522 insertions(+), 358 deletions(-) create mode 100644 src/components/VideoRepliesFullScreen/VideoReply.js rename src/components/{VideoReplies/VideoReplyList.js => VideoRepliesFullScreen/index.js} (58%) create mode 100644 src/components/VideoRepliesFullScreen/styles.js diff --git a/RootNavigationContainer.js b/RootNavigationContainer.js index 6ae61be2..7b7a11c1 100644 --- a/RootNavigationContainer.js +++ b/RootNavigationContainer.js @@ -57,7 +57,7 @@ import RedemptiomScreen from './src/components/Redemption'; import VideoTags from './src/components/VideoTags'; import FullScreenVideoCollection from './src/components/FullScreenVideoCollection'; import VideoReplies from './src/components/VideoReplies'; -import VideoReplyList from './src/components/VideoReplies/VideoReplyList'; +import VideoRepliesFullScreen from './src/components/VideoRepliesFullScreen'; const customTabHiddenRoutes = [ 'CaptureVideo', @@ -67,7 +67,7 @@ const customTabHiddenRoutes = [ 'InAppBrowserComponent', 'CouchMarks', 'VideoReplies', - 'VideoReplyList' + 'VideoRepliesFullScreen' ]; const modalStackConfig = { @@ -137,7 +137,7 @@ const HomePushStack = createStackNavigator( UsersProfileScreen: UsersProfileScreen, UserVideoHistory: UserVideoHistory, VideoReplies: VideoReplies, - VideoReplyList: VideoReplyList, + VideoRepliesFullScreen: VideoRepliesFullScreen, SupportingListScreen: SupportingListScreen, SupportersListScreen: SupportersListScreen, VideoTags: VideoTags, @@ -172,7 +172,7 @@ const NotificationPushStack = createStackNavigator( UsersProfileScreen: UsersProfileScreen, UserVideoHistory: UserVideoHistory, VideoReplies: VideoReplies, - VideoReplyList: VideoReplyList, + VideoRepliesFullScreen: VideoRepliesFullScreen, VideoPlayer: VideoPlayer, SupportingListScreen: SupportingListScreen, SupportersListScreen: SupportersListScreen, @@ -201,7 +201,7 @@ const ProfilePushStack = createStackNavigator( ProfileScreen: ProfileScreen, UserVideoHistory: UserVideoHistory, VideoReplies: VideoReplies, - VideoReplyList: VideoReplyList, + VideoRepliesFullScreen: VideoRepliesFullScreen, SupportingListScreen: SupportingListScreen, SupportersListScreen: SupportersListScreen, UsersProfileScreen: UsersProfileScreen, @@ -253,7 +253,7 @@ const SearchPushStack = createStackNavigator( SupportersListScreen: SupportersListScreen, UserVideoHistory: UserVideoHistory, VideoReplies: VideoReplies, - VideoReplyList: VideoReplyList, + VideoRepliesFullScreen: VideoRepliesFullScreen, VideoTags: VideoTags, FullScreenVideoCollection: FullScreenVideoCollection }, diff --git a/src/components/CommonComponents/ReplyVideo/index.js b/src/components/CommonComponents/ReplyVideo/index.js index b9b272fe..af78d673 100644 --- a/src/components/CommonComponents/ReplyVideo/index.js +++ b/src/components/CommonComponents/ReplyVideo/index.js @@ -42,7 +42,11 @@ class ReplyVideo extends PureComponent { }; replyVideo = ()=> { - this.props.navigation.push('VideoReplies',{'videoId': this.props.videoId , 'userId': this.props.userId}); + this.props.navigation.push('VideoReplies', + {'videoId': this.props.videoId , + 'userId': this.props.userId, + 'fetchUrl': `/videos/${this.props.videoId}/replies` + }); }; render(){ diff --git a/src/components/FullScreenVideoCollection/index.js b/src/components/FullScreenVideoCollection/index.js index 4028438f..b5195a47 100644 --- a/src/components/FullScreenVideoCollection/index.js +++ b/src/components/FullScreenVideoCollection/index.js @@ -177,7 +177,7 @@ class FullScreenVideoCollection extends PureComponent{ return ( - {this.props.navigation.getParam("showBalanceFlier") && } + {this.props.navigation.getParam("showBalanceFlyer") && } { const oThis = TabMap.videos; diff --git a/src/components/TopsList/index.js b/src/components/TopsList/index.js index 553b4ed6..e1d41e58 100644 --- a/src/components/TopsList/index.js +++ b/src/components/TopsList/index.js @@ -171,7 +171,7 @@ class TopsList extends PureComponent { currentIndex: index, payload, baseUrl: fullVideoPageUrl, - showBalanceFlier: this.props.extraParams && this.props.extraParams.showBalanceFlier + showBalanceFlyer: this.props.extraParams && this.props.extraParams.showBalanceFlyer }); }; diff --git a/src/components/VideoCollections/index.js b/src/components/VideoCollections/index.js index d92aee0c..0f7ad3ae 100644 --- a/src/components/VideoCollections/index.js +++ b/src/components/VideoCollections/index.js @@ -165,7 +165,7 @@ class VideoCollections extends PureComponent { currentIndex: index, payload, baseUrl: this.props.getFetchUrl(), - showBalanceFlier: this.props.extraParams && this.props.extraParams.showBalanceFlier + showBalanceFlyer: this.props.extraParams && this.props.extraParams.showBalanceFlyer }); } renderFooter = () => { diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index 84eaa971..9bbbf122 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -1,31 +1,20 @@ import React, { PureComponent } from 'react'; import { View, - TouchableWithoutFeedback, FlatList, ActivityIndicator, Text, - Dimensions, Image, - TouchableOpacity + TouchableOpacity, + StatusBar } from "react-native"; import {SafeAreaView} from "react-navigation"; -import FastImage from 'react-native-fast-image'; -import LinearGradient from "react-native-linear-gradient"; -import reduxGetters from "../../services/ReduxGetters"; -import AppConfig from "../../constants/AppConfig"; -import Pricer from '../../services/Pricer'; import Pagination from "../../services/Pagination"; -import {fetchUser} from "../../helpers/helpers"; -import multipleClickHandler from '../../services/MultipleClickHandler'; import plusIcon from '../../assets/user-video-capture-icon-selected.png'; import inlineStyles from './styles'; -import pepoWhiteIcon from '../../assets/pepo-white-icon.png' -import CurrentUser from "../../models/CurrentUser"; -import DeleteVideo from "../../components/CommonComponents/DeleteVideo"; -import Colors from '../../theme/styles/Colors'; import crossIcon from '../../assets/cross_icon.png'; +import VideoThumbnailItem from '../CommonComponents/VideoThumbnailItem'; const HeaderLeft = (props) => { return ( @@ -44,7 +33,7 @@ const HeaderLeft = (props) => { return ({ props.navigation.push('CaptureVideo') }} style={inlineStyles.iconWrapper} > - + ) }; @@ -70,202 +59,226 @@ class VideoRepliesScreen extends PureComponent { }; constructor(props){ - super(props); - this.videoReplyPagination = new Pagination( this._fetchUrlVideoReplies() ); - this.paginationEvent = this.videoReplyPagination.event; + super(props); this.state = { - list : this.videoReplyPagination.getList(), - refreshing : false, - loadingNext: false - } - this.listRef = null ; + list : [], + refreshing : false, + loadingNext: false + }; + this.listRef = null; + + const ts = Date.now(); + this.noResultsKeyProp = "video_collection_no_results_" + ts; + this.hasResultsKeyProp = "video_collection_has_results_" + ts; + + this.numColumns = 2; + this.flatListKey = this.hasResultsKeyProp; + this.userId = props.navigation.getParam('userId'); + this.videoId = props.navigation.getParam('videoId'); + this.fetchUrl = props.navigation.getParam('fetchUrl'); + this.listHeaderComponent = props.navigation.getParam('listHeaderComponent'); + this.listHeaderSubComponent = props.navigation.getParam('listHeaderSubComponent'); } componentDidMount(){ - this.paginationEvent.on("onBeforeRefresh" , this.beforeRefresh.bind(this) ); - this.paginationEvent.on("onRefresh" , this.onRefresh.bind(this) ); - this.paginationEvent.on("onRefreshError" , this.onRefreshError.bind(this)); - this.paginationEvent.on("onBeforeNext" , this.beforeNext.bind(this)); - this.paginationEvent.on("onNext" , this.onNext.bind(this) ); - this.paginationEvent.on("onNextError" , this.onNextError.bind(this)); - if( this.props.refreshEvent) { - this.props.refreshEvent.on("refresh" , ()=> { - this.listRef.scrollToOffset({offset: 0}); - this.refresh(); - }); - } - this.videoReplyPagination.initPagination(); + this.forcedRefresh(); + const ts = Date.now(); + this.noResultsKeyProp = "video_collection_no_results_" + ts; + this.hasResultsKeyProp = "video_collection_has_results_" + ts; } - componentWillUnmount(){ - this.paginationEvent.removeListener('onBeforeRefresh'); - this.paginationEvent.removeListener('onRefresh'); - this.paginationEvent.removeListener('onRefreshError'); - this.paginationEvent.removeListener('onBeforeNext'); - this.paginationEvent.removeListener('onNext'); - this.paginationEvent.removeListener('onNextError'); - if( this.props.refreshEvent) { - this.props.refreshEvent.removeListener("refresh"); - } + componentWillUnmount() { + this.removePaginationListeners(); } - _fetchUrlVideoReplies(){ - const userId = this.props.navigation.getParam('userId'); - return `/users/${userId}/video-history`; + getPagination = () => { + return this.videoPagination; + }; + + // region - Pagination and Event Handlers + + initPagination() { + // First, take care of existing Pagination if exists. + this.removePaginationListeners(); + + // Now, create a new one. + let fetchUrl = `/users/${this.userId}/video-history`//this.fetchUrl; + this.videoPagination = new Pagination(fetchUrl); + this.bindPaginationEvents(); } - getVideoBtAmount(videoId){ - return Pricer.displayAmountWithKFomatter( Pricer.getFromDecimal( reduxGetters.getVideoBt(videoId) ) ) ; + bindPaginationEvents(){ + let pagination = this.videoPagination; + if ( !pagination ) { + return; + } + let paginationEvent = pagination.event; + if ( null === paginationEvent ) { + return; + } + + paginationEvent.on("onBeforeRefresh" , this.beforeRefresh.bind(this) ); + paginationEvent.on("onRefresh" , this.onRefresh.bind(this) ); + paginationEvent.on("onRefreshError" , this.onRefreshError.bind(this)); + paginationEvent.on("onBeforeNext" , this.beforeNext.bind(this)); + paginationEvent.on("onNext" , this.onNext.bind(this) ); + paginationEvent.on("onNextError" , this.onNextError.bind(this)); } - onPullToRefresh = () => { - fetchUser(this.props.userId , this.onUserFetch ); + removePaginationListeners(){ + let pagination = this.videoPagination; + if ( !pagination ) { + return; + } + let paginationEvent = pagination.event; + if ( null === paginationEvent ) { + return; + } + paginationEvent.removeListener('onBeforeRefresh'); + paginationEvent.removeListener('onRefresh'); + paginationEvent.removeListener('onRefreshError'); + paginationEvent.removeListener('onBeforeNext'); + paginationEvent.removeListener('onNext'); + paginationEvent.removeListener('onNextError'); } - onUserFetch =(res) => { - this.props.onUserFetch && this.props.onUserFetch(res); + forcedRefresh (fetchUrl){ + this.initPagination(); + this.refresh(); } beforeRefresh = ( ) => { - this.props.beforeRefresh && this.props.beforeRefresh(); - this.onPullToRefresh(); this.setState({ refreshing : true }); - } + }; onRefresh = ( res ) => { - const list = this.videoReplyPagination.getList() ; + const list = this.getResultList(); this.props.onRefresh && this.props.onRefresh( list , res ); - this.setState({ refreshing : false , list : list }); - } + this.setState({ + refreshing : false, + list : list + }); + }; onRefreshError = ( error ) => { this.setState({ refreshing : false }); - } + }; beforeNext =() => { this.setState({ loadingNext : true }); - } + }; onNext = ( res ) => { - this.setState({ loadingNext : false , list : this.videoReplyPagination.getList() }); + this.setState({ + loadingNext : false, + list : this.getResultList() + }); } onNextError = ( error ) => { this.setState({ loadingNext : false }); - } + }; getNext = () => { - this.videoReplyPagination.getNext(); - } + this.videoPagination.getNext(); + }; refresh = () => { - this.videoReplyPagination.refresh(); - } - - isCurrentUser = () => { - return this.props.userId === CurrentUser.getUserId(); - } + this.videoPagination.refresh(); + }; - removeVideo = (videoId, index) => { - if (index > -1) { - this.videoReplyPagination.deleteItem(videoId , "payload.video_id"); - let array = [...this.state.list]; // make a separate copy of the array - array.splice(index, 1); - this.setState({list: array}); - this.props.onDelete(array); - } + _keyExtractor = (item, index) => { + return `id_${item.id}`; } - _keyExtractor = (item, index) => `id_${item}`; - _renderItem = ({ item, index }) => { - const videoId = reduxGetters.getUserVideoId(item), - imageUrl = reduxGetters.getVideoImgUrl( videoId, null , AppConfig.userVideos.userScreenCoverImageWidth ) ; - return ( - { this.onVideoClick( item, index ); } )} - > - - - - - { this.isCurrentUser() && - {this.removeVideo(videoId , index )}} /> - } - - - - - {this.getVideoBtAmount(videoId)} - - - - - - ); + // Check if this is an empty cell. + if ( item.isEmpty) { + // Render no results cell here. + return this.props.getNoResultsCell(item); + } else { + // Render Video cell + return this._renderVideoCell({item,index}); + } }; + _renderVideoCell = ({ item, index }) => { + return ( {this.onVideoClick(item.payload, index, compRef)}} + isEmpty={item.isEmpty} + emptyRenderFunction={this.props.getNoResultsCell}/>); + }; + + + + onVideoClick = (payload, index, videoThumbnailMeasurements) => { + const clonedInstance = this.videoPagination.fetchServices.cloneInstance(); + this.props.navigation.push("VideoRepliesFullScreen", { + "fetchServices" : clonedInstance, + "currentIndex": index, + "payload": payload, + "baseUrl": this.fetchUrl, + "showBalanceFlyer": this.showBalanceFlyer, + "videoThumbnailMeasurements": videoThumbnailMeasurements + }); + } renderFooter = () => { if (!this.state.loadingNext) return null; return ; - }; - - onVideoClick = ( item, index ) => { - const clonedInstance = this.videoReplyPagination.fetchServices.cloneInstance(); - this.props.navigation.push("VideoReplyList", { - fetchServices : clonedInstance, - currentIndex: index, - userId: this.props.userId - }); + }; + + getListHeaderComponent = () => { + return ( + + {this.listHeaderComponent} + {this.state.list.length > 0 && this.listHeaderSubComponent } + + ) + }; + + getResultList(){ + let list = this.videoPagination.getResults(); + if( list.length > 0 ){ + this.numColumns = 2; + this.flatListKey = this.hasResultsKeyProp; + return list; + } else { + this.numColumns = 1; + this.flatListKey = this.noResultsKeyProp; + return [this.props.noResultsData]; + } } - listHeaderComponent = () => { - return ( - - {this.props.listHeaderComponent} - {this.state.list.length > 0 && this.props.listHeaderSubComponent } - - ) + scrollToTop(){ + this.listRef.scrollToOffset({offset: 0}); } + setListRef = (listRef) => { + this.listRef = listRef; + }; + render(){ - return( - - {this.listRef = ref } } - ListHeaderComponent={this.listHeaderComponent()} - data={this.state.list} - onEndReached={this.getNext} - onRefresh={this.refresh} - keyExtractor={this._keyExtractor} - refreshing={this.state.refreshing} - onEndReachedThreshold={9} - renderItem={this._renderItem} - ListFooterComponent={this.renderFooter} - numColumns={2} - /> - + return ( + + + + ); } diff --git a/src/components/VideoReplies/styles.js b/src/components/VideoReplies/styles.js index 1839bb91..a92fb3d6 100644 --- a/src/components/VideoReplies/styles.js +++ b/src/components/VideoReplies/styles.js @@ -1,17 +1,5 @@ -import { Dimensions, StatusBar, NativeModules } from 'react-native'; - import DefaultStyleGenerator from '../../theme/styles/DefaultStyleGenerator'; import Colors from '../../theme/styles/Colors'; -import { ifIphoneX, getBottomSpace } from 'react-native-iphone-x-helper'; -import { CUSTOM_TAB_Height } from '../../theme/constants'; -import NotchHelper from "../../helpers/NotchHelper"; - -const {width, height} = Dimensions.get('window'); -const statusBarHeight = StatusBar.currentHeight; - -let RNDeviceInfo = NativeModules.RNDeviceInfo; -let modalDeviceName = RNDeviceInfo.model === "Redmi Note 7 Pro" && RNDeviceInfo.brand === "xiaomi"; -let btmSpace = modalDeviceName ? 5 : 0; let stylesMap = { iconWrapper: { @@ -25,128 +13,22 @@ let stylesMap = { height: 20, width: 20 }, - videoStatsContainer: { - padding: 5, - flexDirection: 'row', - alignItems: 'center', - width: '100%' - }, - deleteButton: { - height: 24, - width: 40, - justifyContent: 'center', - alignItems: 'center' - }, - videoStatsTxt: { - color: Colors.white, - fontSize: 16, - fontFamily: 'AvenirNext-Regular', - marginLeft: 2 - }, - fullScreen: { - width: width, - ...ifIphoneX( - { - height: height - CUSTOM_TAB_Height - getBottomSpace([true]) - }, - { - height: - NotchHelper.hasNotch() - ? height + statusBarHeight - CUSTOM_TAB_Height - btmSpace - : height - CUSTOM_TAB_Height - } - ) - }, - fullHeightWidth: { - width: "100%", - height: "100%" - }, - touchablesBtns: { - alignSelf: 'flex-end', - marginBottom: -15, - zIndex: 1 - }, - pepoTxCount: { - fontSize: 18, - color: Colors.white, - alignSelf: 'center', - marginTop: 3, - marginBottom: 15 - }, - txElem: { - marginBottom: 20 - }, - bottomContainer: { - width: width, - position: 'absolute', - bottom: 0 - }, - bottomBg: { - backgroundColor: 'rgba(0, 0, 0, 0.6)', - borderTopLeftRadius: 20, - minHeight: height * 0.05, - paddingHorizontal: 12 - }, - handle: { - fontSize: 15, - paddingBottom: 3, - color: Colors.white, - fontFamily: 'AvenirNext-DemiBold', - fontWeight: '700' - }, - bottomBgTxt: { - color: Colors.white - }, - raisedSupported: { - backgroundColor: Colors.wildWatermelon2, - borderTopLeftRadius: 25, - borderBottomRightRadius: 25, - paddingHorizontal: 8, - minWidth: 120, - height: 40, - alignItems: 'center', - justifyContent: 'center', - marginRight: 10 - }, - raisedSupportedTxt: { - color: Colors.white, - fontSize: 14, - fontFamily: 'AvenirNext-DemiBold' - }, - btnText: { - color: Colors.white - }, - playIconSkipFont: { - position: 'absolute', - height: 25, - width: 25, - top: height * 0.5 - 12, - left: width * 0.5 - 12 - }, - historyBackSkipFont:{ - ...ifIphoneX({ - top: 55, - }, { - top: 25, - }), - width: 29, - height: 34, - position: 'absolute', - left: 10, - alignItems: 'center', - justifyContent: 'center' - }, - optionsIconSkipFont:{ - ...ifIphoneX({ - top: 70, - }, { - top: 40, - }), - position: 'absolute', - right: 10, - height :10, - width:23, - zIndex: 1, + headerStyles: { + backgroundColor: Colors.white, + borderBottomWidth: 0, + shadowColor: '#000', + shadowOffset: { + width: 0, + height: 1 + }, + shadowOpacity: 0.1, + shadowRadius: 3 + }, + headerText:{ + fontWeight: '600' + }, + headerSubText:{ + fontSize: 12 } }; diff --git a/src/components/VideoRepliesFullScreen/VideoReply.js b/src/components/VideoRepliesFullScreen/VideoReply.js new file mode 100644 index 00000000..49cd5178 --- /dev/null +++ b/src/components/VideoRepliesFullScreen/VideoReply.js @@ -0,0 +1,109 @@ +import React, { PureComponent } from 'react'; +import { View } from 'react-native'; +import { withNavigation } from 'react-navigation'; +import VideoWrapper from '../Home/VideoWrapper'; +import ShareIcon from "../CommonComponents/ShareIcon"; +import ReportVideo from "../CommonComponents/ReportVideo"; +import PepoApi from '../../services/PepoApi'; +import TransactionPepoButton from '../Home/TransactionPepoButton'; +import deepGet from 'lodash/get'; +import CurrentUser from '../../models/CurrentUser'; + +import BottomStatus from '../Home/BottomStatus'; +import VideoAmountStat from '../CommonComponents/VideoAmoutStat'; +import ShareVideo from '../../services/shareVideo'; +import inlineStyles from './styles'; + +import utilities from '../../services/Utilities'; + + +class VideoReply extends PureComponent { + constructor(props) { + super(props); + this.userId = deepGet(this.props.payload, 'user_id'); + this.replyId = deepGet(this.props.payload, 'video_id');//reply_id replace + } + + refetchVideoReply = () => { + new PepoApi(`/videos/${this.videoId}`)// new PepoApi(`/replies/${this.replyId}`) + .get() + .then((res) => {}) + .catch((error) => {}); + }; + + + + shareVideo = () => { + let shareVideo = new ShareVideo(this.replyId); + shareVideo.perform(); + }; + + navigateToUserProfile = (e) => { + if (utilities.checkActiveUser()) { + if (this.userId == CurrentUser.getUserId()) { + this.props.navigation.navigate('ProfileScreen'); + } else { + this.props.navigation.push('UsersProfileScreen', { userId: this.userId }); + } + } + }; + + onDescriptionClick = ( tapEntity , tapText ) => { + if (!tapEntity) { + return; + } + + if( tapEntity.kind === 'tags'){ + this.props.navigation.push('VideoTags', { + "tagId": tapEntity.id + }); + } + + } + + render() { + return ( + + + + {!!this.replyId && !!this.userId && ( + + + + + + + + + + + + + + + )} + + ); + } +} + +export default withNavigation(VideoReply); diff --git a/src/components/VideoReplies/VideoReplyList.js b/src/components/VideoRepliesFullScreen/index.js similarity index 58% rename from src/components/VideoReplies/VideoReplyList.js rename to src/components/VideoRepliesFullScreen/index.js index 36b181d0..920d591f 100644 --- a/src/components/VideoReplies/VideoReplyList.js +++ b/src/components/VideoRepliesFullScreen/index.js @@ -1,49 +1,90 @@ import React , {PureComponent} from "react"; -import {FlatList , View , TouchableOpacity, Image} from "react-native"; +import {FlatList , View , TouchableOpacity, Image, Text, StatusBar} from "react-native"; import deepGet from "lodash/get"; -import reduxGetters from "../../services/ReduxGetters"; -import Pagination from "../../services/Pagination"; - -import UserVideoHistoryRow from "../UserVideoHistory/UserVideoHistoryRow"; -import TopStatus from "../../components/Home/TopStatus"; +import Pagination from "../../services/Pagination"; import inlineStyles from "./styles"; -import CurrentUser from "../../models/CurrentUser"; - -import historyBack from '../../assets/user-video-history-back-icon.png'; +import backIcon from '../../assets/back-arrow.png'; +import plusIcon from '../../assets/user-video-capture-icon-selected.png'; +import VideoReply from "./VideoReply"; const maxVideosThreshold = 3; +const HeaderLeft = (props) => { + return ( + { + props.navigation.goBack(); + }} + style={inlineStyles.iconWrapper} + > + + + ); + }; + + const HeaderRight = (props) => { + return ({ + props.navigation.push('CaptureVideo') + }} style={inlineStyles.iconWrapper} > + + ) + }; + + const HeaderTitle = (props) => { + return ( + + + Replies to Frankie + + Send a reply with Pepo5 + + ); + }; -class VideoReplyList extends PureComponent{ +class VideoRepliesFullScreen extends PureComponent{ - static navigationOptions = (options) => { - return { - headerBackTitle: null, - header: null + static navigationOptions = (props) => { + return { + headerBackTitle: null, + headerStyle: inlineStyles.headerStyles, + headerLeft: , + headerRight: , + headerTitle: + }; }; - }; constructor(props){ super(props); - this.userId = this.props.navigation.getParam("userId"); - this.videoHistoryPagination = new Pagination( this._fetchUrlVideoHistory(), {} , this.props.navigation.getParam("fetchServices")); - this.paginationEvent = this.videoHistoryPagination.event; + this.setVideoPagination(); + this.paginationEvent = this.getVideoPagination().event; this.currentIndex = this.props.navigation.getParam("currentIndex"); this.isScrolled = false ; this.willFocusSubscription = null ; this.flatlistRef = null; this.state = { - list : this.videoHistoryPagination.getList(), + list : this.getVideoPagination().getResults(), activeIndex: this.currentIndex, refreshing : false, loadingNext: false }; - this.isActiveScreen = true; + this.isActiveScreen = true; } - _fetchUrlVideoHistory(){ - return `/users/${this.userId}/video-history` ; + getBaseUrl(){ + return this.props.navigation.getParam("baseUrl"); + } + + getPassedFetchServices(){ + return this.props.navigation.getParam("fetchServices") + } + + setVideoPagination(){ + this.fullPagePagination = new Pagination( this.getBaseUrl(), null , this.getPassedFetchServices()); + } + + getVideoPagination(){ + return this.fullPagePagination; } componentDidMount(){ @@ -61,9 +102,9 @@ class VideoReplyList extends PureComponent{ this.isActiveScreen = true ; }); - this.willBlurSubscription = this.props.navigation.addListener('willBlur', (payload) => { - this.isActiveScreen = false ; - }); + this.willBlurSubscription = this.props.navigation.addListener('willBlur', (payload) => { + this.isActiveScreen = false ; + }); } componentWillUnmount(){ @@ -86,7 +127,9 @@ class VideoReplyList extends PureComponent{ } onRefresh = ( res ) => { - this.setState({ refreshing : false , list : this.videoHistoryPagination.getList() }); + let paginationService = this.getVideoPagination(); + let resultList = paginationService.getResults(); + this.setState({ refreshing : false , list : resultList }); } onRefreshError = ( error ) => { @@ -99,7 +142,9 @@ class VideoReplyList extends PureComponent{ } onNext = ( res ) => { - this.setState({ loadingNext : false , list : this.videoHistoryPagination.getList() }); + let paginationService = this.getVideoPagination(); + let resultList = paginationService.getResults(); + this.setState({ loadingNext : false , list : resultList }); } onNextError = ( error ) => { @@ -107,24 +152,25 @@ class VideoReplyList extends PureComponent{ } getNext = () => { - if(!this.isScrolled) return; - this.videoHistoryPagination.getNext(); + // if(!this.isScrolled) return; + this.getVideoPagination().getNext(); } refresh = () => { - this.videoHistoryPagination.refresh(); + this.getVideoPagination().refresh(); } _keyExtractor = (item, index) => { - return `id_${item}`; - }; + return `id_${item.id}`; + } _renderItem = ({ item, index }) => { - const videoId = reduxGetters.getUserVideoId(item) ; - return ; + const payload = item.payload; + return ; }; onViewableItemsChanged = (data) => { @@ -148,30 +194,26 @@ class VideoReplyList extends PureComponent{ } getItemLayout= (data, index) => { - return {length: inlineStyles.fullScreen.height, offset: inlineStyles.fullScreen.height * index, index} ; - } - - isCurrentUser(){ - return this.userId == CurrentUser.getUserId(); + return {length: inlineStyles.fullScreen.height, offset: inlineStyles.fullScreen.height * index, index} ; } closeVideo = () => { this.navigateBack(); - }; + }; navigateBack() { this.props.navigation.goBack(); } onScrollToTop = () => { - this.setActiveIndex(); + this.setActiveIndex(); } render() { - return( + return ( - {!this.isCurrentUser() && } + - - - - + ); } } -export default VideoReplyList ; +export default VideoRepliesFullScreen ; diff --git a/src/components/VideoRepliesFullScreen/styles.js b/src/components/VideoRepliesFullScreen/styles.js new file mode 100644 index 00000000..6725c4bf --- /dev/null +++ b/src/components/VideoRepliesFullScreen/styles.js @@ -0,0 +1,118 @@ +import { Dimensions, StatusBar, NativeModules } from 'react-native'; +import DefaultStyleGenerator from '../../theme/styles/DefaultStyleGenerator'; +import Colors from '../../theme/styles/Colors'; +import { ifIphoneX, getBottomSpace } from 'react-native-iphone-x-helper'; +import { Header } from 'react-navigation-stack'; + +import NotchHelper from "../../helpers/NotchHelper"; +const {width, height} = Dimensions.get('window'); +const statusBarHeight = StatusBar.currentHeight; + +console.log("header", Header.HEIGHT); + +let RNDeviceInfo = NativeModules.RNDeviceInfo; +let modalDeviceName = RNDeviceInfo.model === "Redmi Note 7 Pro" && RNDeviceInfo.brand === "xiaomi"; +let btmSpace = modalDeviceName ? 5 : 0; + +let stylesMap = { + fullScreen: { + width: width, + flex:1, + ...ifIphoneX( + { + height: height - getBottomSpace([true]) - Header.HEIGHT - statusBarHeight + }, + { + height: + NotchHelper.hasNotch() + ? height - statusBarHeight - btmSpace - Header.HEIGHT + : height - Header.HEIGHT - statusBarHeight + } + ) + }, + touchablesBtns: { + alignSelf: 'flex-end', + marginBottom: -15, + zIndex: 1 + }, + pepoTxCount: { + fontSize: 18, + color: Colors.white, + alignSelf: 'center', + marginTop: 3, + marginBottom: 15 + }, + txElem: { + marginBottom: 20 + }, + bottomContainer: { + width: width, + position: 'absolute', + bottom: 0 + }, + bottomBg: { + backgroundColor: 'rgba(0, 0, 0, 0.6)', + borderTopLeftRadius: 20, + minHeight: height * 0.05, + paddingHorizontal: 12 + }, + handle: { + fontSize: 15, + paddingBottom: 3, + color: Colors.white, + fontFamily: 'AvenirNext-DemiBold', + fontWeight: '700' + }, + bottomBgTxt: { + color: Colors.white + }, + raisedSupported: { + backgroundColor: Colors.wildWatermelon2, + borderTopLeftRadius: 25, + borderBottomRightRadius: 25, + paddingHorizontal: 8, + minWidth: 120, + height: 40, + alignItems: 'center', + justifyContent: 'center', + marginRight: 10 + }, + raisedSupportedTxt: { + color: Colors.white, + fontSize: 14, + fontFamily: 'AvenirNext-DemiBold' + }, + btnText: { + color: Colors.white + }, + iconWrapper: { + flex: 1, + alignItems: 'center', + justifyContent: 'center', + height: 60, + width: 60 + }, + iconSkipFont: { + height: 20, + width: 20 + }, + headerStyles: { + backgroundColor: Colors.white, + borderBottomWidth: 0, + shadowColor: '#000', + shadowOffset: { + width: 0, + height: 1 + }, + shadowOpacity: 0.1, + shadowRadius: 3 + }, + headerText:{ + fontWeight: '600' + }, + headerSubText:{ + fontSize: 12 + } +}; + +export default styles = DefaultStyleGenerator.generate(stylesMap); diff --git a/src/components/VideoTags/index.js b/src/components/VideoTags/index.js index d61b9514..048706ee 100644 --- a/src/components/VideoTags/index.js +++ b/src/components/VideoTags/index.js @@ -101,7 +101,7 @@ class VideoTags extends PureComponent { getExtraParams = () => { return { - showBalanceFlier: true + showBalanceFlyer: true }; }; From 00f6af6d303da5648aeb391b3cd0ef14a7d3973e Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Fri, 8 Nov 2019 21:06:42 +0530 Subject: [PATCH 012/302] fix --- src/components/CaptureVideo/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/CaptureVideo/index.js b/src/components/CaptureVideo/index.js index afe88ad6..db123655 100644 --- a/src/components/CaptureVideo/index.js +++ b/src/components/CaptureVideo/index.js @@ -72,7 +72,7 @@ class CaptureVideo extends Component { } - proceedWithExistingVideo(recordedVideoObj) { + proceedWithExistingVideo = (recordedVideoObj) => { this.videoType = recordedVideoObj.video_type || VideoTypesConfig.post.type; this.setState ({ recordingScreen: false, From 6edb17bc75829c5d623a45b331fa96c97b7e439b Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Mon, 11 Nov 2019 16:15:06 +0530 Subject: [PATCH 013/302] Code speration --- package.json | 1 + .../CommonComponents/SlidingUpPanel/index.js | 10 + .../CommonComponents/SlidingUpPanel/styles.js | 0 src/components/VideoReplies/index.js | 213 +-------------- src/components/VideoReplies/list.js | 247 ++++++++++++++++++ 5 files changed, 264 insertions(+), 207 deletions(-) create mode 100644 src/components/CommonComponents/SlidingUpPanel/index.js create mode 100644 src/components/CommonComponents/SlidingUpPanel/styles.js create mode 100644 src/components/VideoReplies/list.js diff --git a/package.json b/package.json index 0e5f6525..c542f054 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "redux": "4.0.1", "redux-actions": "2.6.5", "redux-logger": "3.0.6", + "rn-sliding-up-panel": "2.3.3", "socket.io-client": "2.2.0" }, "devDependencies": { diff --git a/src/components/CommonComponents/SlidingUpPanel/index.js b/src/components/CommonComponents/SlidingUpPanel/index.js new file mode 100644 index 00000000..4c3e62ef --- /dev/null +++ b/src/components/CommonComponents/SlidingUpPanel/index.js @@ -0,0 +1,10 @@ +import SlidingUpPanel from "rn-sliding-up-panel"; + +class Panel extends SlidingUpPanel{ + + constructor(props){ + super(props); + } +} + +export default Panel ; \ No newline at end of file diff --git a/src/components/CommonComponents/SlidingUpPanel/styles.js b/src/components/CommonComponents/SlidingUpPanel/styles.js new file mode 100644 index 00000000..e69de29b diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index 9bbbf122..f9dbfa54 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -1,8 +1,6 @@ import React, { PureComponent } from 'react'; import { View, - FlatList, - ActivityIndicator, Text, Image, TouchableOpacity, @@ -10,11 +8,12 @@ import { } from "react-native"; import {SafeAreaView} from "react-navigation"; -import Pagination from "../../services/Pagination"; import plusIcon from '../../assets/user-video-capture-icon-selected.png'; import inlineStyles from './styles'; import crossIcon from '../../assets/cross_icon.png'; -import VideoThumbnailItem from '../CommonComponents/VideoThumbnailItem'; + + +import VideoReplyList from "./list"; const HeaderLeft = (props) => { return ( @@ -60,224 +59,24 @@ class VideoRepliesScreen extends PureComponent { constructor(props){ super(props); - - this.state = { - list : [], - refreshing : false, - loadingNext: false - }; - this.listRef = null; - - const ts = Date.now(); - this.noResultsKeyProp = "video_collection_no_results_" + ts; - this.hasResultsKeyProp = "video_collection_has_results_" + ts; - - this.numColumns = 2; - this.flatListKey = this.hasResultsKeyProp; this.userId = props.navigation.getParam('userId'); this.videoId = props.navigation.getParam('videoId'); this.fetchUrl = props.navigation.getParam('fetchUrl'); - this.listHeaderComponent = props.navigation.getParam('listHeaderComponent'); - this.listHeaderSubComponent = props.navigation.getParam('listHeaderSubComponent'); } componentDidMount(){ - this.forcedRefresh(); - const ts = Date.now(); - this.noResultsKeyProp = "video_collection_no_results_" + ts; - this.hasResultsKeyProp = "video_collection_has_results_" + ts; + } componentWillUnmount() { - this.removePaginationListeners(); - } - - getPagination = () => { - return this.videoPagination; - }; - - // region - Pagination and Event Handlers - - initPagination() { - // First, take care of existing Pagination if exists. - this.removePaginationListeners(); - - // Now, create a new one. - let fetchUrl = `/users/${this.userId}/video-history`//this.fetchUrl; - this.videoPagination = new Pagination(fetchUrl); - this.bindPaginationEvents(); - } - - bindPaginationEvents(){ - let pagination = this.videoPagination; - if ( !pagination ) { - return; - } - let paginationEvent = pagination.event; - if ( null === paginationEvent ) { - return; - } - - paginationEvent.on("onBeforeRefresh" , this.beforeRefresh.bind(this) ); - paginationEvent.on("onRefresh" , this.onRefresh.bind(this) ); - paginationEvent.on("onRefreshError" , this.onRefreshError.bind(this)); - paginationEvent.on("onBeforeNext" , this.beforeNext.bind(this)); - paginationEvent.on("onNext" , this.onNext.bind(this) ); - paginationEvent.on("onNextError" , this.onNextError.bind(this)); - } - - removePaginationListeners(){ - let pagination = this.videoPagination; - if ( !pagination ) { - return; - } - let paginationEvent = pagination.event; - if ( null === paginationEvent ) { - return; - } - paginationEvent.removeListener('onBeforeRefresh'); - paginationEvent.removeListener('onRefresh'); - paginationEvent.removeListener('onRefreshError'); - paginationEvent.removeListener('onBeforeNext'); - paginationEvent.removeListener('onNext'); - paginationEvent.removeListener('onNextError'); - } - - forcedRefresh (fetchUrl){ - this.initPagination(); - this.refresh(); - } - - beforeRefresh = ( ) => { - this.setState({ refreshing : true }); - }; - - onRefresh = ( res ) => { - const list = this.getResultList(); - this.props.onRefresh && this.props.onRefresh( list , res ); - this.setState({ - refreshing : false, - list : list - }); - }; - - onRefreshError = ( error ) => { - this.setState({ refreshing : false }); - }; - - beforeNext =() => { - this.setState({ loadingNext : true }); - }; - - onNext = ( res ) => { - this.setState({ - loadingNext : false, - list : this.getResultList() - }); + } - onNextError = ( error ) => { - this.setState({ loadingNext : false }); - }; - - getNext = () => { - this.videoPagination.getNext(); - }; - - refresh = () => { - this.videoPagination.refresh(); - }; - - _keyExtractor = (item, index) => { - return `id_${item.id}`; - } - - _renderItem = ({ item, index }) => { - // Check if this is an empty cell. - if ( item.isEmpty) { - // Render no results cell here. - return this.props.getNoResultsCell(item); - } else { - // Render Video cell - return this._renderVideoCell({item,index}); - } - }; - - _renderVideoCell = ({ item, index }) => { - return ( {this.onVideoClick(item.payload, index, compRef)}} - isEmpty={item.isEmpty} - emptyRenderFunction={this.props.getNoResultsCell}/>); - }; - - - - onVideoClick = (payload, index, videoThumbnailMeasurements) => { - const clonedInstance = this.videoPagination.fetchServices.cloneInstance(); - this.props.navigation.push("VideoRepliesFullScreen", { - "fetchServices" : clonedInstance, - "currentIndex": index, - "payload": payload, - "baseUrl": this.fetchUrl, - "showBalanceFlyer": this.showBalanceFlyer, - "videoThumbnailMeasurements": videoThumbnailMeasurements - }); - } - renderFooter = () => { - if (!this.state.loadingNext) return null; - return ; - }; - - getListHeaderComponent = () => { - return ( - - {this.listHeaderComponent} - {this.state.list.length > 0 && this.listHeaderSubComponent } - - ) - }; - - getResultList(){ - let list = this.videoPagination.getResults(); - if( list.length > 0 ){ - this.numColumns = 2; - this.flatListKey = this.hasResultsKeyProp; - return list; - } else { - this.numColumns = 1; - this.flatListKey = this.noResultsKeyProp; - return [this.props.noResultsData]; - } - } - - scrollToTop(){ - this.listRef.scrollToOffset({offset: 0}); - } - - setListRef = (listRef) => { - this.listRef = listRef; - }; - render(){ return ( - + ); } diff --git a/src/components/VideoReplies/list.js b/src/components/VideoReplies/list.js new file mode 100644 index 00000000..4e9fee4d --- /dev/null +++ b/src/components/VideoReplies/list.js @@ -0,0 +1,247 @@ +import React, { PureComponent } from 'react'; +import { + View, + FlatList, + ActivityIndicator, + Text, + Image, + TouchableOpacity, + StatusBar +} from "react-native"; +import {SafeAreaView, withNavigation} from "react-navigation"; + +import Pagination from "../../services/Pagination"; +import plusIcon from '../../assets/user-video-capture-icon-selected.png'; +import inlineStyles from './styles'; +import crossIcon from '../../assets/cross_icon.png'; +import VideoThumbnailItem from '../CommonComponents/VideoThumbnailItem'; + + + +class VideoReplyList extends PureComponent { + + + constructor(props){ + super(props); + + this.state = { + list : [], + refreshing : false, + loadingNext: false + }; + this.listRef = null; + + const ts = Date.now(); + this.noResultsKeyProp = "video_collection_no_results_" + ts; + this.hasResultsKeyProp = "video_collection_has_results_" + ts; + + this.numColumns = 2; + this.flatListKey = this.hasResultsKeyProp; + this.listHeaderComponent =null; + this.listHeaderSubComponent = null; + } + + componentDidMount(){ + this.forcedRefresh(); + const ts = Date.now(); + this.noResultsKeyProp = "video_collection_no_results_" + ts; + this.hasResultsKeyProp = "video_collection_has_results_" + ts; + } + + componentWillUnmount() { + this.removePaginationListeners(); + } + + getPagination = () => { + return this.videoPagination; + }; + + // region - Pagination and Event Handlers + + initPagination() { + // First, take care of existing Pagination if exists. + this.removePaginationListeners(); + + // Now, create a new one. + let fetchUrl = `/users/${this.props.userId}/video-history`//this.fetchUrl; + this.videoPagination = new Pagination(fetchUrl); + this.bindPaginationEvents(); + } + + bindPaginationEvents(){ + let pagination = this.videoPagination; + if ( !pagination ) { + return; + } + let paginationEvent = pagination.event; + if ( null === paginationEvent ) { + return; + } + + paginationEvent.on("onBeforeRefresh" , this.beforeRefresh.bind(this) ); + paginationEvent.on("onRefresh" , this.onRefresh.bind(this) ); + paginationEvent.on("onRefreshError" , this.onRefreshError.bind(this)); + paginationEvent.on("onBeforeNext" , this.beforeNext.bind(this)); + paginationEvent.on("onNext" , this.onNext.bind(this) ); + paginationEvent.on("onNextError" , this.onNextError.bind(this)); + } + + removePaginationListeners(){ + let pagination = this.videoPagination; + if ( !pagination ) { + return; + } + let paginationEvent = pagination.event; + if ( null === paginationEvent ) { + return; + } + paginationEvent.removeListener('onBeforeRefresh'); + paginationEvent.removeListener('onRefresh'); + paginationEvent.removeListener('onRefreshError'); + paginationEvent.removeListener('onBeforeNext'); + paginationEvent.removeListener('onNext'); + paginationEvent.removeListener('onNextError'); + } + + forcedRefresh (fetchUrl){ + this.initPagination(); + this.refresh(); + } + + beforeRefresh = ( ) => { + this.setState({ refreshing : true }); + }; + + onRefresh = ( res ) => { + const list = this.getResultList(); + this.props.onRefresh && this.props.onRefresh( list , res ); + this.setState({ + refreshing : false, + list : list + }); + }; + + onRefreshError = ( error ) => { + this.setState({ refreshing : false }); + }; + + beforeNext =() => { + this.setState({ loadingNext : true }); + }; + + onNext = ( res ) => { + this.setState({ + loadingNext : false, + list : this.getResultList() + }); + } + + onNextError = ( error ) => { + this.setState({ loadingNext : false }); + }; + + getNext = () => { + this.videoPagination.getNext(); + }; + + refresh = () => { + this.videoPagination.refresh(); + }; + + _keyExtractor = (item, index) => { + return `id_${item.id}`; + } + + _renderItem = ({ item, index }) => { + // Check if this is an empty cell. + if ( item.isEmpty) { + // Render no results cell here. + return this.props.getNoResultsCell(item); + } else { + // Render Video cell + return this._renderVideoCell({item,index}); + } + }; + + _renderVideoCell = ({ item, index }) => { + return ( {this.onVideoClick(item.payload, index, compRef)}} + isEmpty={item.isEmpty} + emptyRenderFunction={this.props.getNoResultsCell}/>); + }; + + + + onVideoClick = (payload, index, videoThumbnailMeasurements) => { + const clonedInstance = this.videoPagination.fetchServices.cloneInstance(); + this.props.navigation.push("VideoRepliesFullScreen", { + "fetchServices" : clonedInstance, + "currentIndex": index, + "payload": payload, + "baseUrl": this.props.fetchUrl, + "showBalanceFlyer": this.showBalanceFlyer, + "videoThumbnailMeasurements": videoThumbnailMeasurements + }); + } + renderFooter = () => { + if (!this.state.loadingNext) return null; + return ; + }; + + getListHeaderComponent = () => { + return ( + + {this.listHeaderComponent} + {this.state.list.length > 0 && this.listHeaderSubComponent } + + ) + }; + + getResultList(){ + let list = this.videoPagination.getResults(); + if( list.length > 0 ){ + this.numColumns = 2; + this.flatListKey = this.hasResultsKeyProp; + return list; + } else { + this.numColumns = 1; + this.flatListKey = this.noResultsKeyProp; + return [this.props.noResultsData]; + } + } + + scrollToTop(){ + this.listRef.scrollToOffset({offset: 0}); + } + + setListRef = (listRef) => { + this.listRef = listRef; + }; + + render(){ + return ( + + + + + ); + } + +} + +export default withNavigation( VideoReplyList ); From ae4b8a6c03a4f93f34de13efbf5f91c53fbb7851 Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Mon, 11 Nov 2019 20:15:33 +0530 Subject: [PATCH 014/302] record video reply --- RootNavigationContainer.js | 6 +- src/components/CaptureVideo/index.js | 48 +-- .../CommonComponents/ReplyVideo/index.js | 27 +- .../FanVideoReplyDetails/TouchableButton.js | 18 ++ src/components/FanVideoReplyDetails/index.js | 280 ++++++++++++++++++ src/components/FanVideoReplyDetails/styles.js | 70 +++++ src/components/PreviewRecordedVideo/index.js | 1 + src/components/VideoRecorder/index.js | 68 ++++- src/components/VideoReplies/index.js | 31 +- .../VideoRepliesFullScreen/index.js | 21 +- src/constants/DataContract.js | 4 + src/services/CameraWorker.js | 4 +- src/store/index.js | 4 +- 13 files changed, 545 insertions(+), 37 deletions(-) create mode 100644 src/components/FanVideoReplyDetails/TouchableButton.js create mode 100644 src/components/FanVideoReplyDetails/index.js create mode 100644 src/components/FanVideoReplyDetails/styles.js diff --git a/RootNavigationContainer.js b/RootNavigationContainer.js index 7b7a11c1..3e8dde82 100644 --- a/RootNavigationContainer.js +++ b/RootNavigationContainer.js @@ -39,6 +39,8 @@ import { NotificationToastComponent } from './src/theme/components/NotificationT import SocketManager from './src/services/SocketManager'; import SearchScreen from './src/components/Search'; import FanVideoDetails from './src/components/FanVideoDetails'; +import FanVideoReplyDetails from './src/components/FanVideoReplyDetails'; + import WalletSettingScreen from './src/components/WalletSetting'; import StoreProductsScreen from './src/components/StoreProducts'; import PaymentWorker from './src/components/PaymentWorker'; @@ -62,6 +64,7 @@ import VideoRepliesFullScreen from './src/components/VideoRepliesFullScreen'; const customTabHiddenRoutes = [ 'CaptureVideo', 'FanVideoDetails', + 'FanVideoReplyDetails', 'InviteCodeScreen', 'AddEmailScreen', 'InAppBrowserComponent', @@ -115,7 +118,8 @@ const txModalConfig = { const CaptureVideoStack = createStackNavigator( { CaptureVideo: CaptureVideo, - FanVideoDetails: FanVideoDetails + FanVideoDetails: FanVideoDetails, + FanVideoReplyDetails: FanVideoReplyDetails }, { headerLayoutPreset: 'center' diff --git a/src/components/CaptureVideo/index.js b/src/components/CaptureVideo/index.js index db123655..b0eaeee9 100644 --- a/src/components/CaptureVideo/index.js +++ b/src/components/CaptureVideo/index.js @@ -1,7 +1,6 @@ import React, { Component } from 'react'; import VideoRecorder from '../VideoRecorder'; import PreviewRecordedVideo from '../PreviewRecordedVideo'; -import FanVideoDetails from '../FanVideoDetails'; import Store from "../../store"; import {upsertRecordedVideo} from "../../actions"; import utilities from '../../services/Utilities'; @@ -29,14 +28,14 @@ class CaptureVideo extends Component { actionSheetOnRecordVideo: true, modalVisible: true, acceptedCameraTnC: null, - showReplyCoachScreen: false + hasVideoReplies: false }; this.isVideoTypeReply = null; this.replyReceiverUserId = null; this.replyReceiverVideoId = null; this.amountToSendWithReply = null; this.videoType = null; - + this.proceedWithExisting = null; this.setReplyVideoParams(); } @@ -48,16 +47,16 @@ class CaptureVideo extends Component { this.setState({ acceptedCameraTnC: terms }); }); } - } setReplyVideoParams(){ this.isVideoTypeReply = this.props.navigation.getParam("videoTypeReply"); + console.log('setReplyVideoParams', this.isVideoTypeReply ); if (this.isVideoTypeReply){ - this.replyReceiverUserId = this.props.navigation.getParam("replyReceiverUserId"); - this.replyReceiverVideoId = this.props.navigation.getParam("replyReceiverVideoId"); - this.amountToSendWithReply = this.props.navigation.getParam("amountToSendWithReply"); - this.setState({showReplyCoachScreen: this.props.navigation.getParam("showReplyCoachScreen")}); + this.replyReceiverUserId = this.props.navigation.getParam("userId"); + this.replyReceiverVideoId = this.props.navigation.getParam("videoId"); + this.amountToSendWithReply = this.props.navigation.getParam("amount"); + this.setState({hasVideoReplies: this.props.navigation.getParam("videoReplyCount") > 0 }); } else { // Do nothing. } @@ -67,36 +66,43 @@ class CaptureVideo extends Component { this.setState({ recordingScreen: true, actionSheetOnRecordVideo: false, - acceptedCameraTnC: 'true' + acceptedCameraTnC: 'true', + hasVideoReplies: true }); } proceedWithExistingVideo = (recordedVideoObj) => { + this.proceedWithExisting = true; this.videoType = recordedVideoObj.video_type || VideoTypesConfig.post.type; + this.isVideoTypeReply = this.videoType === VideoTypesConfig.reply.type; this.setState ({ recordingScreen: false, videoUri: recordedVideoObj.raw_video }); - } + }; saveVideoPrimaryInfo = () => { - if (this.isVideoTypeReply) { - this.videoType = VideoTypesConfig.reply.type; - Store.dispatch(upsertRecordedVideo({ video_type: VideoTypesConfig.reply.type, reply_obj: this.getReplyOptions()})); - } else { - this.videoType = VideoTypesConfig.post.type; - Store.dispatch(upsertRecordedVideo({ video_type: VideoTypesConfig.post.type })); - } + this.videoType = this.isVideoTypeReply ? VideoTypesConfig.reply.type : VideoTypesConfig.post.type; + Store.dispatch(upsertRecordedVideo(this.getPrimaryVideoInfo())); }; - goToDetailsScreen() { + getPrimaryVideoInfo = () => { + if (this.proceedWithExisting) return {}; + + return this.videoType === VideoTypesConfig.reply.type ? + { video_type: VideoTypesConfig.reply.type, reply_obj: this.getReplyOptions()} : + { video_type: VideoTypesConfig.post.type }; + }; + + + goToDetailsScreen () { if (this.videoType === VideoTypesConfig.post.type){ - this.props.navigation.push('FanVideoDetails'); + this.props.navigation.push('FanVideoDetails', this.getPrimaryVideoInfo()); } else if (this.videoType === VideoTypesConfig.reply.type){ - this.props.navigation.push('FanVideoReplyDetails'); + this.props.navigation.push('FanVideoReplyDetails', this.getPrimaryVideoInfo()); } } @@ -150,6 +156,7 @@ class CaptureVideo extends Component { getActionSheetText={this.getActionSheetText} navigation={this.props.navigation} isVideoTypeReply={this.isVideoTypeReply} + hasVideoReplies={this.state.hasVideoReplies} /> ); @@ -165,6 +172,7 @@ class CaptureVideo extends Component { goToDetailsScreen={() => { this.goToDetailsScreen(); }} + saveVideoPrimaryInfo={this.saveVideoPrimaryInfo} cachedvideoUrl={this.state.videoUri} navigation={this.props.navigation} /> diff --git a/src/components/CommonComponents/ReplyVideo/index.js b/src/components/CommonComponents/ReplyVideo/index.js index af78d673..bd8e3cfb 100644 --- a/src/components/CommonComponents/ReplyVideo/index.js +++ b/src/components/CommonComponents/ReplyVideo/index.js @@ -10,6 +10,8 @@ import pricer from '../../../services/Pricer'; import reply_video from '../../../assets/reply_video.png'; import Utilities from '../../../services/Utilities'; import CurrentUser from '../../../models/CurrentUser'; +import NavigationService from "../../../services/NavigationService"; +import utilities from "../../../services/Utilities"; const mapStateToProps = (state , ownProps) => { return { @@ -30,7 +32,7 @@ class ReplyVideo extends PureComponent { }; isDisabled = () => { - return !this.props.isReplyAllowed || this.props.isCreatorApproved != 1 || !this.props.isVideoUserActivated || !this.props.isCurrentUserActivated || !this.hasSufficientBalance(); + return !this.props.isReplyAllowed || !this.props.isVideoUserActivated || !this.props.isCurrentUserActivated || !this.hasSufficientBalance(); }; hasSufficientBalance = () => { @@ -42,11 +44,26 @@ class ReplyVideo extends PureComponent { }; replyVideo = ()=> { + if (this.props.videoReplyCount > 0){ this.props.navigation.push('VideoReplies', - {'videoId': this.props.videoId , - 'userId': this.props.userId, - 'fetchUrl': `/videos/${this.props.videoId}/replies` - }); + {'videoId': this.props.videoId , + 'userId': this.props.userId, + 'amount': this.props.requiredPepo, + 'videoReplyCount': this.props.videoReplyCount, + 'fetchUrl': `/videos/${this.props.videoId}/replies` + }); + } else { + let activeTab = NavigationService.getActiveTab(); + let params = { + videoTypeReply: true, + videoId: this.props.videoId, + userId: this.props.userId, + amount: this.props.requiredPepo, + videoReplyCount: this.props.videoReplyCount + }; + utilities.handleVideoUploadModal(activeTab, this.props.navigation, params); + } + }; render(){ diff --git a/src/components/FanVideoReplyDetails/TouchableButton.js b/src/components/FanVideoReplyDetails/TouchableButton.js new file mode 100644 index 00000000..d6a9f7f1 --- /dev/null +++ b/src/components/FanVideoReplyDetails/TouchableButton.js @@ -0,0 +1,18 @@ +import React from 'react'; +import { Image, Text, TouchableOpacity } from 'react-native'; +import Theme from '../../theme/styles'; +import source from '../../assets/heart.png' + +const TouchableButton = ({ TouchableStyles, TextStyles, textBeforeImage, textAfterImage, onPress, imgDimension, disabled = false }) => ( + + {textBeforeImage} + + {textAfterImage} + +); + +export default TouchableButton; diff --git a/src/components/FanVideoReplyDetails/index.js b/src/components/FanVideoReplyDetails/index.js new file mode 100644 index 00000000..4fce518e --- /dev/null +++ b/src/components/FanVideoReplyDetails/index.js @@ -0,0 +1,280 @@ +import React, { Component } from 'react'; +import { + Image, + ImageBackground, + TouchableOpacity, + View, + Text, + Keyboard, + ScrollView +} from 'react-native'; +import deepGet from 'lodash/get'; +import utilities from '../../services/Utilities'; +import CurrentUser from '../../models/CurrentUser'; +import styles from './styles'; +import VideoDescription from '../FanVideoDetails/VideoDescription'; +import BackArrow from '../CommonComponents/BackArrow'; +import Colors from '../../theme/styles/Colors'; +import playIcon from '../../assets/play_icon.png'; +import TouchableButton from './TouchableButton'; +import Theme from '../../theme/styles'; +import LinearGradient from 'react-native-linear-gradient'; +import VideoLink from '../FanVideoDetails/VideoLink'; +import reduxGetter from '../../services/ReduxGetters'; +import { connect } from 'react-redux'; +import Store from '../../store'; +import { upsertRecordedVideo } from '../../actions'; +import multipleClickHandler from '../../services/MultipleClickHandler'; +import { getBottomSpace } from 'react-native-iphone-x-helper'; +import { StackActions } from 'react-navigation'; +import PepoApi from "../../services/PepoApi"; +import DataContract from "../../constants/DataContract"; + +const mapStateToProps = (state, ownProps) => { + return { + recordedVideo: reduxGetter.getRecordedVideo() + }; +}; + +class FanVideoReplyDetails extends Component { + static navigationOptions = ({ navigation }) => { + return { + title: 'Post', + headerStyle: { + backgroundColor: Colors.white, + borderBottomWidth: 0, + shadowColor: '#000', + shadowOffset: { + width: 0, + height: 1 + }, + shadowOpacity: 0.1, + shadowRadius: 3 + }, + headerTitleStyle: { + fontFamily: 'AvenirNext-Medium' + }, + headerLeft: ( + { + FanVideoReplyDetails.saveToRedux(navigation); + navigation.goBack(); + })} + > + + + ) + }; + }; + + static saveToRedux = (navigation) => { + let desc = navigation.state.params.videoDesc, + link = navigation.state.params.videoLink; + Store.dispatch(upsertRecordedVideo({ video_desc: desc, video_link: link })); + }; + + constructor(props) { + super(props); + this.videoDesc = props.recordedVideo.video_desc || ''; + this.videoLink = props.recordedVideo.video_link || ''; + if (! props.recordedVideo.video_type ){ + // It means + this.replyObject = this.props.navigation.getParam('reply_obj'); + let videoType = this.props.navigation.getParam('video_type'); + Store.dispatch(upsertRecordedVideo({ reply_obj: this.replyObject, video_type: videoType })); + } else { + this.replyObject = props.recordedVideo.reply_obj; + } + + + console.log(this.replyObject, 'this.replyObject:::this.replyObject:::this.replyObject'); + this.state = { + viewStyle: { + paddingBottom: 10 + }, + error: null + }; + } + _keyboardShown = (e) => { + let keyboardHeight = deepGet(e, 'endCoordinates.height') || 350; + this.setState({ + viewStyle: { + paddingBottom: keyboardHeight - (15 + getBottomSpace([true])) + } + }); + }; + + _keyboardHidden = () => { + this.setState({ + viewStyle: { + paddingBottom: 10 + } + }); + }; + + componentWillMount() { + this.keyboardWillShowListener = Keyboard.addListener('keyboardWillShow', this._keyboardShown.bind(this)); + this.keyboardWillHideListener = Keyboard.addListener('keyboardWillHide', this._keyboardHidden.bind(this)); + + this.keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', this._keyboardShown.bind(this)); + this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this._keyboardHidden.bind(this)); + } + + componentDidMount() { + this.props.navigation.setParams({ + videoDesc: this.props.recordedVideo.video_desc, + videoLink: this.props.recordedVideo.video_link + }); + } + + componentWillUnmount() { + this.keyboardWillShowListener.remove(); + this.keyboardWillHideListener.remove(); + this.keyboardDidShowListener.remove(); + this.keyboardDidHideListener.remove(); + } + + enableStartUploadFlag = () => { + this.validateData().then((res)=>{ + Store.dispatch( + upsertRecordedVideo({ video_desc: this.videoDesc, video_link: this.videoLink, do_upload: true }) + ); + this.props.navigation.dispatch(StackActions.popToTop()); + this.props.navigation.dispatch(StackActions.popToTop()); + this.props.navigation.navigate('HomeScreen'); + }).catch((err)=>{ + // show error on UI. + }) ; + + + + }; + + + validateData = () => { + let params = {}; + params['video_description'] = this.videoDesc; + params['link'] = this.videoLink; + params['parent_kind'] = 'video'; + params['parent_id'] = this.replyObject.parent_video_id; + + return new Promise((resolve, reject) => { + new PepoApi(DataContract.replies.validateReply) + .post(params) + .then((res)=>{ + if (res && res.success){ + return resolve(res); + } else { + return reject(res); + } + }) + }); + }; + + onChangeDesc = (desc) => { + this.videoDesc = desc; + //Done for the value to be accessible in static navigationOptions + this.props.navigation.setParams({ + videoDesc: desc + }); + }; + + onChangeLink = (link) => { + this.videoLink = link; + //Done for the value to be accessible in static navigationOptions + this.props.navigation.setParams({ + videoLink: link + }); + }; + + setError = (error) => { + this.setState({ + error + }); + }; + + validLink = () => { + if (!this.videoLink) return true; + //synced with backend + if ( + !this.videoLink.match( + /^(http(s)?:\/\/)([a-zA-Z0-9-_@:%+~#=]{1,256}\.)+[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=*]*)$/i + ) + ) { + this.setState( + { + error: 'Invalid link' + }, + () => { + this.setError(this.state.error); + } + ); + return false; + } + return true; + }; + + getButtonText =() => { + return "Reply | " + }; + + getAmountToSend = () => { + return this.replyObject.amount_to_send || 0; + }; + + render() { + let imageUrl = this.props.recordedVideo.cover_image; + return ( + + + + { + FanVideoReplyDetails.saveToRedux(this.props.navigation); + this.props.navigation.goBack(); + })} + style={{ height: 100 }} + > + + + + + + + + Link + + + + + {this.state.error} + + { + this.enableStartUploadFlag(); + })} + /> + + + + ); + } +} + +export default connect(mapStateToProps)(FanVideoReplyDetails); diff --git a/src/components/FanVideoReplyDetails/styles.js b/src/components/FanVideoReplyDetails/styles.js new file mode 100644 index 00000000..993a8497 --- /dev/null +++ b/src/components/FanVideoReplyDetails/styles.js @@ -0,0 +1,70 @@ +import DefaultStyleGenerator from '../../theme/styles/DefaultStyleGenerator'; +import Colors from '../../theme/styles/Colors'; +import { Dimensions } from 'react-native'; +import { Header } from 'react-navigation-stack'; + +import { getStatusBarHeight, getBottomSpace, isIphoneX } from 'react-native-iphone-x-helper'; + +const safeAreaHeight = getStatusBarHeight() + getBottomSpace([true]); + +let stylesMap = { + container: { + backgroundColor: '#fff', + flex: 1, + justifyContent: 'space-between', + height: Dimensions.get('window').height - safeAreaHeight - Header.HEIGHT - 55 + }, + posterImageSkipFont: { + aspectRatio: 3 / 4, + height: 100, + justifyContent: 'center' + }, + playIconSkipFont: { + height: 14, + width: 14, + alignSelf: 'center' + }, + videoDescriptionItem: { + flexDirection: 'row', + borderBottomWidth: 1, + borderColor: '#ccd3cd', + paddingHorizontal: 15, + paddingVertical: 20 + }, + videoDescription: { + color: 'rgba(42, 41, 59, 0.8)', + // flex: 1, + flexWrap: 'wrap', + fontFamily: 'AvenirNext-Regular', + borderColor: 'transparent', + borderWidth: 0, + borderRadius: 0, + fontWeight: '300', + marginLeft: 10, + marginTop: 0, + padding: 0, + paddingTop: 0, + position: 'relative', + paddingLeft: 0, + height: 100 + }, + dropDownStyle: { + marginLeft: -90, + width: Dimensions.get('window').width, + shadowColor: '#000', + shadowOffset: { width: -1, height: 1 }, + shadowOpacity: 0.2, + elevation: 1 + }, + suggestionText: { + color: Colors.midNightblue, + fontSize: 16, + fontFamily: 'AvenirNext-Regular' + }, + suggestionTextWrapper: { + marginVertical: 9 + }, + linkText: { color: Colors.softBlue, flex: 3} +}; + +export default styles = DefaultStyleGenerator.generate(stylesMap); diff --git a/src/components/PreviewRecordedVideo/index.js b/src/components/PreviewRecordedVideo/index.js index 7f7c5399..3fedfaac 100644 --- a/src/components/PreviewRecordedVideo/index.js +++ b/src/components/PreviewRecordedVideo/index.js @@ -99,6 +99,7 @@ class PreviewRecordedVideo extends Component { do_discard: true }) ); + this.props.saveVideoPrimaryInfo(); this.props.goToRecordScreen(); } else if (buttonIndex == ACTION_SHEET_DESCTRUCTIVE_INDEX) { this.props.navigation.goBack(null); diff --git a/src/components/VideoRecorder/index.js b/src/components/VideoRecorder/index.js index 39a59a38..3b239bfd 100644 --- a/src/components/VideoRecorder/index.js +++ b/src/components/VideoRecorder/index.js @@ -39,6 +39,7 @@ class VideoRecorder extends Component { progress: 0, recordingInProgress: false, acceptedCameraTnC: this.props.acceptedCameraTnC, + hasVideoReplies: this.props.hasVideoReplies, cameraFrontMode: true, isLocalVideoPresent: false }; @@ -108,6 +109,7 @@ class VideoRecorder extends Component { do_discard: true }) ); + this.props.saveVideoPrimaryInfo(); } else if (buttonIndex == ACTION_SHEET_CONTINUE_INDEX) { //navigate to previous page this.props.proceedWithExistingVideo(this.recordedVideoObj); @@ -137,6 +139,12 @@ class VideoRecorder extends Component { }); }; + replyToVideo = () => { + this.setState({ + hasVideoReplies: true + }); + }; + flipCamera = () => { this.setState({ cameraFrontMode: !this.state.cameraFrontMode }); }; @@ -159,6 +167,46 @@ class VideoRecorder extends Component { if (this.props.isVideoTypeReply) { // TODO: return coach for posting + if (! this.state.hasVideoReplies){ + // Show video + return + + + + Post a reply + + + + + Approval process + + + Be the first one to reply to @annikpolit’s video, once you postt the reply you will pay 5 Pepo Coins + + + + + + Reply + + + + + + + } // if (no video reply present) { return Coach } } else { if (this.state.acceptedCameraTnC !== 'true'){ @@ -239,8 +287,26 @@ class VideoRecorder extends Component { ); } + + shouldShowActionButtons = () => { + + if (this.state.isLocalVideoPresent){ + // If local video present, coach screen will not be seen. So we need to show action buttons. + return true; + } + + if (this.props.isVideoTypeReply){ + // If video type is reply and has video replies then we will not show coach and we need to show action buttons + return this.state.hasVideoReplies; + } else { + // If video type is post and terms and conditions are accepted then we will not show coach and we need to show action buttons + return this.state.acceptedCameraTnC === 'true'; + } + + }; + showCameraActions = () => { - if (this.state.acceptedCameraTnC == 'true') { + if (this.shouldShowActionButtons()) { return ( { + let activeTab = NavigationService.getActiveTab(); + let params = { + videoTypeReply: true, + videoId: navigation.getParam('videoId'), + userId: navigation.getParam('userId'), + amount: navigation.getParam('amount'), + videoReplyCount: navigation.getParam('videoReplyCount') + }; + utilities.handleVideoUploadModal(activeTab, navigation, params); +}; + const HeaderLeft = (props) => { return ( @@ -29,8 +46,8 @@ const HeaderLeft = (props) => { }; const HeaderRight = (props) => { - return ({ - props.navigation.push('CaptureVideo') + return ( { + navigateToCamera(props.navigation); }} style={inlineStyles.iconWrapper} > ) @@ -61,15 +78,19 @@ class VideoRepliesScreen extends PureComponent { super(props); this.userId = props.navigation.getParam('userId'); this.videoId = props.navigation.getParam('videoId'); + this.amount = props.navigation.getParam('amount'); + this.videoReplyCount = props.navigation.getParam('videoReplyCount'); this.fetchUrl = props.navigation.getParam('fetchUrl'); + this.listHeaderComponent = props.navigation.getParam('listHeaderComponent'); + this.listHeaderSubComponent = props.navigation.getParam('listHeaderSubComponent'); } componentDidMount(){ - + } componentWillUnmount() { - + } render(){ diff --git a/src/components/VideoRepliesFullScreen/index.js b/src/components/VideoRepliesFullScreen/index.js index 920d591f..818bae4d 100644 --- a/src/components/VideoRepliesFullScreen/index.js +++ b/src/components/VideoRepliesFullScreen/index.js @@ -7,6 +7,23 @@ import inlineStyles from "./styles"; import backIcon from '../../assets/back-arrow.png'; import plusIcon from '../../assets/user-video-capture-icon-selected.png'; import VideoReply from "./VideoReply"; +import NavigationService from "../../services/NavigationService"; +import utilities from '../../services/Utilities'; + + + +const navigateToCamera = (navigation) => { + let activeTab = NavigationService.getActiveTab(); + let params = { + videoTypeReply: true, + videoId: navigation.getParam('payload').video_id, + userId: navigation.getParam('payload').user_id, + amount: navigation.getParam('amount'), + videoReplyCount: navigation.getParam('videoReplyCount') + }; + console.log('params:::VideoRepliesFullScreen', params); + utilities.handleVideoUploadModal(activeTab, navigation, params); +}; const maxVideosThreshold = 3; const HeaderLeft = (props) => { @@ -24,7 +41,7 @@ const HeaderLeft = (props) => { const HeaderRight = (props) => { return ({ - props.navigation.push('CaptureVideo') + navigateToCamera(props.navigation); }} style={inlineStyles.iconWrapper} > ) @@ -36,7 +53,7 @@ const HeaderLeft = (props) => { Replies to Frankie - Send a reply with Pepo5 + Send a reply with Pepo 5 ); }; diff --git a/src/constants/DataContract.js b/src/constants/DataContract.js index a0e5f2c0..fd8fc814 100644 --- a/src/constants/DataContract.js +++ b/src/constants/DataContract.js @@ -37,6 +37,10 @@ export default { infoApi: "/support/info" }, + replies: { + validateReply: "replies/validate-upload" + }, + common: { resultType : "data.result_type" } diff --git a/src/services/CameraWorker.js b/src/services/CameraWorker.js index a262e788..61007edf 100644 --- a/src/services/CameraWorker.js +++ b/src/services/CameraWorker.js @@ -28,7 +28,9 @@ const recordedVideoStates = [ 'cover_image', 's3_cover_image', 'video_desc', - 'video_link' + 'video_link', + 'video_type', + 'reply_obj' ]; const processingStatuses = [ diff --git a/src/store/index.js b/src/store/index.js index 14a81640..eb3ee768 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -2,7 +2,7 @@ import { createStore, applyMiddleware } from 'redux'; import logger from 'redux-logger'; import { reducer } from '../reducers'; -// export const store = __DEV__ === true ? createStore(reducer, applyMiddleware(logger)) : createStore(reducer); -export const store = createStore(reducer); +export const store = __DEV__ === true ? createStore(reducer, applyMiddleware(logger)) : createStore(reducer); +// export const store = createStore(reducer); export default store; From a17714bea67d71050b6c1c0a87314253050afd15 Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Mon, 11 Nov 2019 20:47:33 +0530 Subject: [PATCH 015/302] reply video post --- src/components/VideoRecorder/index.js | 9 +++------ src/components/VideoRecorder/styles.js | 8 ++++++++ src/components/VideoReplies/index.js | 6 +++++- src/components/VideoReplies/list.js | 6 +++++- src/components/VideoRepliesFullScreen/index.js | 4 ++-- 5 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/components/VideoRecorder/index.js b/src/components/VideoRecorder/index.js index 3b239bfd..72f4d681 100644 --- a/src/components/VideoRecorder/index.js +++ b/src/components/VideoRecorder/index.js @@ -170,17 +170,14 @@ class VideoRecorder extends Component { if (! this.state.hasVideoReplies){ // Show video return - + - + Post a reply - - Approval process - - + Be the first one to reply to @annikpolit’s video, once you postt the reply you will pay 5 Pepo Coins diff --git a/src/components/VideoRecorder/styles.js b/src/components/VideoRecorder/styles.js index 79f6b1a6..8436b61d 100644 --- a/src/components/VideoRecorder/styles.js +++ b/src/components/VideoRecorder/styles.js @@ -93,6 +93,14 @@ let stylesMap = { fontFamily: 'AvenirNext-Medium' }, + miniText: { + color: Colors.white, + fontSize: 16, + letterSpacing: 0.5, + marginTop: 14, + fontFamily: 'AvenirNext-Medium' + }, + headerText: { color: Colors.white, fontWeight: '600', diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index 4ca8a78a..43f9c5b2 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -97,7 +97,11 @@ class VideoRepliesScreen extends PureComponent { return ( - + ); } diff --git a/src/components/VideoReplies/list.js b/src/components/VideoReplies/list.js index 4e9fee4d..5694bf40 100644 --- a/src/components/VideoReplies/list.js +++ b/src/components/VideoReplies/list.js @@ -182,7 +182,11 @@ class VideoReplyList extends PureComponent { "payload": payload, "baseUrl": this.props.fetchUrl, "showBalanceFlyer": this.showBalanceFlyer, - "videoThumbnailMeasurements": videoThumbnailMeasurements + "videoThumbnailMeasurements": videoThumbnailMeasurements, + "amount": this.props.amount, + "videoReplyCount": this.props.videoReplyCount, + 'parentUserId': this.props.userId, + 'parentVideoId': this.props.videoId }); } renderFooter = () => { diff --git a/src/components/VideoRepliesFullScreen/index.js b/src/components/VideoRepliesFullScreen/index.js index 818bae4d..c67635ab 100644 --- a/src/components/VideoRepliesFullScreen/index.js +++ b/src/components/VideoRepliesFullScreen/index.js @@ -16,8 +16,8 @@ const navigateToCamera = (navigation) => { let activeTab = NavigationService.getActiveTab(); let params = { videoTypeReply: true, - videoId: navigation.getParam('payload').video_id, - userId: navigation.getParam('payload').user_id, + videoId: navigation.getParam('parentVideoId'), + userId: navigation.getParam('parentUserId'), amount: navigation.getParam('amount'), videoReplyCount: navigation.getParam('videoReplyCount') }; From bbffc551f16c54560a354fcfc34a63da17377224 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Mon, 11 Nov 2019 20:57:20 +0530 Subject: [PATCH 016/302] add files --- .../CommonComponents/ReplyIcon/index.js | 67 +++++ .../CommonComponents/ReplyIcon/styles.js | 24 ++ .../FullScreenReplyCollection/VideoReply.js | 109 ++++++++ .../FullScreenReplyCollection/index.js | 246 ++++++++++++++++++ .../FullScreenReplyCollection/styles.js | 117 +++++++++ src/components/ReplyCollection/index.js | 201 ++++++++++++++ 6 files changed, 764 insertions(+) create mode 100644 src/components/CommonComponents/ReplyIcon/index.js create mode 100644 src/components/CommonComponents/ReplyIcon/styles.js create mode 100644 src/components/FullScreenReplyCollection/VideoReply.js create mode 100644 src/components/FullScreenReplyCollection/index.js create mode 100644 src/components/FullScreenReplyCollection/styles.js create mode 100644 src/components/ReplyCollection/index.js diff --git a/src/components/CommonComponents/ReplyIcon/index.js b/src/components/CommonComponents/ReplyIcon/index.js new file mode 100644 index 00000000..5ba9b691 --- /dev/null +++ b/src/components/CommonComponents/ReplyIcon/index.js @@ -0,0 +1,67 @@ +import React, { PureComponent } from 'react'; +import {TouchableOpacity , Image, View, Text} from "react-native"; +import { connect } from 'react-redux'; +import {withNavigation} from "react-navigation"; + +import reduxGetter from '../../../services/ReduxGetters'; +import inlineStyles from './styles'; +import multipleClickHandler from "../../../services/MultipleClickHandler"; +import pricer from '../../../services/Pricer'; +import reply_video from '../../../assets/reply_video.png'; +import Utilities from '../../../services/Utilities'; +import CurrentUser from '../../../models/CurrentUser'; + +const mapStateToProps = (state , ownProps) => { + return { + isCreatorApproved : reduxGetter.isCreatorApproved(ownProps.userId), + isVideoUserActivated : Utilities.isUserActivated(reduxGetter.getUserActivationStatus(ownProps.userId)), + isCurrentUserActivated : CurrentUser.isUserActivated(), + balance : state.balance, + requiredPepo : reduxGetter.getVideoReplyAmount(ownProps.videoId, state), + videoReplyCount : reduxGetter.getVideoReplyCount(ownProps.videoId, state), + isReplyAllowed : reduxGetter.getVideoReplyAllowed(ownProps.videoId, state) + } +}; + +class ReplyIcon extends PureComponent { + + constructor(props){ + super(props); + }; + + isDisabled = () => { + return !this.props.isReplyAllowed || this.props.isCreatorApproved != 1 || !this.props.isVideoUserActivated || !this.props.isCurrentUserActivated || !this.hasSufficientBalance(); + }; + + hasSufficientBalance = () => { + return this.getBalanceToNumber() >= this.props.requiredPepo ? true : false; + }; + + getBalanceToNumber = () => { + return (this.props.balance && Math.floor(Number(pricer.getFromDecimal(this.props.balance)))) || 0; + }; + + replyVideo = ()=> { + this.props.navigation.push('VideoReplies', + {'videoId': this.props.videoId , + 'userId': this.props.userId, + 'fetchUrl': `/videos/${this.props.videoId}/replies` + }); + }; + + render(){ + return ( + + {this.props.videoReplyCount} + this.replyVideo())} > + + + ); + } + +}; + +export default connect(mapStateToProps)(withNavigation(ReplyIcon)); diff --git a/src/components/CommonComponents/ReplyIcon/styles.js b/src/components/CommonComponents/ReplyIcon/styles.js new file mode 100644 index 00000000..20f8a946 --- /dev/null +++ b/src/components/CommonComponents/ReplyIcon/styles.js @@ -0,0 +1,24 @@ +import DefaultStyleGenerator from '../../../theme/styles/DefaultStyleGenerator'; +import Colors from '../../../theme/styles/Colors'; + +let stylesMap = { + + replyIconWrapper : { + marginBottom: 5, + height: 50, + width: 50, + alignItems: 'center', + justifyContent: 'center' + }, + videoReplyCount : { + fontSize: 18, + color: Colors.white, + alignSelf: 'center', + textShadowColor: 'rgba(0, 0, 0, 0.65)', + textShadowOffset: {width: 1, height: 1}, + textShadowRadius: 1, + fontFamily: 'AvenirNext-DemiBold' + } +}; + +export default styles = DefaultStyleGenerator.generate(stylesMap); diff --git a/src/components/FullScreenReplyCollection/VideoReply.js b/src/components/FullScreenReplyCollection/VideoReply.js new file mode 100644 index 00000000..d7ddaebe --- /dev/null +++ b/src/components/FullScreenReplyCollection/VideoReply.js @@ -0,0 +1,109 @@ +import React, { PureComponent } from 'react'; +import { View } from 'react-native'; +import { withNavigation } from 'react-navigation'; +import VideoWrapper from '../Home/VideoWrapper'; +import ShareIcon from "../CommonComponents/ShareIcon"; +import ReportVideo from "../CommonComponents/ReportVideo"; +import PepoApi from '../../services/PepoApi'; +import TransactionPepoButton from '../Home/TransactionPepoButton'; +import deepGet from 'lodash/get'; +import CurrentUser from '../../models/CurrentUser'; + +import BottomStatus from '../Home/BottomStatus'; +import VideoAmountStat from '../CommonComponents/VideoAmoutStat'; +import ShareVideo from '../../services/shareVideo'; +import inlineStyles from './styles'; + +import utilities from '../../services/Utilities'; + + +class VideoReply extends PureComponent { + constructor(props) { + super(props); + this.userId = deepGet(this.props.payload, 'user_id'); + this.replyId = deepGet(this.props.payload, 'video_id');//reply_id replace + } + + refetchVideoReply = () => { + new PepoApi(`/videos/${this.videoId}`)// new PepoApi(`/replies/${this.replyId}`) + .get() + .then((res) => {}) + .catch((error) => {}); + }; + + + + shareVideo = () => { + let shareVideo = new ShareVideo(this.replyId); + shareVideo.perform(); + }; + + navigateToUserProfile = (e) => { + if (utilities.checkActiveUser()) { + if (this.userId == CurrentUser.getUserId()) { + this.props.navigation.navigate('ProfileScreen'); + } else { + this.props.navigation.push('UsersProfileScreen', { userId: this.userId }); + } + } + }; + + onDescriptionClick = ( tapEntity ) => { + if (!tapEntity) { + return; + } + + if( tapEntity.kind === 'tags'){ + this.props.navigation.push('VideoTags', { + "tagId": tapEntity.id + }); + } + + } + + render() { + return ( + + + + {!!this.replyId && !!this.userId && ( + + + + + + + + + + + + + + + )} + + ); + } +} + +export default withNavigation(VideoReply); diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js new file mode 100644 index 00000000..caa0a9ab --- /dev/null +++ b/src/components/FullScreenReplyCollection/index.js @@ -0,0 +1,246 @@ +import React , {PureComponent} from "react"; +import {FlatList , View , TouchableOpacity, Image, Text, StatusBar} from "react-native"; +import deepGet from "lodash/get"; + +import Pagination from "../../services/Pagination"; +import inlineStyles from "./styles"; +import backIcon from '../../assets/back-arrow.png'; +import plusIcon from '../../assets/user-video-capture-icon-selected.png'; +import VideoReply from "./VideoReply"; + +const maxVideosThreshold = 3; +const HeaderLeft = (props) => { + return ( + { + props.navigation.goBack(); + }} + style={inlineStyles.iconWrapper} + > + + + ); + }; + + const HeaderRight = (props) => { + return ({ + props.navigation.push('CaptureVideo') + }} style={inlineStyles.iconWrapper} > + + ) + }; + + const HeaderTitle = (props) => { + return ( + + + Replies to Frankie + + Send a reply with Pepo5 + + ); + }; + +class FullScreenReplyCollection extends PureComponent{ + + static navigationOptions = (props) => { + return { + headerBackTitle: null, + headerStyle: inlineStyles.headerStyles, + headerLeft: , + headerRight: , + headerTitle: + }; + }; + + constructor(props){ + super(props); + this.setVideoPagination(); + this.paginationEvent = this.getVideoPagination().event; + this.currentIndex = this.props.navigation.getParam("currentIndex"); + this.isScrolled = false ; + this.willFocusSubscription = null ; + this.flatlistRef = null; + + this.state = { + list : this.getVideoPagination().getResults(), + activeIndex: this.currentIndex, + refreshing : false, + loadingNext: false + }; + this.isActiveScreen = true; + } + + getBaseUrl(){ + return this.props.navigation.getParam("baseUrl"); + } + + getPassedFetchServices(){ + return this.props.navigation.getParam("fetchServices") + } + + setVideoPagination(){ + this.fullPagePagination = new Pagination( this.getBaseUrl(), null , this.getPassedFetchServices()); + } + + getVideoPagination(){ + return this.fullPagePagination; + } + + componentDidMount(){ + this.paginationEvent.on("onBeforeRefresh" , this.beforeRefresh.bind(this) ); + this.paginationEvent.on("onRefresh" , this.onRefresh.bind(this) ); + this.paginationEvent.on("onRefreshError" , this.onRefreshError.bind(this) ); + this.paginationEvent.on("onBeforeNext" , this.beforeNext.bind(this) ); + this.paginationEvent.on("onNext" , this.onNext.bind(this) ); + this.paginationEvent.on("onNextError" , this.onNextError.bind(this) ); + + //This is an hack for reset scroll for flatlist. Need to debug a bit more. + this.willFocusSubscription = this.props.navigation.addListener('willFocus', (payload) => { + const offset = this.state.activeIndex > 0 ? inlineStyles.fullScreen.height * this.state.activeIndex : 0 ; + this.flatlistRef && this.flatlistRef.scrollToOffset({offset: offset , animated: false}); + this.isActiveScreen = true ; + }); + + this.willBlurSubscription = this.props.navigation.addListener('willBlur', (payload) => { + this.isActiveScreen = false ; + }); + } + + componentWillUnmount(){ + this.paginationEvent.removeListener('onBeforeRefresh'); + this.paginationEvent.removeListener('onRefresh'); + this.paginationEvent.removeListener('onRefreshError'); + this.paginationEvent.removeListener('onBeforeNext'); + this.paginationEvent.removeListener('onNext'); + this.paginationEvent.removeListener('onNextError'); + this.willFocusSubscription && this.willFocusSubscription.remove(); + this.willBlurSubscription && this.willBlurSubscription.remove(); + } + + shouldPlay = () => { + return this.isActiveScreen; + }; + + beforeRefresh = ( ) => { + this.setState({ refreshing : true }); + } + + onRefresh = ( res ) => { + let paginationService = this.getVideoPagination(); + let resultList = paginationService.getResults(); + this.setState({ refreshing : false , list : resultList }); + } + + onRefreshError = ( error ) => { + this.setState({ refreshing : false }); + } + + beforeNext =() => { + this.isScrolled = false; + this.setState({ loadingNext : true }); + } + + onNext = ( res ) => { + let paginationService = this.getVideoPagination(); + let resultList = paginationService.getResults(); + this.setState({ loadingNext : false , list : resultList }); + } + + onNextError = ( error ) => { + this.setState({ loadingNext : false }); + } + + getNext = () => { + // if(!this.isScrolled) return; + this.getVideoPagination().getNext(); + } + + refresh = () => { + this.getVideoPagination().refresh(); + } + + _keyExtractor = (item, index) => { + return `id_${item.id}`; + } + + _renderItem = ({ item, index }) => { + const payload = item.payload; + return ; + }; + + onViewableItemsChanged = (data) => { + this.currentIndex = deepGet(data, 'viewableItems[0].index') || 0; + } + + setActiveIndex() { + this.setState({ activeIndex: this.currentIndex }); + } + + onMomentumScrollEndCallback = () => { + this.setActiveIndex(); + }; + + onMomentumScrollBeginCallback = () => { + this.isScrolled = true; + } + + onScrollToIndexFailed =( info) => { + console.log("======onScrollToIndexFailed=====" , info ); + } + + getItemLayout= (data, index) => { + return {length: inlineStyles.fullScreen.height, offset: inlineStyles.fullScreen.height * index, index} ; + } + + closeVideo = () => { + this.navigateBack(); + }; + + navigateBack() { + this.props.navigation.goBack(); + } + + onScrollToTop = () => { + this.setActiveIndex(); + } + + render() { + + return ( + + + {this.flatlistRef = ref }} + onEndReachedThreshold={7} + onViewableItemsChanged={this.onViewableItemsChanged} + onMomentumScrollEnd={this.onMomentumScrollEndCallback} + onMomentumScrollBegin={this.onMomentumScrollBeginCallback} + renderItem={this._renderItem} + style={[inlineStyles.fullScreen , {backgroundColor: "#000"}]} + showsVerticalScrollIndicator={false} + onScrollToTop={this.onScrollToTop} + initialScrollIndex={this.state.activeIndex} + getItemLayout={this.getItemLayout} + onScrollToIndexFailed={this.onScrollToIndexFailed} + /> + + ); + } + +} + +export default FullScreenReplyCollection ; diff --git a/src/components/FullScreenReplyCollection/styles.js b/src/components/FullScreenReplyCollection/styles.js new file mode 100644 index 00000000..f23d9c3d --- /dev/null +++ b/src/components/FullScreenReplyCollection/styles.js @@ -0,0 +1,117 @@ +import { Dimensions, StatusBar, NativeModules } from 'react-native'; +import DefaultStyleGenerator from '../../theme/styles/DefaultStyleGenerator'; +import Colors from '../../theme/styles/Colors'; +import { ifIphoneX, getBottomSpace , getStatusBarHeight} from 'react-native-iphone-x-helper'; + +import NotchHelper from "../../helpers/NotchHelper"; +import { HEADER_HEIGHT } from '../../theme/constants'; +const {width, height} = Dimensions.get('window'); +const statusBarHeight = StatusBar.currentHeight || 20; + + +let RNDeviceInfo = NativeModules.RNDeviceInfo; +let modalDeviceName = RNDeviceInfo.model === "Redmi Note 7 Pro" && RNDeviceInfo.brand === "xiaomi"; +let btmSpace = modalDeviceName ? 5 : 0; + +let stylesMap = { + fullScreen: { + width: width, + ...ifIphoneX( + { + height: height - HEADER_HEIGHT - getStatusBarHeight(true) + }, + { + height: + NotchHelper.hasNotch() + ? height + statusBarHeight - btmSpace - HEADER_HEIGHT + : height - statusBarHeight - HEADER_HEIGHT + } + ) + }, + touchablesBtns: { + alignSelf: 'flex-end', + marginBottom: -15, + zIndex: 1 + }, + pepoTxCount: { + fontSize: 18, + color: Colors.white, + alignSelf: 'center', + marginTop: 3, + marginBottom: 15 + }, + txElem: { + marginBottom: 20 + }, + bottomContainer: { + width: width, + position: 'absolute', + bottom: 0 + }, + bottomBg: { + backgroundColor: 'rgba(0, 0, 0, 0.6)', + borderTopLeftRadius: 20, + minHeight: height * 0.05, + paddingHorizontal: 12 + }, + handle: { + fontSize: 15, + paddingBottom: 3, + color: Colors.white, + fontFamily: 'AvenirNext-DemiBold', + fontWeight: '700' + }, + bottomBgTxt: { + color: Colors.white + }, + raisedSupported: { + backgroundColor: Colors.wildWatermelon2, + borderTopLeftRadius: 25, + borderBottomRightRadius: 25, + paddingHorizontal: 8, + minWidth: 120, + height: 40, + alignItems: 'center', + justifyContent: 'center', + marginRight: 10 + }, + raisedSupportedTxt: { + color: Colors.white, + fontSize: 14, + fontFamily: 'AvenirNext-DemiBold' + }, + btnText: { + color: Colors.white + }, + iconWrapper: { + flex: 1, + alignItems: 'center', + justifyContent: 'center', + height: 60, + width: 60 + }, + iconSkipFont: { + height: 20, + width: 20 + }, + headerStyles: { + backgroundColor: Colors.white, + borderBottomWidth: 0, + shadowColor: '#000', + shadowOffset: { + width: 0, + height: 1 + }, + shadowOpacity: 0.1, + shadowRadius: 3, + height: HEADER_HEIGHT + }, + headerText:{ + fontWeight: '600' + }, + headerSubText:{ + fontSize: 12 + } +}; + +export default styles = DefaultStyleGenerator.generate(stylesMap); diff --git a/src/components/ReplyCollection/index.js b/src/components/ReplyCollection/index.js new file mode 100644 index 00000000..c15e8cae --- /dev/null +++ b/src/components/ReplyCollection/index.js @@ -0,0 +1,201 @@ +import React, { PureComponent } from 'react'; +import { + FlatList, + ActivityIndicator, + StatusBar +} from "react-native"; +import {SafeAreaView, withNavigation} from "react-navigation"; + +import Pagination from "../../services/Pagination"; +import VideoThumbnailItem from '../CommonComponents/VideoThumbnailItem'; + +class VideoReplyList extends PureComponent { + + constructor(props){ + super(props); + + this.state = { + list : [], + refreshing : false, + loadingNext: false + }; + this.listRef = null; + + this.numColumns = 2; + } + + componentDidMount(){ + this.forcedRefresh(); + } + + componentWillUnmount() { + this.removePaginationListeners(); + } + + getPagination = () => { + return this.videoPagination; + }; + + // region - Pagination and Event Handlers + + initPagination() { + // First, take care of existing Pagination if exists. + this.removePaginationListeners(); + + // Now, create a new one. + let fetchUrl = this.props.fetchUrl; + this.videoPagination = new Pagination(fetchUrl); + this.bindPaginationEvents(); + } + + bindPaginationEvents(){ + let pagination = this.videoPagination; + if ( !pagination ) { + return; + } + let paginationEvent = pagination.event; + if ( null === paginationEvent ) { + return; + } + + paginationEvent.on("onBeforeRefresh" , this.beforeRefresh.bind(this) ); + paginationEvent.on("onRefresh" , this.onRefresh.bind(this) ); + paginationEvent.on("onRefreshError" , this.onRefreshError.bind(this)); + paginationEvent.on("onBeforeNext" , this.beforeNext.bind(this)); + paginationEvent.on("onNext" , this.onNext.bind(this) ); + paginationEvent.on("onNextError" , this.onNextError.bind(this)); + } + + removePaginationListeners(){ + let pagination = this.videoPagination; + if ( !pagination ) { + return; + } + let paginationEvent = pagination.event; + if ( null === paginationEvent ) { + return; + } + paginationEvent.removeListener('onBeforeRefresh'); + paginationEvent.removeListener('onRefresh'); + paginationEvent.removeListener('onRefreshError'); + paginationEvent.removeListener('onBeforeNext'); + paginationEvent.removeListener('onNext'); + paginationEvent.removeListener('onNextError'); + } + + forcedRefresh (fetchUrl){ + this.initPagination(); + this.refresh(); + } + + beforeRefresh = ( ) => { + this.setState({ refreshing : true }); + }; + + onRefresh = ( res ) => { + const list = this.getResultList(); + this.props.onRefresh && this.props.onRefresh( list , res ); + this.setState({ + refreshing : false, + list : list + }); + }; + + onRefreshError = ( error ) => { + this.setState({ refreshing : false }); + }; + + beforeNext =() => { + this.setState({ loadingNext : true }); + }; + + onNext = ( res ) => { + this.setState({ + loadingNext : false, + list : this.getResultList() + }); + } + + onNextError = ( error ) => { + this.setState({ loadingNext : false }); + }; + + getNext = () => { + this.videoPagination.getNext(); + }; + + refresh = () => { + this.videoPagination.refresh(); + }; + + _keyExtractor = (item, index) => { + return `id_${item.id}`; + } + + _renderItem = ({ item, index }) => { + // Render Video cell + return this._renderVideoCell({item,index}); + }; + + _renderVideoCell = ({ item, index }) => { + return ( {this.onVideoClick(item.payload, index, compRef)}}/>); + }; + + + + onVideoClick = (payload, index) => { + const clonedInstance = this.videoPagination.fetchServices.cloneInstance(); + this.props.navigation.push("FullScreenReplyCollection", { + "fetchServices" : clonedInstance, + "currentIndex": index, + "payload": payload, + "baseUrl": this.props.fetchUrl + }); + } + renderFooter = () => { + if (!this.state.loadingNext) return null; + return ; + }; + + getResultList(){ + let list = this.videoPagination.getResults(); + if( list.length > 0 ){ + this.numColumns = 2; + return list; + } + } + + scrollToTop(){ + this.listRef.scrollToOffset({offset: 0}); + } + + setListRef = (listRef) => { + this.listRef = listRef; + }; + + render(){ + return ( + + + + + ); + } + +} + +export default withNavigation( VideoReplyList ); From 22a1689069436b5cedaff1c5345703faa54da107 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Mon, 11 Nov 2019 21:19:02 +0530 Subject: [PATCH 017/302] merge code changes --- RootNavigationContainer.js | 12 +- .../CommonComponents/ReplyIcon/index.js | 31 ++- .../CommonComponents/ReplyVideo/styles.js | 24 -- .../FullScreenReplyCollection/index.js | 20 +- .../FullScreeVideoRow.js | 4 +- src/components/Home/HomeFeedRow.js | 4 +- src/components/ReplyCollection/index.js | 6 +- .../UserVideoHistory/UserVideoHistoryRow.js | 4 +- src/components/VideoReplies/index.js | 30 +-- src/components/VideoReplies/list.js | 251 ------------------ .../VideoRepliesFullScreen/VideoReply.js | 109 -------- .../VideoRepliesFullScreen/styles.js | 118 -------- src/theme/constants/index.js | 3 +- 13 files changed, 74 insertions(+), 542 deletions(-) delete mode 100644 src/components/CommonComponents/ReplyVideo/styles.js delete mode 100644 src/components/VideoReplies/list.js delete mode 100644 src/components/VideoRepliesFullScreen/VideoReply.js delete mode 100644 src/components/VideoRepliesFullScreen/styles.js diff --git a/RootNavigationContainer.js b/RootNavigationContainer.js index 3e8dde82..bfe135d4 100644 --- a/RootNavigationContainer.js +++ b/RootNavigationContainer.js @@ -59,7 +59,7 @@ import RedemptiomScreen from './src/components/Redemption'; import VideoTags from './src/components/VideoTags'; import FullScreenVideoCollection from './src/components/FullScreenVideoCollection'; import VideoReplies from './src/components/VideoReplies'; -import VideoRepliesFullScreen from './src/components/VideoRepliesFullScreen'; +import FullScreenReplyCollection from './src/components/FullScreenReplyCollection'; const customTabHiddenRoutes = [ 'CaptureVideo', @@ -70,7 +70,7 @@ const customTabHiddenRoutes = [ 'InAppBrowserComponent', 'CouchMarks', 'VideoReplies', - 'VideoRepliesFullScreen' + 'FullScreenReplyCollection' ]; const modalStackConfig = { @@ -141,7 +141,7 @@ const HomePushStack = createStackNavigator( UsersProfileScreen: UsersProfileScreen, UserVideoHistory: UserVideoHistory, VideoReplies: VideoReplies, - VideoRepliesFullScreen: VideoRepliesFullScreen, + FullScreenReplyCollection: FullScreenReplyCollection, SupportingListScreen: SupportingListScreen, SupportersListScreen: SupportersListScreen, VideoTags: VideoTags, @@ -176,7 +176,7 @@ const NotificationPushStack = createStackNavigator( UsersProfileScreen: UsersProfileScreen, UserVideoHistory: UserVideoHistory, VideoReplies: VideoReplies, - VideoRepliesFullScreen: VideoRepliesFullScreen, + FullScreenReplyCollection: FullScreenReplyCollection, VideoPlayer: VideoPlayer, SupportingListScreen: SupportingListScreen, SupportersListScreen: SupportersListScreen, @@ -205,7 +205,7 @@ const ProfilePushStack = createStackNavigator( ProfileScreen: ProfileScreen, UserVideoHistory: UserVideoHistory, VideoReplies: VideoReplies, - VideoRepliesFullScreen: VideoRepliesFullScreen, + FullScreenReplyCollection: FullScreenReplyCollection, SupportingListScreen: SupportingListScreen, SupportersListScreen: SupportersListScreen, UsersProfileScreen: UsersProfileScreen, @@ -257,7 +257,7 @@ const SearchPushStack = createStackNavigator( SupportersListScreen: SupportersListScreen, UserVideoHistory: UserVideoHistory, VideoReplies: VideoReplies, - VideoRepliesFullScreen: VideoRepliesFullScreen, + FullScreenReplyCollection: FullScreenReplyCollection, VideoTags: VideoTags, FullScreenVideoCollection: FullScreenVideoCollection }, diff --git a/src/components/CommonComponents/ReplyIcon/index.js b/src/components/CommonComponents/ReplyIcon/index.js index 5ba9b691..0467da30 100644 --- a/src/components/CommonComponents/ReplyIcon/index.js +++ b/src/components/CommonComponents/ReplyIcon/index.js @@ -10,6 +10,8 @@ import pricer from '../../../services/Pricer'; import reply_video from '../../../assets/reply_video.png'; import Utilities from '../../../services/Utilities'; import CurrentUser from '../../../models/CurrentUser'; +import NavigationService from "../../../services/NavigationService"; +import utilities from "../../../services/Utilities"; const mapStateToProps = (state , ownProps) => { return { @@ -30,7 +32,7 @@ class ReplyIcon extends PureComponent { }; isDisabled = () => { - return !this.props.isReplyAllowed || this.props.isCreatorApproved != 1 || !this.props.isVideoUserActivated || !this.props.isCurrentUserActivated || !this.hasSufficientBalance(); + return !this.props.isReplyAllowed || !this.props.isVideoUserActivated || !this.props.isCurrentUserActivated || !this.hasSufficientBalance(); }; hasSufficientBalance = () => { @@ -42,12 +44,27 @@ class ReplyIcon extends PureComponent { }; replyVideo = ()=> { - this.props.navigation.push('VideoReplies', - {'videoId': this.props.videoId , - 'userId': this.props.userId, - 'fetchUrl': `/videos/${this.props.videoId}/replies` - }); - }; + if (this.props.videoReplyCount > 0 || true){ + this.props.navigation.push('VideoReplies', + {'videoId': this.props.videoId , + 'userId': this.props.userId, + 'amount': this.props.requiredPepo, + 'videoReplyCount': 1, + 'fetchUrl': `/videos/${this.props.videoId}/replies` + }); + } else { + let activeTab = NavigationService.getActiveTab(); + let params = { + videoTypeReply: true, + videoId: this.props.videoId, + userId: this.props.userId, + amount: this.props.requiredPepo, + videoReplyCount: this.props.videoReplyCount + }; + utilities.handleVideoUploadModal(activeTab, this.props.navigation, params); + } + + }; render(){ return ( diff --git a/src/components/CommonComponents/ReplyVideo/styles.js b/src/components/CommonComponents/ReplyVideo/styles.js deleted file mode 100644 index 20f8a946..00000000 --- a/src/components/CommonComponents/ReplyVideo/styles.js +++ /dev/null @@ -1,24 +0,0 @@ -import DefaultStyleGenerator from '../../../theme/styles/DefaultStyleGenerator'; -import Colors from '../../../theme/styles/Colors'; - -let stylesMap = { - - replyIconWrapper : { - marginBottom: 5, - height: 50, - width: 50, - alignItems: 'center', - justifyContent: 'center' - }, - videoReplyCount : { - fontSize: 18, - color: Colors.white, - alignSelf: 'center', - textShadowColor: 'rgba(0, 0, 0, 0.65)', - textShadowOffset: {width: 1, height: 1}, - textShadowRadius: 1, - fontFamily: 'AvenirNext-DemiBold' - } -}; - -export default styles = DefaultStyleGenerator.generate(stylesMap); diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index caa0a9ab..96e3da63 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -6,7 +6,23 @@ import Pagination from "../../services/Pagination"; import inlineStyles from "./styles"; import backIcon from '../../assets/back-arrow.png'; import plusIcon from '../../assets/user-video-capture-icon-selected.png'; -import VideoReply from "./VideoReply"; +import VideoReply from "./VideoReply";import NavigationService from "../../services/NavigationService"; +import utilities from '../../services/Utilities'; + + + +const navigateToCamera = (navigation) => { + let activeTab = NavigationService.getActiveTab(); + let params = { + videoTypeReply: true, + videoId: navigation.getParam('parentVideoId'), + userId: navigation.getParam('parentUserId'), + amount: navigation.getParam('amount'), + videoReplyCount: navigation.getParam('videoReplyCount') + }; + console.log('params:::VideoRepliesFullScreen', params); + utilities.handleVideoUploadModal(activeTab, navigation, params); +}; const maxVideosThreshold = 3; const HeaderLeft = (props) => { @@ -24,7 +40,7 @@ const HeaderLeft = (props) => { const HeaderRight = (props) => { return ({ - props.navigation.push('CaptureVideo') + navigateToCamera(props.navigation); }} style={inlineStyles.iconWrapper} > ) diff --git a/src/components/FullScreenVideoCollection/FullScreeVideoRow.js b/src/components/FullScreenVideoCollection/FullScreeVideoRow.js index c960e7b9..812fea9d 100644 --- a/src/components/FullScreenVideoCollection/FullScreeVideoRow.js +++ b/src/components/FullScreenVideoCollection/FullScreeVideoRow.js @@ -16,7 +16,7 @@ import inlineStyles from './styles'; import utilities from '../../services/Utilities'; import OptionsIcon from '../../assets/options_self_video.png'; -import ReplyVideo from '../CommonComponents/ReplyVideo'; +import ReplyIcon from '../CommonComponents/ReplyIcon'; class FullScreeVideoRow extends PureComponent { @@ -84,7 +84,7 @@ class FullScreeVideoRow extends PureComponent { userId={this.userId} videoId={this.videoId} /> - + diff --git a/src/components/Home/HomeFeedRow.js b/src/components/Home/HomeFeedRow.js index ec220cb3..de6afc3f 100644 --- a/src/components/Home/HomeFeedRow.js +++ b/src/components/Home/HomeFeedRow.js @@ -15,7 +15,7 @@ import VideoAmountStat from '../CommonComponents/VideoAmoutStat'; import inlineStyles from './styles'; import utilities from '../../services/Utilities'; import ReportVideo from "../CommonComponents/ReportVideo"; -import ReplyVideo from '../CommonComponents/ReplyVideo'; +import ReplyIcon from '../CommonComponents/ReplyIcon'; class HomeFeedRow extends PureComponent { constructor(props) { @@ -94,7 +94,7 @@ class HomeFeedRow extends PureComponent { userId={this.userId} videoId={this.videoId} /> - + diff --git a/src/components/ReplyCollection/index.js b/src/components/ReplyCollection/index.js index c15e8cae..a783314f 100644 --- a/src/components/ReplyCollection/index.js +++ b/src/components/ReplyCollection/index.js @@ -152,7 +152,11 @@ class VideoReplyList extends PureComponent { "fetchServices" : clonedInstance, "currentIndex": index, "payload": payload, - "baseUrl": this.props.fetchUrl + "baseUrl": this.props.fetchUrl, + "amount": this.props.amount, + "videoReplyCount": this.props.videoReplyCount, + 'parentUserId': this.props.userId, + 'parentVideoId': this.props.videoId }); } renderFooter = () => { diff --git a/src/components/UserVideoHistory/UserVideoHistoryRow.js b/src/components/UserVideoHistory/UserVideoHistoryRow.js index af06a254..133d6da8 100644 --- a/src/components/UserVideoHistory/UserVideoHistoryRow.js +++ b/src/components/UserVideoHistory/UserVideoHistoryRow.js @@ -15,7 +15,7 @@ import ShareVideo from '../../services/shareVideo'; import inlineStyles from './styles'; import utilities from '../../services/Utilities'; -import ReplyVideo from '../CommonComponents/ReplyVideo'; +import ReplyIcon from '../CommonComponents/ReplyIcon'; class UserVideoHistoryRow extends PureComponent { @@ -84,7 +84,7 @@ class UserVideoHistoryRow extends PureComponent { userId={this.props.userId} videoId={this.props.videoId} /> - + diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index 43f9c5b2..74ff8d09 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -1,8 +1,6 @@ import React, { PureComponent } from 'react'; import { View, - FlatList, - ActivityIndicator, Text, Image, TouchableOpacity, @@ -13,22 +11,21 @@ import {SafeAreaView} from "react-navigation"; import plusIcon from '../../assets/user-video-capture-icon-selected.png'; import inlineStyles from './styles'; import crossIcon from '../../assets/cross_icon.png'; -import VideoReplyList from "./list"; -import VideoThumbnailItem from '../CommonComponents/VideoThumbnailItem'; +import ReplyCollection from '../ReplyCollection'; import NavigationService from "../../services/NavigationService"; import utilities from "../../services/Utilities"; const navigateToCamera = (navigation) => { - let activeTab = NavigationService.getActiveTab(); - let params = { - videoTypeReply: true, - videoId: navigation.getParam('videoId'), - userId: navigation.getParam('userId'), - amount: navigation.getParam('amount'), - videoReplyCount: navigation.getParam('videoReplyCount') - }; - utilities.handleVideoUploadModal(activeTab, navigation, params); + let activeTab = NavigationService.getActiveTab(); + let params = { + videoTypeReply: true, + videoId: navigation.getParam('videoId'), + userId: navigation.getParam('userId'), + amount: navigation.getParam('amount'), + videoReplyCount: navigation.getParam('videoReplyCount') + }; + utilities.handleVideoUploadModal(activeTab, navigation, params); }; @@ -97,10 +94,9 @@ class VideoRepliesScreen extends PureComponent { return ( - ); diff --git a/src/components/VideoReplies/list.js b/src/components/VideoReplies/list.js deleted file mode 100644 index 5694bf40..00000000 --- a/src/components/VideoReplies/list.js +++ /dev/null @@ -1,251 +0,0 @@ -import React, { PureComponent } from 'react'; -import { - View, - FlatList, - ActivityIndicator, - Text, - Image, - TouchableOpacity, - StatusBar -} from "react-native"; -import {SafeAreaView, withNavigation} from "react-navigation"; - -import Pagination from "../../services/Pagination"; -import plusIcon from '../../assets/user-video-capture-icon-selected.png'; -import inlineStyles from './styles'; -import crossIcon from '../../assets/cross_icon.png'; -import VideoThumbnailItem from '../CommonComponents/VideoThumbnailItem'; - - - -class VideoReplyList extends PureComponent { - - - constructor(props){ - super(props); - - this.state = { - list : [], - refreshing : false, - loadingNext: false - }; - this.listRef = null; - - const ts = Date.now(); - this.noResultsKeyProp = "video_collection_no_results_" + ts; - this.hasResultsKeyProp = "video_collection_has_results_" + ts; - - this.numColumns = 2; - this.flatListKey = this.hasResultsKeyProp; - this.listHeaderComponent =null; - this.listHeaderSubComponent = null; - } - - componentDidMount(){ - this.forcedRefresh(); - const ts = Date.now(); - this.noResultsKeyProp = "video_collection_no_results_" + ts; - this.hasResultsKeyProp = "video_collection_has_results_" + ts; - } - - componentWillUnmount() { - this.removePaginationListeners(); - } - - getPagination = () => { - return this.videoPagination; - }; - - // region - Pagination and Event Handlers - - initPagination() { - // First, take care of existing Pagination if exists. - this.removePaginationListeners(); - - // Now, create a new one. - let fetchUrl = `/users/${this.props.userId}/video-history`//this.fetchUrl; - this.videoPagination = new Pagination(fetchUrl); - this.bindPaginationEvents(); - } - - bindPaginationEvents(){ - let pagination = this.videoPagination; - if ( !pagination ) { - return; - } - let paginationEvent = pagination.event; - if ( null === paginationEvent ) { - return; - } - - paginationEvent.on("onBeforeRefresh" , this.beforeRefresh.bind(this) ); - paginationEvent.on("onRefresh" , this.onRefresh.bind(this) ); - paginationEvent.on("onRefreshError" , this.onRefreshError.bind(this)); - paginationEvent.on("onBeforeNext" , this.beforeNext.bind(this)); - paginationEvent.on("onNext" , this.onNext.bind(this) ); - paginationEvent.on("onNextError" , this.onNextError.bind(this)); - } - - removePaginationListeners(){ - let pagination = this.videoPagination; - if ( !pagination ) { - return; - } - let paginationEvent = pagination.event; - if ( null === paginationEvent ) { - return; - } - paginationEvent.removeListener('onBeforeRefresh'); - paginationEvent.removeListener('onRefresh'); - paginationEvent.removeListener('onRefreshError'); - paginationEvent.removeListener('onBeforeNext'); - paginationEvent.removeListener('onNext'); - paginationEvent.removeListener('onNextError'); - } - - forcedRefresh (fetchUrl){ - this.initPagination(); - this.refresh(); - } - - beforeRefresh = ( ) => { - this.setState({ refreshing : true }); - }; - - onRefresh = ( res ) => { - const list = this.getResultList(); - this.props.onRefresh && this.props.onRefresh( list , res ); - this.setState({ - refreshing : false, - list : list - }); - }; - - onRefreshError = ( error ) => { - this.setState({ refreshing : false }); - }; - - beforeNext =() => { - this.setState({ loadingNext : true }); - }; - - onNext = ( res ) => { - this.setState({ - loadingNext : false, - list : this.getResultList() - }); - } - - onNextError = ( error ) => { - this.setState({ loadingNext : false }); - }; - - getNext = () => { - this.videoPagination.getNext(); - }; - - refresh = () => { - this.videoPagination.refresh(); - }; - - _keyExtractor = (item, index) => { - return `id_${item.id}`; - } - - _renderItem = ({ item, index }) => { - // Check if this is an empty cell. - if ( item.isEmpty) { - // Render no results cell here. - return this.props.getNoResultsCell(item); - } else { - // Render Video cell - return this._renderVideoCell({item,index}); - } - }; - - _renderVideoCell = ({ item, index }) => { - return ( {this.onVideoClick(item.payload, index, compRef)}} - isEmpty={item.isEmpty} - emptyRenderFunction={this.props.getNoResultsCell}/>); - }; - - - - onVideoClick = (payload, index, videoThumbnailMeasurements) => { - const clonedInstance = this.videoPagination.fetchServices.cloneInstance(); - this.props.navigation.push("VideoRepliesFullScreen", { - "fetchServices" : clonedInstance, - "currentIndex": index, - "payload": payload, - "baseUrl": this.props.fetchUrl, - "showBalanceFlyer": this.showBalanceFlyer, - "videoThumbnailMeasurements": videoThumbnailMeasurements, - "amount": this.props.amount, - "videoReplyCount": this.props.videoReplyCount, - 'parentUserId': this.props.userId, - 'parentVideoId': this.props.videoId - }); - } - renderFooter = () => { - if (!this.state.loadingNext) return null; - return ; - }; - - getListHeaderComponent = () => { - return ( - - {this.listHeaderComponent} - {this.state.list.length > 0 && this.listHeaderSubComponent } - - ) - }; - - getResultList(){ - let list = this.videoPagination.getResults(); - if( list.length > 0 ){ - this.numColumns = 2; - this.flatListKey = this.hasResultsKeyProp; - return list; - } else { - this.numColumns = 1; - this.flatListKey = this.noResultsKeyProp; - return [this.props.noResultsData]; - } - } - - scrollToTop(){ - this.listRef.scrollToOffset({offset: 0}); - } - - setListRef = (listRef) => { - this.listRef = listRef; - }; - - render(){ - return ( - - - - - ); - } - -} - -export default withNavigation( VideoReplyList ); diff --git a/src/components/VideoRepliesFullScreen/VideoReply.js b/src/components/VideoRepliesFullScreen/VideoReply.js deleted file mode 100644 index 49cd5178..00000000 --- a/src/components/VideoRepliesFullScreen/VideoReply.js +++ /dev/null @@ -1,109 +0,0 @@ -import React, { PureComponent } from 'react'; -import { View } from 'react-native'; -import { withNavigation } from 'react-navigation'; -import VideoWrapper from '../Home/VideoWrapper'; -import ShareIcon from "../CommonComponents/ShareIcon"; -import ReportVideo from "../CommonComponents/ReportVideo"; -import PepoApi from '../../services/PepoApi'; -import TransactionPepoButton from '../Home/TransactionPepoButton'; -import deepGet from 'lodash/get'; -import CurrentUser from '../../models/CurrentUser'; - -import BottomStatus from '../Home/BottomStatus'; -import VideoAmountStat from '../CommonComponents/VideoAmoutStat'; -import ShareVideo from '../../services/shareVideo'; -import inlineStyles from './styles'; - -import utilities from '../../services/Utilities'; - - -class VideoReply extends PureComponent { - constructor(props) { - super(props); - this.userId = deepGet(this.props.payload, 'user_id'); - this.replyId = deepGet(this.props.payload, 'video_id');//reply_id replace - } - - refetchVideoReply = () => { - new PepoApi(`/videos/${this.videoId}`)// new PepoApi(`/replies/${this.replyId}`) - .get() - .then((res) => {}) - .catch((error) => {}); - }; - - - - shareVideo = () => { - let shareVideo = new ShareVideo(this.replyId); - shareVideo.perform(); - }; - - navigateToUserProfile = (e) => { - if (utilities.checkActiveUser()) { - if (this.userId == CurrentUser.getUserId()) { - this.props.navigation.navigate('ProfileScreen'); - } else { - this.props.navigation.push('UsersProfileScreen', { userId: this.userId }); - } - } - }; - - onDescriptionClick = ( tapEntity , tapText ) => { - if (!tapEntity) { - return; - } - - if( tapEntity.kind === 'tags'){ - this.props.navigation.push('VideoTags', { - "tagId": tapEntity.id - }); - } - - } - - render() { - return ( - - - - {!!this.replyId && !!this.userId && ( - - - - - - - - - - - - - - - )} - - ); - } -} - -export default withNavigation(VideoReply); diff --git a/src/components/VideoRepliesFullScreen/styles.js b/src/components/VideoRepliesFullScreen/styles.js deleted file mode 100644 index 6725c4bf..00000000 --- a/src/components/VideoRepliesFullScreen/styles.js +++ /dev/null @@ -1,118 +0,0 @@ -import { Dimensions, StatusBar, NativeModules } from 'react-native'; -import DefaultStyleGenerator from '../../theme/styles/DefaultStyleGenerator'; -import Colors from '../../theme/styles/Colors'; -import { ifIphoneX, getBottomSpace } from 'react-native-iphone-x-helper'; -import { Header } from 'react-navigation-stack'; - -import NotchHelper from "../../helpers/NotchHelper"; -const {width, height} = Dimensions.get('window'); -const statusBarHeight = StatusBar.currentHeight; - -console.log("header", Header.HEIGHT); - -let RNDeviceInfo = NativeModules.RNDeviceInfo; -let modalDeviceName = RNDeviceInfo.model === "Redmi Note 7 Pro" && RNDeviceInfo.brand === "xiaomi"; -let btmSpace = modalDeviceName ? 5 : 0; - -let stylesMap = { - fullScreen: { - width: width, - flex:1, - ...ifIphoneX( - { - height: height - getBottomSpace([true]) - Header.HEIGHT - statusBarHeight - }, - { - height: - NotchHelper.hasNotch() - ? height - statusBarHeight - btmSpace - Header.HEIGHT - : height - Header.HEIGHT - statusBarHeight - } - ) - }, - touchablesBtns: { - alignSelf: 'flex-end', - marginBottom: -15, - zIndex: 1 - }, - pepoTxCount: { - fontSize: 18, - color: Colors.white, - alignSelf: 'center', - marginTop: 3, - marginBottom: 15 - }, - txElem: { - marginBottom: 20 - }, - bottomContainer: { - width: width, - position: 'absolute', - bottom: 0 - }, - bottomBg: { - backgroundColor: 'rgba(0, 0, 0, 0.6)', - borderTopLeftRadius: 20, - minHeight: height * 0.05, - paddingHorizontal: 12 - }, - handle: { - fontSize: 15, - paddingBottom: 3, - color: Colors.white, - fontFamily: 'AvenirNext-DemiBold', - fontWeight: '700' - }, - bottomBgTxt: { - color: Colors.white - }, - raisedSupported: { - backgroundColor: Colors.wildWatermelon2, - borderTopLeftRadius: 25, - borderBottomRightRadius: 25, - paddingHorizontal: 8, - minWidth: 120, - height: 40, - alignItems: 'center', - justifyContent: 'center', - marginRight: 10 - }, - raisedSupportedTxt: { - color: Colors.white, - fontSize: 14, - fontFamily: 'AvenirNext-DemiBold' - }, - btnText: { - color: Colors.white - }, - iconWrapper: { - flex: 1, - alignItems: 'center', - justifyContent: 'center', - height: 60, - width: 60 - }, - iconSkipFont: { - height: 20, - width: 20 - }, - headerStyles: { - backgroundColor: Colors.white, - borderBottomWidth: 0, - shadowColor: '#000', - shadowOffset: { - width: 0, - height: 1 - }, - shadowOpacity: 0.1, - shadowRadius: 3 - }, - headerText:{ - fontWeight: '600' - }, - headerSubText:{ - fontSize: 12 - } -}; - -export default styles = DefaultStyleGenerator.generate(stylesMap); diff --git a/src/theme/constants/index.js b/src/theme/constants/index.js index dc0daa99..5ac76747 100644 --- a/src/theme/constants/index.js +++ b/src/theme/constants/index.js @@ -1 +1,2 @@ -export const CUSTOM_TAB_Height = 55; \ No newline at end of file +export const CUSTOM_TAB_Height = 55; +export const HEADER_HEIGHT = 56; \ No newline at end of file From af045f748d190e93d75fed8317f7d05bdb4058ad Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Tue, 12 Nov 2019 12:43:28 +0530 Subject: [PATCH 018/302] Temp --- RootNavigationContainer.js | 48 +++++-- src/components/Bio/index.js | 33 +++-- .../CommonComponents/InAppBrowser/index.js | 3 +- .../UserProfileFlatList/index.js | 3 +- src/components/Email/styles.js | 1 + .../FullScreenVideoCollection/index.js | 3 +- src/components/Invites/index.js | 5 +- src/components/Notification/index.js | 5 +- src/components/Profile/ProfileEditScreen.js | 3 +- src/components/ReferAndEarn/index.js | 3 +- src/components/Search/styles.js | 3 +- .../SupportersList/SupportersListComponent.js | 3 +- .../SupportingList/SupportingListComponent.js | 3 +- src/components/UserVideoHistory/index.js | 3 +- src/components/UsersProfile/index.js | 5 +- src/components/VideoCollections/index.js | 4 +- src/components/VideoReplies/index.js | 133 +++++++++++------- src/components/VideoReplies/styles.js | 17 +++ .../VideoRepliesFullScreen/index.js | 3 +- src/components/WalletSetting/styles.js | 3 +- .../WalletSetting/walletDetailsStyles.js | 1 + src/theme/styles/Common.js | 10 ++ src/theme/styles/index.js | 4 +- 23 files changed, 207 insertions(+), 92 deletions(-) create mode 100644 src/theme/styles/Common.js diff --git a/RootNavigationContainer.js b/RootNavigationContainer.js index 7b7a11c1..4c3f7977 100644 --- a/RootNavigationContainer.js +++ b/RootNavigationContainer.js @@ -2,7 +2,7 @@ import React from 'react'; import { View, Dimensions, Easing, Animated } from 'react-native'; import { Root } from 'native-base'; import { createSwitchNavigator, createAppContainer } from 'react-navigation'; -import { createStackNavigator } from 'react-navigation-stack'; +import { createStackNavigator , StackViewTransitionConfigs} from 'react-navigation-stack'; import { createBottomTabNavigator } from 'react-navigation-tabs'; import deepGet from 'lodash/get'; @@ -112,6 +112,28 @@ const txModalConfig = { }) }; + +const IOS_MODAL_ROUTES = ['VideoReplies']; +let dynamicModalTransition = (transitionProps, prevTransitionProps) => { + const isModal = IOS_MODAL_ROUTES.some( + screenName => + screenName === transitionProps.scene.route.routeName || + (prevTransitionProps && + screenName === prevTransitionProps.scene.route.routeName) + ); + return StackViewTransitionConfigs.defaultTransitionConfig( + transitionProps, + prevTransitionProps, + isModal + ); +}; + +//TODO find a way for conditional transparentCard config +const slidingUpConfig = { + transparentCard: true, + transitionConfig: dynamicModalTransition +} + const CaptureVideoStack = createStackNavigator( { CaptureVideo: CaptureVideo, @@ -131,20 +153,23 @@ const InAppBrowserStack = createStackNavigator( } ); + const HomePushStack = createStackNavigator( { HomeScreen: HomeScreen, UsersProfileScreen: UsersProfileScreen, UserVideoHistory: UserVideoHistory, - VideoReplies: VideoReplies, VideoRepliesFullScreen: VideoRepliesFullScreen, SupportingListScreen: SupportingListScreen, SupportersListScreen: SupportersListScreen, VideoTags: VideoTags, + VideoReplies:VideoReplies , FullScreenVideoCollection: FullScreenVideoCollection }, - { - headerLayoutPreset: 'center' + { + initialRouteName: 'HomeScreen', + headerLayoutPreset: 'center' , + ...slidingUpConfig } ); @@ -171,7 +196,6 @@ const NotificationPushStack = createStackNavigator( NotificationScreen: NotificationScreen, UsersProfileScreen: UsersProfileScreen, UserVideoHistory: UserVideoHistory, - VideoReplies: VideoReplies, VideoRepliesFullScreen: VideoRepliesFullScreen, VideoPlayer: VideoPlayer, SupportingListScreen: SupportingListScreen, @@ -180,7 +204,8 @@ const NotificationPushStack = createStackNavigator( FullScreenVideoCollection: FullScreenVideoCollection }, { - headerLayoutPreset: 'center' + headerLayoutPreset: 'center', + ...slidingUpConfig } ); @@ -191,6 +216,7 @@ const NotificationStack = createStackNavigator( AuthDeviceDrawer: AuthDeviceDrawer, SayThanksScreen: SayThanksScreen, CaptureVideo: CaptureVideoStack, + VideoReplies: VideoReplies, InAppBrowserStack: InAppBrowserStack }, { ...modalStackConfig, ...txModalConfig } @@ -200,7 +226,6 @@ const ProfilePushStack = createStackNavigator( { ProfileScreen: ProfileScreen, UserVideoHistory: UserVideoHistory, - VideoReplies: VideoReplies, VideoRepliesFullScreen: VideoRepliesFullScreen, SupportingListScreen: SupportingListScreen, SupportersListScreen: SupportersListScreen, @@ -216,7 +241,8 @@ const ProfilePushStack = createStackNavigator( FullScreenVideoCollection: FullScreenVideoCollection }, { - headerLayoutPreset: 'center' + headerLayoutPreset: 'center', + ...slidingUpConfig } ); @@ -230,6 +256,7 @@ const ProfileStack = createStackNavigator( CaptureVideo: CaptureVideoStack, InAppBrowserStack: InAppBrowserStack, StoreProductsScreen: StoreProductsScreen, + VideoReplies: VideoReplies, RedemptiomScreen: RedemptiomScreen }, { @@ -252,13 +279,13 @@ const SearchPushStack = createStackNavigator( SupportingListScreen: SupportingListScreen, SupportersListScreen: SupportersListScreen, UserVideoHistory: UserVideoHistory, - VideoReplies: VideoReplies, VideoRepliesFullScreen: VideoRepliesFullScreen, VideoTags: VideoTags, FullScreenVideoCollection: FullScreenVideoCollection }, { - headerLayoutPreset: 'center' + headerLayoutPreset: 'center', + ...slidingUpConfig } ); @@ -268,6 +295,7 @@ const SearchStack = createStackNavigator( CaptureVideo: CaptureVideoStack, InAppBrowserStack: InAppBrowserStack, TransactionScreen: TransactionScreen, + VideoReplies: VideoReplies, AuthDeviceDrawer: AuthDeviceDrawer }, { diff --git a/src/components/Bio/index.js b/src/components/Bio/index.js index 9816e5a4..9bf19e71 100644 --- a/src/components/Bio/index.js +++ b/src/components/Bio/index.js @@ -5,6 +5,7 @@ import { withNavigation } from 'react-navigation'; import BackArrow from '../CommonComponents/BackArrow'; import TagsInput from '../CommonComponents/TagsInput'; import Colors from '../../theme/styles/Colors'; +import CommonStyle from '../../theme/styles/Common'; import inlineStyles from './style'; class BioScreen extends PureComponent { @@ -51,21 +52,23 @@ class BioScreen extends PureComponent { render() { return ( - - - {this.state.count} /300 - + + + + {this.state.count} /300 + + ); } } diff --git a/src/components/CommonComponents/InAppBrowser/index.js b/src/components/CommonComponents/InAppBrowser/index.js index 20cca936..21057808 100644 --- a/src/components/CommonComponents/InAppBrowser/index.js +++ b/src/components/CommonComponents/InAppBrowser/index.js @@ -12,6 +12,7 @@ import ForwardActive from '../../../assets/ForwardActive.png'; import BrowserMenu from './BrowserMenu'; import { getHostName } from '../../../helpers/helpers'; import Colors from '../../../theme/styles/Colors'; +import CommonStyle from '../../../theme/styles/Common'; export default class InAppBrowserComponent extends Component { static navigationOptions = (props) => { @@ -92,7 +93,7 @@ export default class InAppBrowserComponent extends Component { render() { return ( - + {this.state.loadingProgress != 1 && ( + {this.listRef = ref } } ListHeaderComponent={this.listHeaderComponent()} diff --git a/src/components/Email/styles.js b/src/components/Email/styles.js index 83ca4db7..0c2447ed 100644 --- a/src/components/Email/styles.js +++ b/src/components/Email/styles.js @@ -4,6 +4,7 @@ import DefaultStyleGenerator from '../../theme/styles/DefaultStyleGenerator'; let stylesMap = { container: { flex: 1, + backgroundColor: Colors.white, marginVertical: 20, marginHorizontal: 10 }, diff --git a/src/components/FullScreenVideoCollection/index.js b/src/components/FullScreenVideoCollection/index.js index b5195a47..67e5ffdd 100644 --- a/src/components/FullScreenVideoCollection/index.js +++ b/src/components/FullScreenVideoCollection/index.js @@ -7,6 +7,7 @@ import FullScreeVideoRow from "./FullScreeVideoRow"; import inlineStyles from "./styles"; import historyBack from '../../assets/user-video-history-back-icon.png'; import TopStatus from "../Home/TopStatus"; +import CommonStyle from "../../theme/styles/Common"; const maxVideosThreshold = 3; @@ -176,7 +177,7 @@ class FullScreenVideoCollection extends PureComponent{ render() { return ( - + {this.props.navigation.getParam("showBalanceFlyer") && } { @@ -46,7 +45,7 @@ class Invites extends Component { render() { return ( - + { return { userId: CurrentUser.getUserId(), @@ -197,7 +200,7 @@ class NotificationScreen extends Component { render() { return ( this.props.userId && ( - + { this.listRef = ref; diff --git a/src/components/Profile/ProfileEditScreen.js b/src/components/Profile/ProfileEditScreen.js index 876dfeb1..0ce87fb5 100644 --- a/src/components/Profile/ProfileEditScreen.js +++ b/src/components/Profile/ProfileEditScreen.js @@ -355,7 +355,8 @@ class ProfileEdit extends React.PureComponent { contentContainerStyle={{ marginTop: 10, padding: 15, - paddingBottom: 50 + paddingBottom: 50, + backgroundColor: Colors.white }} showsVerticalScrollIndicator={false} > diff --git a/src/components/ReferAndEarn/index.js b/src/components/ReferAndEarn/index.js index d8fe6ba8..26b9374f 100644 --- a/src/components/ReferAndEarn/index.js +++ b/src/components/ReferAndEarn/index.js @@ -14,6 +14,7 @@ import BackArrow from '../CommonComponents/BackArrow'; import { ScrollView } from 'react-native-gesture-handler'; import PepoApi from '../../services/PepoApi'; import { WEB_ROOT } from '../../constants/index'; +import CommonStyle from "../../theme/styles/Common"; class ReferAndEarn extends Component { static navigationOptions = (options) => { @@ -116,7 +117,7 @@ class ReferAndEarn extends Component { render() { return ( - + {this.state.pendingInvites != 0 ? ( diff --git a/src/components/Search/styles.js b/src/components/Search/styles.js index 8b3670ee..05146466 100644 --- a/src/components/Search/styles.js +++ b/src/components/Search/styles.js @@ -6,7 +6,8 @@ let stylesMap = { container: { paddingBottom: 0, paddingTop: Platform.OS === 'ios' ? 30 : 20, - flex: 1 + flex: 1, + backgroundColor: Colors.white }, textInputUi: { marginTop: 0, diff --git a/src/components/SupportersList/SupportersListComponent.js b/src/components/SupportersList/SupportersListComponent.js index d083fa5f..9dd6d46c 100644 --- a/src/components/SupportersList/SupportersListComponent.js +++ b/src/components/SupportersList/SupportersListComponent.js @@ -5,6 +5,7 @@ import User from '../Users/User'; import Pricer from '../../services/Pricer'; import reduxGetters from '../../services/ReduxGetters'; import EmptyList from '../EmptyFriendsList/EmptyList'; +import CommonStyle from "../../theme/styles/Common"; class SupportersList extends PureComponent { constructor(props) { @@ -27,7 +28,7 @@ class SupportersList extends PureComponent { render() { return ( - + + + {!this.isCurrentUser() && } + - + ); } } diff --git a/src/components/VideoCollections/index.js b/src/components/VideoCollections/index.js index 0f7ad3ae..8ec5f16a 100644 --- a/src/components/VideoCollections/index.js +++ b/src/components/VideoCollections/index.js @@ -4,6 +4,8 @@ import {SafeAreaView} from "react-navigation"; import Pagination from "../../services/Pagination"; import VideoThumbnailItem from '../../components/CommonComponents/VideoThumbnailItem'; +import CommonStyle from "../../theme/styles/Common"; + class VideoCollections extends PureComponent { constructor(props){ super(props); @@ -205,7 +207,7 @@ class VideoCollections extends PureComponent { render(){ return ( - + height; +const topPadding = getInset('top', landScape); +const bottomPadding = getInset('bottom', landScape); import VideoReplyList from "./list"; -const HeaderLeft = (props) => { - return ( - { - props.navigation.goBack(); - }} - style={inlineStyles.iconWrapper} - > - - - ); - }; - - const HeaderRight = (props) => { - return ({ - props.navigation.push('CaptureVideo') - }} style={inlineStyles.iconWrapper} > - - ) - }; - - const HeaderTitle = (props) => { - return ( - - - Replies to Frankie - - Send a reply with Pepo5 - - ); - }; class VideoRepliesScreen extends PureComponent { - static navigationOptions = (props) => { - return { - headerStyle: inlineStyles.headerStyles, - headerLeft: , - headerRight: , - headerTitle: - }; + + static navigationOptions = ({ navigation, navigationOptions }) => { + return { + header: null, + headerBackTitle: null }; + }; constructor(props){ super(props); - this.userId = props.navigation.getParam('userId'); - this.videoId = props.navigation.getParam('videoId'); - this.fetchUrl = props.navigation.getParam('fetchUrl'); + this.userId = props.navigation.getParam('userId'); + this.videoId = props.navigation.getParam('videoId'); + this.fetchUrl = props.navigation.getParam('fetchUrl'); + this.initialHeight = height/1.5; + this.animatedValue = new Animated.Value(this.initialHeight) ; + this.listener = null; + this.panelAnimateTimeOut = 0 ; + + this.state = { + showBackdrop : false + } } componentDidMount(){ - + this.listener = this.animatedValue.addListener(this.onAnimatedValueChange); + setTimeout(()=> { + this.setState({showBackdrop: true}); + }, 500) } componentWillUnmount() { - + onAnimatedValueChange= () => {}; + this.animatedValue.removeListener(this.listener) + } + + onAnimatedValueChange = ({ value }) => { + clearTimeout(this.panelAnimateTimeOut); + this.panelAnimateTimeOut = setTimeout(()=> { + if( value < 10){ + this.props.navigation.goBack(); + } + } , 10) + } + + onCrossIconClick = () => { + this._panel.hide(); + } + + openCamera = () => { + this.props.navigation.push('CaptureVideo'); } render(){ return ( - - - - + (this._panel = c)} + animatedValue={this.animatedValue} + ref={c => (this._panel = c)} + draggableRange={{ + top: height - topPadding - bottomPadding, //TODO check is top expand + bottom: 0 + }} + showBackdrop={this.state.showBackdrop} + snappingPoints={[0, this.initialHeight, height]}> + {dragHandler => ( + + + + + + + + + + Replies to Frankie + + {/* {TODO integration pending} */} + Send a reply with Pepo5 + + + + + + + + + + )} + ); } } + export default VideoRepliesScreen; diff --git a/src/components/VideoReplies/styles.js b/src/components/VideoReplies/styles.js index a92fb3d6..3239da91 100644 --- a/src/components/VideoReplies/styles.js +++ b/src/components/VideoReplies/styles.js @@ -2,6 +2,20 @@ import DefaultStyleGenerator from '../../theme/styles/DefaultStyleGenerator'; import Colors from '../../theme/styles/Colors'; let stylesMap = { + container: { + flex: 1, + zIndex: 1, + alignItems: 'center', + justifyContent: 'center' + }, + dragHandler: { + alignSelf: 'stretch', + height: 80, + alignItems: 'center', + justifyContent: 'center', + backgroundColor: '#fff', + flexDirection: 'row', + }, iconWrapper: { flex: 1, alignItems: 'center', @@ -13,6 +27,9 @@ let stylesMap = { height: 20, width: 20 }, + repliesTxt: { + flex: 4 + }, headerStyles: { backgroundColor: Colors.white, borderBottomWidth: 0, diff --git a/src/components/VideoRepliesFullScreen/index.js b/src/components/VideoRepliesFullScreen/index.js index 920d591f..c7fc24c1 100644 --- a/src/components/VideoRepliesFullScreen/index.js +++ b/src/components/VideoRepliesFullScreen/index.js @@ -7,6 +7,7 @@ import inlineStyles from "./styles"; import backIcon from '../../assets/back-arrow.png'; import plusIcon from '../../assets/user-video-capture-icon-selected.png'; import VideoReply from "./VideoReply"; +import CommonStyle from "../../theme/styles/Common"; const maxVideosThreshold = 3; const HeaderLeft = (props) => { @@ -212,7 +213,7 @@ class VideoRepliesFullScreen extends PureComponent{ render() { return ( - + Date: Tue, 12 Nov 2019 14:23:21 +0530 Subject: [PATCH 019/302] Mentions integrations and UI --- src/components/Bio/index.js | 9 +- src/components/Bio/style.js | 11 +- .../CommonComponents/TagsInput/index.js | 133 ++++++++++++++---- .../CommonComponents/TagsInput/styles.js | 20 ++- .../FanVideoDetails/VideoDescription.js | 7 - src/components/FanVideoDetails/styles.js | 8 -- src/constants/DataContract.js | 8 ++ src/services/ReduxSetters.js | 1 + 8 files changed, 136 insertions(+), 61 deletions(-) diff --git a/src/components/Bio/index.js b/src/components/Bio/index.js index 9bf19e71..f2662634 100644 --- a/src/components/Bio/index.js +++ b/src/components/Bio/index.js @@ -61,22 +61,15 @@ class BioScreen extends PureComponent { onChangeVal={this.onChangeVal} placeholderText="Bio" submitEvent={this.submitEvent} - searchResultRowComponent={SearchResultRowComponent} textInputStyles={inlineStyles.multilineTextInput} maxLength={300} autoFocus={true} /> {this.state.count} /300 - + ); } } -const SearchResultRowComponent = (props) => ( - - {`#${props.val}`} - -); - export default withNavigation(BioScreen); diff --git a/src/components/Bio/style.js b/src/components/Bio/style.js index 97e8d038..682e2989 100644 --- a/src/components/Bio/style.js +++ b/src/components/Bio/style.js @@ -9,13 +9,11 @@ let stylesMap = { paddingTop: 15, marginTop: 0 }, - suggestionText:{ - fontFamily: 'AvenirNext-Regular', - color:Colors.midNightblue, - fontSize:16 - }, dropDownStyle: { + position: 'absolute', + top: 99, width: '100%', + zIndex: 1, shadowColor: '#000', shadowOffset: { width: 0, @@ -25,9 +23,6 @@ let stylesMap = { shadowRadius: 1.5, elevation: 1 }, - suggestionTextWrapper : { - marginVertical: 9 - }, countStyle:{ fontSize:10, marginTop: 5, diff --git a/src/components/CommonComponents/TagsInput/index.js b/src/components/CommonComponents/TagsInput/index.js index 63878530..62c33781 100644 --- a/src/components/CommonComponents/TagsInput/index.js +++ b/src/components/CommonComponents/TagsInput/index.js @@ -1,16 +1,20 @@ import React, { PureComponent } from 'react'; -import {TouchableOpacity, FlatList, View, Dimensions} from 'react-native'; +import {TouchableOpacity, FlatList, View, Dimensions, Text} from 'react-native'; import PepoApi from '../../../services/PepoApi'; import CustomTextInput from './CustomTextInput'; import ReduxGetters from '../../../services/ReduxGetters'; import deepGet from 'lodash/get'; +import DataContract from "../../../constants/DataContract"; +import inlineStyles from "./styles"; +import ProfilePicture from "../../ProfilePicture"; class TagsInput extends PureComponent { constructor(props) { super(props); this.state = { - data: [], + hashTagsData: [], + mentionsData: [], keyword: '' }; this.value = this.props.initialValue; @@ -26,10 +30,10 @@ class TagsInput extends PureComponent { const reqParam = keyword.substr(1); this.reqTimer = setTimeout(() => { if (!reqParam) return; - new PepoApi('/tags') + new PepoApi(DataContract.tags.userTags) .get('q=' + reqParam) .then((res) => { - this.openSuggestionsPanel(res); + this.openTagsPanel(res); }) .catch((error) => {}); }, 300); @@ -40,10 +44,10 @@ class TagsInput extends PureComponent { const reqParam = keyword.substr(1); this.reqTimer = setTimeout(() => { if (!reqParam) return; - new PepoApi('/search/at-mention') + new PepoApi(DataContract.mentions.userMentions) .get('q=' + reqParam) .then((res) => { - this.openSuggestionsPanel(res); + this.openMentionsPanel(res); }) .catch((error) => {}); }, 300); @@ -103,8 +107,12 @@ class TagsInput extends PureComponent { return hastagRegex.test(val); }; + inIncludeMentions(){ + return this.props.mentions && this.props.mentions.includes("@"); + } + isMention(val){ - if(this.props.mentions && this.props.mentions.includes("@")) { + if(this.inIncludeMentions()) { const mentionRegex = /(?:\s|^)@[A-Za-z0-9\-\.\_]+(?:\s|$)/g; return mentionRegex.test(val); } @@ -120,19 +128,25 @@ class TagsInput extends PureComponent { this.location = event && event.nativeEvent && event.nativeEvent.selection && event.nativeEvent.selection.start; }; - openSuggestionsPanel(res) { + openTagsPanel(res) { if (!this.isTrackingStarted) return; - if (res && res.success && res.data ) { - let resultType = res.data.result_type; - resultType && this.setState({ data: res.data[resultType]}); + if ( deepGet(res , "data.meta.search_kind") === "tags" ) { + let resultTypeTags = res.data.result_type; + resultTypeTags && this.setState({ mentionsData:[], hashTagsData: res.data[resultTypeTags]}); + } + } + + openMentionsPanel(res) { + if (!this.isTrackingStarted) return; + if ( deepGet(res , "data.meta.search_kind") == "users") { + let resultTypeMentions = res.data.result_type; + resultTypeMentions && this.setState({hashTagsData:[], mentionsData: res.data[resultTypeMentions]}); } } closeSuggestionsPanel() { this.stopStracking(); - if (this.state.data.length > 0) { - this.setState({ data: [] }); - } + this.setState({ hashTagsData: [], mentionsData: [] }); } startTracking() { @@ -145,16 +159,25 @@ class TagsInput extends PureComponent { _keyExtractor = (item, index) => `id_${item.id}`; - _renderItem = ({ item }) => { - const SearchResultRowComponent = this.props.searchResultRowComponent; + _renderHashTagItem = ({ item }) => { + const HashRow = this.props.hashResultRowComponent || HashResultRowComponent ; return ( - this.onSuggestionTap(item)} style={{paddingLeft: 8}}> - + this.onHashSuggestionTap(item)} style={{paddingLeft: 8}}> + ); }; - onSuggestionTap(item) { + _renderMentionsItem = ({ item }) => { + const MentionRow = this.props.mentionResultRowComponent || MentionResultRowComponent ; + return ( + this.onMentionSuggestionTap(item)} style={{paddingLeft: 8}}> + + + ); + }; + + onHashSuggestionTap(item ) { this.closeSuggestionsPanel(); const wordToReplace = this.getWordAtIndex(this.value, this.wordIndex), isHashTag = this.isHashTag(wordToReplace); @@ -167,6 +190,19 @@ class TagsInput extends PureComponent { } } + onMentionSuggestionTap(item ) { + this.closeSuggestionsPanel(); + const wordToReplace = this.getWordAtIndex(this.value, this.wordIndex), + isMention = this.isMention(wordToReplace); + if (isMention) { + const startIndex = this.getStartIndex(this.value, this.wordIndex), + endIndex = this.getEndIndex(this.value, this.wordIndex), + replaceString = ` @${item.user_name} `, + newString = this.replaceBetween(startIndex, endIndex, replaceString); + this.changeValue(newString); + } + } + replaceBetween(start, end, replaceString) { return this.value.substring(0, start) + replaceString + this.value.substring(end); } @@ -197,6 +233,14 @@ class TagsInput extends PureComponent { return endIndex; } + isHastagData(){ + return this.state.hashTagsData && this.state.hashTagsData.length > 0 ; + } + + isMentionsData(){ + return this.state.mentionsData && this.state.mentionsData.length > 0 ; + } + render() { return ( @@ -217,22 +261,53 @@ class TagsInput extends PureComponent { style={[{ position: 'absolute', top: 122, - maxHeight: Dimensions.get('window').height * 0.275, + maxHeight: Dimensions.get('window').height - 300, backgroundColor: '#fff', } , this.props.dropdownStyle ]}> - + {this.isHastagData() ? + : this.isMentionsData() && ( + + ) + } ); } } + +const HashResultRowComponent = (props) => ( + + {`#${props.val}`} + +); + +const MentionResultRowComponent = (props) => ( + + + + {`${props.name}`} + {`@${props.userName}`} + + +); + export default TagsInput; diff --git a/src/components/CommonComponents/TagsInput/styles.js b/src/components/CommonComponents/TagsInput/styles.js index d329a9ed..5c79c242 100644 --- a/src/components/CommonComponents/TagsInput/styles.js +++ b/src/components/CommonComponents/TagsInput/styles.js @@ -1,6 +1,24 @@ import DefaultStyleGenerator from '../../../theme/styles/DefaultStyleGenerator'; import Colors from '../../../theme/styles/Colors'; -let stylesMap = {}; +let stylesMap = { + suggestionTextWrapper: { + marginVertical: 9 + }, + suggestionText:{ + fontFamily: 'AvenirNext-Regular', + color:Colors.midNightblue, + fontSize:16 + }, + mentionsTitle:{ + fontSize: 15, + color:Colors.midNightblue, + fontFamily: 'AvenirNext-Medium', + }, + mentionSubTitle: { + fontSize: 14, + color: Colors.light + } +}; export default styles = DefaultStyleGenerator.generate(stylesMap); diff --git a/src/components/FanVideoDetails/VideoDescription.js b/src/components/FanVideoDetails/VideoDescription.js index 7294bca0..5c5eace2 100644 --- a/src/components/FanVideoDetails/VideoDescription.js +++ b/src/components/FanVideoDetails/VideoDescription.js @@ -25,7 +25,6 @@ class VideoDescription extends PureComponent { onChangeVal={this.onChangeValue} placeholderText="Write something about your video" submitEvent={this.submitEvent} - searchResultRowComponent={SearchResultRowComponent} textInputStyles={inlineStyles.videoDescription} dropdownStyle={inlineStyles.dropDownStyle} maxLength={110} @@ -37,10 +36,4 @@ class VideoDescription extends PureComponent { } } -const SearchResultRowComponent = (props) => ( - - {`#${props.val}`} - -); - export default VideoDescription; diff --git a/src/components/FanVideoDetails/styles.js b/src/components/FanVideoDetails/styles.js index 993a8497..139fbac3 100644 --- a/src/components/FanVideoDetails/styles.js +++ b/src/components/FanVideoDetails/styles.js @@ -56,14 +56,6 @@ let stylesMap = { shadowOpacity: 0.2, elevation: 1 }, - suggestionText: { - color: Colors.midNightblue, - fontSize: 16, - fontFamily: 'AvenirNext-Regular' - }, - suggestionTextWrapper: { - marginVertical: 9 - }, linkText: { color: Colors.softBlue, flex: 3} }; diff --git a/src/constants/DataContract.js b/src/constants/DataContract.js index fd8fc814..6f3f7aec 100644 --- a/src/constants/DataContract.js +++ b/src/constants/DataContract.js @@ -43,6 +43,14 @@ export default { common: { resultType : "data.result_type" + }, + + mentions: { + userMentions: "/search/users-mention" + }, + + tags: { + userTags: "/tags" } } diff --git a/src/services/ReduxSetters.js b/src/services/ReduxSetters.js index 393e1373..f32aa2a1 100644 --- a/src/services/ReduxSetters.js +++ b/src/services/ReduxSetters.js @@ -6,6 +6,7 @@ const knownEntitiesDispatcherMap = { gifs: 'upsertGiffyEntities', tags: 'upsertTagEntities', tag_search_results:'upsertTagEntities', + user_search_results:'upsertUserEntities', user_profiles: 'upsertUserProfileEntities', user_profile: 'upsertUserProfileEntities', user_stats: 'upsertUserStatEntities', From b9bf7073159e327f6ddc5206e14568e0bef09abb Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Tue, 12 Nov 2019 15:08:25 +0530 Subject: [PATCH 020/302] code changes --- ios/Pepo2.xcodeproj/project.pbxproj | 1 - package-lock.json | 9 +++++ src/actions/constants.js | 4 +++ src/actions/index.js | 10 ++++++ .../CommonComponents/ReplyIcon/index.js | 11 +++--- .../FullScreenReplyCollection/VideoReply.js | 8 +++-- .../FullScreenReplyCollection/index.js | 4 +-- src/components/ReplyCollection/index.js | 29 +++++++--------- src/components/VideoReplies/index.js | 34 ++++++++----------- src/constants/DataContract.js | 5 ++- src/reducers/index.js | 14 ++++++++ src/services/ReduxSetters.js | 2 ++ 12 files changed, 84 insertions(+), 47 deletions(-) diff --git a/ios/Pepo2.xcodeproj/project.pbxproj b/ios/Pepo2.xcodeproj/project.pbxproj index 56a729fe..c2fcf511 100644 --- a/ios/Pepo2.xcodeproj/project.pbxproj +++ b/ios/Pepo2.xcodeproj/project.pbxproj @@ -5,7 +5,6 @@ }; objectVersion = 46; objects = { - /* Begin PBXBuildFile section */ 00029B4323329B55009E6919 /* TrustKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B76D86A2318FAAC007316D4 /* TrustKit.framework */; }; 00029B4423329B63009E6919 /* OstWalletSdk.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0050FDA022A8226800C2634F /* OstWalletSdk.framework */; }; diff --git a/package-lock.json b/package-lock.json index 27970f3a..d76e1cd2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12268,6 +12268,15 @@ "glob": "^7.1.3" } }, + "rn-sliding-up-panel": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/rn-sliding-up-panel/-/rn-sliding-up-panel-2.3.3.tgz", + "integrity": "sha512-LcIaU/qbriu5i0aLtwBDJRl2b26idj9XJQZYEdvSCxtNEhm5R3+OEHFwq0YF14a4tnfGmnlHIALi9sKBIj6mcw==", + "requires": { + "clamp": "^1.0.1", + "prop-types": "^15.7.2" + } + }, "rsvp": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-3.6.2.tgz", diff --git a/src/actions/constants.js b/src/actions/constants.js index 3e2d58de..c0a3174d 100644 --- a/src/actions/constants.js +++ b/src/actions/constants.js @@ -16,6 +16,8 @@ const UPSERT_USER_STAT_ENTITIES = 'UPSERT_USER_STAT_ENTITIES'; const UPSERT_LINK_ENTITIES = 'UPSERT_LINK_ENTITIES'; const UPSERT_VIDEO_ENTITIES = 'UPSERT_VIDEO_ENTITIES'; const UPSERT_VIDEO_STAT_ENTITIES = 'UPSERT_VIDEO_STAT_ENTITIES'; +const UPSERT_VIDEO_REPLY_ENTITIES = 'UPSERT_VIDEO_REPLY_ENTITIES'; +const UPSERT_VIDEO_REPLY_STAT_ENTITIES = 'UPSERT_VIDEO_REPLY_STAT_ENTITIES'; const UPSERT_HOME_FEED_ENTITIES = 'UPSERT_HOME_FEED_ENTITIES'; const UPSERT_IMAGE_ENTITIES = 'UPSERT_IMAGE_ENTITIES'; const UPDATE_BALANCE = 'UPDATE_BALANCE'; @@ -59,6 +61,8 @@ export { UPSERT_TAG_ENTITIES, UPSERT_USER_PROFILE_ENTITIES, UPSERT_USER_STAT_ENTITIES, + UPSERT_VIDEO_REPLY_ENTITIES, + UPSERT_VIDEO_REPLY_STAT_ENTITIES, UPSERT_LINK_ENTITIES, UPSERT_VIDEO_ENTITIES, UPSERT_VIDEO_STAT_ENTITIES, diff --git a/src/actions/index.js b/src/actions/index.js index f056d3dd..e5fff24a 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -107,6 +107,16 @@ export const upsertVideoStatEntities = (data) => ({ payload: { video_stat_entities: data } }); +export const upsertVideoReplyEntities = (data) => ({ + type: types.UPSERT_VIDEO_REPLY_ENTITIES, + payload: { video_reply_entities: data } +}); + +export const upsertVideoReplyStatEntities = (data) => ({ + type: types.UPSERT_VIDEO_REPLY_STAT_ENTITIES, + payload: { video_reply_stat_entities: data } +}); + export const upsertHomeFeedEntities = (data) => ({ type: types.UPSERT_HOME_FEED_ENTITIES, payload: { home_feed_entities: data } diff --git a/src/components/CommonComponents/ReplyIcon/index.js b/src/components/CommonComponents/ReplyIcon/index.js index 0467da30..abaab113 100644 --- a/src/components/CommonComponents/ReplyIcon/index.js +++ b/src/components/CommonComponents/ReplyIcon/index.js @@ -31,16 +31,18 @@ class ReplyIcon extends PureComponent { super(props); }; + //TODO @preshita login popover open + isDisabled = () => { return !this.props.isReplyAllowed || !this.props.isVideoUserActivated || !this.props.isCurrentUserActivated || !this.hasSufficientBalance(); }; hasSufficientBalance = () => { - return this.getBalanceToNumber() >= this.props.requiredPepo ? true : false; + return this.getWeiToNumber(this.props.balance) >= this.getWeiToNumber(this.props.requiredPepo); }; - getBalanceToNumber = () => { - return (this.props.balance && Math.floor(Number(pricer.getFromDecimal(this.props.balance)))) || 0; + getWeiToNumber = ( val ) => { //Move this to utilities + return val && Math.floor(Number(pricer.getFromDecimal(val))) || 0; }; replyVideo = ()=> { @@ -49,8 +51,7 @@ class ReplyIcon extends PureComponent { {'videoId': this.props.videoId , 'userId': this.props.userId, 'amount': this.props.requiredPepo, - 'videoReplyCount': 1, - 'fetchUrl': `/videos/${this.props.videoId}/replies` + 'videoReplyCount': this.props.videoReplyCount || 1 //TODO @preshita remove this }); } else { let activeTab = NavigationService.getActiveTab(); diff --git a/src/components/FullScreenReplyCollection/VideoReply.js b/src/components/FullScreenReplyCollection/VideoReply.js index d7ddaebe..f1ba7f15 100644 --- a/src/components/FullScreenReplyCollection/VideoReply.js +++ b/src/components/FullScreenReplyCollection/VideoReply.js @@ -25,19 +25,20 @@ class VideoReply extends PureComponent { } refetchVideoReply = () => { + //TODO @preshita new PepoApi(`/videos/${this.videoId}`)// new PepoApi(`/replies/${this.replyId}`) .get() .then((res) => {}) .catch((error) => {}); }; - - + //TODO @preshita move to share icon shareVideo = () => { let shareVideo = new ShareVideo(this.replyId); shareVideo.perform(); }; + //TODO @preshita move to bottom status navigateToUserProfile = (e) => { if (utilities.checkActiveUser()) { if (this.userId == CurrentUser.getUserId()) { @@ -48,6 +49,7 @@ class VideoReply extends PureComponent { } }; + //TODO @preshita move to bottom status onDescriptionClick = ( tapEntity ) => { if (!tapEntity) { return; @@ -61,6 +63,8 @@ class VideoReply extends PureComponent { } + //Required from Backend , we need video stats entity + render() { return ( diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index 96e3da63..1465b4f6 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -181,8 +181,8 @@ class FullScreenReplyCollection extends PureComponent{ } _renderItem = ({ item, index }) => { - const payload = item.payload; - return { this.setState({ refreshing : true }); }; @@ -138,16 +135,17 @@ class VideoReplyList extends PureComponent { }; _renderVideoCell = ({ item, index }) => { + //TODO Let ask BE for same payload + const payload = { user_id : deepGet(item, "payload.user_id") , video_id: deepGet(item, "payload.reply_detail_id")} return ( {this.onVideoClick(item.payload, index, compRef)}}/>); + onVideoClick={() => {this.onVideoClick(payload, index)}}/>); }; - - onVideoClick = (payload, index) => { const clonedInstance = this.videoPagination.fetchServices.cloneInstance(); + //TODO @ashutosh to understand this.props.navigation.push("FullScreenReplyCollection", { "fetchServices" : clonedInstance, "currentIndex": index, @@ -159,17 +157,15 @@ class VideoReplyList extends PureComponent { 'parentVideoId': this.props.videoId }); } + + renderFooter = () => { if (!this.state.loadingNext) return null; return ; }; getResultList(){ - let list = this.videoPagination.getResults(); - if( list.length > 0 ){ - this.numColumns = 2; - return list; - } + return this.videoPagination.getResults(); } scrollToTop(){ @@ -182,8 +178,7 @@ class VideoReplyList extends PureComponent { render(){ return ( - - + height; const topPadding = getInset('top', landScape); const bottomPadding = getInset('bottom', landScape); -const navigateToCamera = (navigation) => { - let activeTab = NavigationService.getActiveTab(); - let params = { - videoTypeReply: true, - videoId: navigation.getParam('videoId'), - userId: navigation.getParam('userId'), - amount: navigation.getParam('amount'), - videoReplyCount: navigation.getParam('videoReplyCount') - }; - utilities.handleVideoUploadModal(activeTab, navigation, params); -}; - - - class VideoRepliesScreen extends PureComponent { static navigationOptions = ({ navigation, navigationOptions }) => { @@ -54,11 +41,11 @@ class VideoRepliesScreen extends PureComponent { this.videoId = props.navigation.getParam('videoId'); this.amount = props.navigation.getParam('amount'); this.videoReplyCount = props.navigation.getParam('videoReplyCount'); - this.fetchUrl = props.navigation.getParam('fetchUrl'); + this.fetchUrl = DataContract.replies.getReplyListApi(this.videoId); this.initialHeight = height/1.5; - this.animatedValue = new Animated.Value(this.initialHeight) ; - this.listener = null; - this.panelAnimateTimeOut = 0 ; + this.animatedValue = new Animated.Value(this.initialHeight) ; + this.listener = null; + this.panelAnimateTimeOut = 0 ; this.state = { showBackdrop : false @@ -91,7 +78,16 @@ class VideoRepliesScreen extends PureComponent { } openCamera = () => { - this.props.navigation.push('CaptureVideo'); + let activeTab = NavigationService.getActiveTab(); + //TODO @mayur move it to a function , If possible change this to string + let params = { + videoTypeReply: true, + videoId: this.videoId, + userId: this.userId, + amount: navigation.getParam('amount'), + videoReplyCount: navigation.getParam('videoReplyCount') + }; + utilities.handleVideoUploadModal(activeTab, navigation, params); } render(){ diff --git a/src/constants/DataContract.js b/src/constants/DataContract.js index 6f3f7aec..0e8c5470 100644 --- a/src/constants/DataContract.js +++ b/src/constants/DataContract.js @@ -38,7 +38,10 @@ export default { }, replies: { - validateReply: "replies/validate-upload" + validateReply: "replies/validate-upload", + getReplyListApi : (id) => { + return `/videos/${id}/replies` + } }, common: { diff --git a/src/reducers/index.js b/src/reducers/index.js index fc0be1b0..5eef25e4 100644 --- a/src/reducers/index.js +++ b/src/reducers/index.js @@ -25,6 +25,8 @@ export const { upsertUserStatEntities, upsertVideoEntities, upsertVideoStatEntities, + upsertVideoReplyEntities, + upsertVideoReplyStatEntities, upsertImageEntities, upsertHomeFeedEntities, updateBalance, @@ -68,6 +70,8 @@ const defaultState = { link_entities: {}, video_entities: {}, video_stat_entities: {}, + video_reply_entities: {}, + video_reply_stat_entities: {}, video_description_entities: {}, image_entities: {}, home_feed_entities: {}, @@ -99,6 +103,8 @@ const logoutDefault = { link_entities: {}, video_entities: {}, video_stat_entities: {}, + video_reply_entities: {}, + video_reply_stat_entities: {}, video_description_entities: {}, image_entities: {}, home_feed_entities: {}, @@ -173,6 +179,14 @@ export const reducer = handleActions( ...state, video_stat_entities: assignIn({}, state.video_stat_entities, action.payload.video_stat_entities) }), + [upsertVideoReplyEntities]: (state, action) => ({ + ...state, + video_reply_entities: assignIn({}, state.video_reply_entities, action.payload.video_reply_entities) + }), + [upsertVideoReplyStatEntities]: (state, action) => ({ + ...state, + video_reply_stat_entities: assignIn({}, state.video_reply_stat_entities, action.payload.video_reply_stat_entities) + }), [upsertVideoDescriptionEntities]: (state, action) => ({ ...state, video_description_entities: assignIn( diff --git a/src/services/ReduxSetters.js b/src/services/ReduxSetters.js index f32aa2a1..7ec85a94 100644 --- a/src/services/ReduxSetters.js +++ b/src/services/ReduxSetters.js @@ -14,6 +14,8 @@ const knownEntitiesDispatcherMap = { video_descriptions: 'upsertVideoDescriptionEntities', videos: 'upsertVideoEntities', video_details: 'upsertVideoStatEntities', + video_replies: 'upsertVideoReplyEntities', + reply_details: 'upsertVideoReplyStatEntities', images: 'upsertImageEntities', current_user_video_contributions: 'upsertVideoContributionEntities', current_user_user_contributions: 'upsertUserContributionEntities', From 0669c8c7403de7ba1a084abf1c3b21b7066880f0 Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Tue, 12 Nov 2019 15:49:34 +0530 Subject: [PATCH 021/302] sliding up panel UI --- .../VideoThumbnailItem/index.js | 4 +-- src/components/ReplyCollection/index.js | 7 ++--- src/components/VideoReplies/index.js | 20 +++++++++----- src/components/VideoReplies/styles.js | 26 ++++++++++++------- 4 files changed, 36 insertions(+), 21 deletions(-) diff --git a/src/components/CommonComponents/VideoThumbnailItem/index.js b/src/components/CommonComponents/VideoThumbnailItem/index.js index c9b39320..ad22a395 100644 --- a/src/components/CommonComponents/VideoThumbnailItem/index.js +++ b/src/components/CommonComponents/VideoThumbnailItem/index.js @@ -18,7 +18,7 @@ let getVideoBtAmount = (videoId) => { export default (props) => { const videoId = deepGet(props, 'payload.video_id'), - userId = deepGet(props, 'payload.user_id') + userId = deepGet(props, 'payload.user_id'), userName = reduxGetters.getUserName(userId), imageUrl = reduxGetters.getVideoImgUrl(videoId,null, AppConfig.userVideos.userScreenCoverImageWidth), videoDesc =reduxGetters.getVideoDescription(reduxGetters.getVideoDescriptionId(videoId)); @@ -28,7 +28,7 @@ export default (props) => { > { - //TODO Let ask BE for same payload + //TODO Let ask BE for same payload const payload = { user_id : deepGet(item, "payload.user_id") , video_id: deepGet(item, "payload.reply_detail_id")} return ( { const clonedInstance = this.videoPagination.fetchServices.cloneInstance(); - //TODO @ashutosh to understand + //TODO @ashutosh to understand this.props.navigation.push("FullScreenReplyCollection", { "fetchServices" : clonedInstance, "currentIndex": index, @@ -178,7 +178,8 @@ class VideoReplyList extends PureComponent { render(){ return ( - + + + (this._panel = c)} animatedValue={this.animatedValue} ref={c => (this._panel = c)} @@ -102,7 +105,7 @@ class VideoRepliesScreen extends PureComponent { showBackdrop={this.state.showBackdrop} snappingPoints={[0, this.initialHeight, height]}> {dragHandler => ( - + @@ -118,17 +121,20 @@ class VideoRepliesScreen extends PureComponent { - + - + + + )} + ); } diff --git a/src/components/VideoReplies/styles.js b/src/components/VideoReplies/styles.js index 3239da91..1c293a91 100644 --- a/src/components/VideoReplies/styles.js +++ b/src/components/VideoReplies/styles.js @@ -6,29 +6,34 @@ let stylesMap = { flex: 1, zIndex: 1, alignItems: 'center', - justifyContent: 'center' + justifyContent: 'center', + backgroundColor: '#fff', }, dragHandler: { alignSelf: 'stretch', - height: 80, + height: 65, alignItems: 'center', justifyContent: 'center', backgroundColor: '#fff', flexDirection: 'row', + borderTopLeftRadius: 30, + borderTopRightRadius: 30, + overflow: 'hidden' }, iconWrapper: { flex: 1, alignItems: 'center', justifyContent: 'center', - height: 60, - width: 60 + height: 50, + width: 50 }, iconSkipFont: { - height: 20, - width: 20 + height: 16, + width: 16 }, repliesTxt: { - flex: 4 + flex: 4, + alignItems: 'center' }, headerStyles: { backgroundColor: Colors.white, @@ -42,10 +47,13 @@ let stylesMap = { shadowRadius: 3 }, headerText:{ - fontWeight: '600' + fontFamily: 'AvenirNext-Medium', + color: Colors.valhalla, + fontSize: 18 }, headerSubText:{ - fontSize: 12 + fontSize: 12, + color: 'rgba(42, 41, 59, 0.7)' } }; From 9b3725b8d52f65d5198b377da32d33a746537628 Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Tue, 12 Nov 2019 16:23:50 +0530 Subject: [PATCH 022/302] safearea view removal --- src/components/ReplyCollection/index.js | 3 --- src/components/VideoReplies/index.js | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/components/ReplyCollection/index.js b/src/components/ReplyCollection/index.js index f0dba413..a0ea38d4 100644 --- a/src/components/ReplyCollection/index.js +++ b/src/components/ReplyCollection/index.js @@ -178,8 +178,6 @@ class VideoReplyList extends PureComponent { render(){ return ( - - - ); } diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index 3a15eda9..968c3644 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -108,7 +108,7 @@ class VideoRepliesScreen extends PureComponent { - + From 23191074f31495ca0b353038f2953437160922da Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Tue, 12 Nov 2019 16:30:42 +0530 Subject: [PATCH 023/302] Minor fix --- src/components/VideoReplies/index.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index 968c3644..7c4bb9da 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -93,8 +93,6 @@ class VideoRepliesScreen extends PureComponent { render(){ return ( - - (this._panel = c)} animatedValue={this.animatedValue} ref={c => (this._panel = c)} @@ -125,16 +123,13 @@ class VideoRepliesScreen extends PureComponent { - - )} - ); } From 5009607527fc53499d4d9ee5ac69f41a547b8eb4 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Tue, 12 Nov 2019 17:01:43 +0530 Subject: [PATCH 024/302] Minor fix --- src/components/ReplyCollection/index.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/ReplyCollection/index.js b/src/components/ReplyCollection/index.js index a0ea38d4..104a2015 100644 --- a/src/components/ReplyCollection/index.js +++ b/src/components/ReplyCollection/index.js @@ -2,7 +2,9 @@ import React, { PureComponent } from 'react'; import { FlatList, ActivityIndicator, - StatusBar + Text, + StatusBar, + View } from "react-native"; import {SafeAreaView, withNavigation} from "react-navigation"; @@ -10,6 +12,7 @@ import Pagination from "../../services/Pagination"; import VideoThumbnailItem from '../CommonComponents/VideoThumbnailItem'; import deepGet from "lodash/get"; + class VideoReplyList extends PureComponent { constructor(props){ @@ -17,7 +20,7 @@ class VideoReplyList extends PureComponent { this.state = { list : [], - refreshing : false, + refreshing : true, loadingNext: false }; this.listRef = null; @@ -178,7 +181,8 @@ class VideoReplyList extends PureComponent { render(){ return ( - + /> ); } From 2e728068898e3c643fc1db353769774b7db7d7df Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Tue, 12 Nov 2019 17:03:19 +0530 Subject: [PATCH 025/302] code changes --- .../CommonComponents/DeleteVideo/index.js | 2 +- .../CommonComponents/ReplyIcon/index.js | 55 ++++++++-------- .../UserProfileFlatList/index.js | 3 +- .../FullScreenReplyCollection/VideoReply.js | 12 +--- .../FullScreeVideoRow.js | 7 --- src/components/ReplyCollection/index.js | 62 +++++++++++++++++-- src/components/ReplyCollection/styles.js | 12 ++++ .../UserVideoHistory/UserVideoHistoryRow.js | 6 -- src/constants/DataContract.js | 11 +++- src/services/Pagination.js | 4 ++ 10 files changed, 117 insertions(+), 57 deletions(-) create mode 100644 src/components/ReplyCollection/styles.js diff --git a/src/components/CommonComponents/DeleteVideo/index.js b/src/components/CommonComponents/DeleteVideo/index.js index 4051062f..acb2407b 100644 --- a/src/components/CommonComponents/DeleteVideo/index.js +++ b/src/components/CommonComponents/DeleteVideo/index.js @@ -21,7 +21,7 @@ export default class DeleteVideo extends Component { deleteUser = () => { if(!this.props.videoId) return; - new PepoApi(`/videos/${this.props.videoId}/delete`) + new PepoApi(this.props.fetchUrl) .post() .then((response) => { diff --git a/src/components/CommonComponents/ReplyIcon/index.js b/src/components/CommonComponents/ReplyIcon/index.js index abaab113..73a5cf0c 100644 --- a/src/components/CommonComponents/ReplyIcon/index.js +++ b/src/components/CommonComponents/ReplyIcon/index.js @@ -1,5 +1,5 @@ import React, { PureComponent } from 'react'; -import {TouchableOpacity , Image, View, Text} from "react-native"; +import {TouchableWithoutFeedback , Image, View, Text} from "react-native"; import { connect } from 'react-redux'; import {withNavigation} from "react-navigation"; @@ -12,6 +12,7 @@ import Utilities from '../../../services/Utilities'; import CurrentUser from '../../../models/CurrentUser'; import NavigationService from "../../../services/NavigationService"; import utilities from "../../../services/Utilities"; +import { LoginPopoverActions } from '../../LoginPopover'; const mapStateToProps = (state , ownProps) => { return { @@ -31,8 +32,6 @@ class ReplyIcon extends PureComponent { super(props); }; - //TODO @preshita login popover open - isDisabled = () => { return !this.props.isReplyAllowed || !this.props.isVideoUserActivated || !this.props.isCurrentUserActivated || !this.hasSufficientBalance(); }; @@ -46,37 +45,43 @@ class ReplyIcon extends PureComponent { }; replyVideo = ()=> { - if (this.props.videoReplyCount > 0 || true){ - this.props.navigation.push('VideoReplies', - {'videoId': this.props.videoId , - 'userId': this.props.userId, - 'amount': this.props.requiredPepo, - 'videoReplyCount': this.props.videoReplyCount || 1 //TODO @preshita remove this - }); - } else { - let activeTab = NavigationService.getActiveTab(); - let params = { - videoTypeReply: true, - videoId: this.props.videoId, - userId: this.props.userId, - amount: this.props.requiredPepo, - videoReplyCount: this.props.videoReplyCount - }; - utilities.handleVideoUploadModal(activeTab, this.props.navigation, params); + if(this.isDisabled()) { + if(!CurrentUser.getOstUserId()){ + LoginPopoverActions.show(); } - - }; + return; + } + + if (this.props.videoReplyCount > 0 || true){ //TODO remove || true + this.props.navigation.push('VideoReplies', + {'videoId': this.props.videoId , + 'userId': this.props.userId, + 'amount': this.props.requiredPepo, + 'videoReplyCount': this.props.videoReplyCount || 1 //TODO @preshita remove this + }); + } else { + let activeTab = NavigationService.getActiveTab(); + let params = { + videoTypeReply: true, + videoId: this.props.videoId, + userId: this.props.userId, + amount: this.props.requiredPepo, + videoReplyCount: this.props.videoReplyCount + }; + utilities.handleVideoUploadModal(activeTab, this.props.navigation, params); + } + + }; render(){ return ( {this.props.videoReplyCount} - this.replyVideo())} > - + ); } diff --git a/src/components/CommonComponents/UserProfileFlatList/index.js b/src/components/CommonComponents/UserProfileFlatList/index.js index 67422d08..ba452777 100644 --- a/src/components/CommonComponents/UserProfileFlatList/index.js +++ b/src/components/CommonComponents/UserProfileFlatList/index.js @@ -26,6 +26,7 @@ import DeleteVideo from "../DeleteVideo"; import Colors from '../../../theme/styles/Colors'; import CommonStyle from "../../../theme/styles/Common" import VideoThumbnailItem from '../VideoThumbnailItem'; +import DataContract from '../../../constants/DataContract'; class UserProfileFlatList extends PureComponent { @@ -149,7 +150,7 @@ class UserProfileFlatList extends PureComponent { style={{width: (Dimensions.get('window').width - 6) / 2, margin: 1, position: 'absolute', top: 0, left: 0, zIndex: 1, alignItems: 'flex-end'}} > - {this.removeVideo(videoId , index )}} /> + {this.removeVideo(videoId , index )}} /> } { - //TODO @preshita - new PepoApi(`/videos/${this.videoId}`)// new PepoApi(`/replies/${this.replyId}`) + new PepoApi(`/replies/${this.replyId}`) .get() .then((res) => {}) .catch((error) => {}); }; - //TODO @preshita move to share icon - shareVideo = () => { - let shareVideo = new ShareVideo(this.replyId); - shareVideo.perform(); - }; - //TODO @preshita move to bottom status navigateToUserProfile = (e) => { if (utilities.checkActiveUser()) { diff --git a/src/components/FullScreenVideoCollection/FullScreeVideoRow.js b/src/components/FullScreenVideoCollection/FullScreeVideoRow.js index 812fea9d..ecf9466a 100644 --- a/src/components/FullScreenVideoCollection/FullScreeVideoRow.js +++ b/src/components/FullScreenVideoCollection/FullScreeVideoRow.js @@ -11,7 +11,6 @@ import CurrentUser from '../../models/CurrentUser'; import BottomStatus from '../Home/BottomStatus'; import VideoAmountStat from '../CommonComponents/VideoAmoutStat'; -import ShareVideo from '../../services/shareVideo'; import inlineStyles from './styles'; import utilities from '../../services/Utilities'; @@ -34,12 +33,6 @@ class FullScreeVideoRow extends PureComponent { }; - - shareVideo = () => { - let shareVideo = new ShareVideo(this.videoId); - shareVideo.perform(); - }; - navigateToUserProfile = (e) => { if (utilities.checkActiveUser()) { if (this.userId == CurrentUser.getUserId()) { diff --git a/src/components/ReplyCollection/index.js b/src/components/ReplyCollection/index.js index a0ea38d4..93211cd9 100644 --- a/src/components/ReplyCollection/index.js +++ b/src/components/ReplyCollection/index.js @@ -2,13 +2,19 @@ import React, { PureComponent } from 'react'; import { FlatList, ActivityIndicator, - StatusBar + View, + Dimensions } from "react-native"; import {SafeAreaView, withNavigation} from "react-navigation"; +import deepGet from "lodash/get"; +import LinearGradient from "react-native-linear-gradient"; import Pagination from "../../services/Pagination"; import VideoThumbnailItem from '../CommonComponents/VideoThumbnailItem'; -import deepGet from "lodash/get"; +import DeleteVideo from "../CommonComponents/DeleteVideo"; +import inlineStyles from './styles'; +import CurrentUser from '../../models/CurrentUser'; +import DataContract from '../../constants/DataContract'; class VideoReplyList extends PureComponent { @@ -28,6 +34,15 @@ class VideoReplyList extends PureComponent { componentDidMount(){ this.initPagination(); this.refresh(); + this.bindEvents(); + } + + bindEvents(){ + + } + + fetchVideoReply = ()=> { + } componentWillUnmount() { @@ -135,14 +150,49 @@ class VideoReplyList extends PureComponent { }; _renderVideoCell = ({ item, index }) => { - //TODO Let ask BE for same payload - const payload = { user_id : deepGet(item, "payload.user_id") , video_id: deepGet(item, "payload.reply_detail_id")} - return ( + {this.isCurrentUser( userId ) && + + {this.removeVideo(videoId , index )}} /> + + } + {this.onVideoClick(payload, index)}}/>); + onVideoClick={() => {this.onVideoClick(payload, index)}}/> + ); }; + isCurrentUser = ( userId ) => { + return userId === CurrentUser.getUserId(); + } + + removeVideo = (videoId, index) => { + if (index > -1) { + this.videoPagination.deleteItem(videoId , "payload.reply_detail_id"); + let array = [...this.state.list]; // make a separate copy of the array + array.splice(index, 1); + this.setState({list: array}); + } + } + + addVideo = ( item ) => { + this.videoPagination.addItems( item ); + let array = [...this.state.list]; // make a separate copy of the array + array.unshift( item ); + this.setState({list: array}); + } + onVideoClick = (payload, index) => { const clonedInstance = this.videoPagination.fetchServices.cloneInstance(); //TODO @ashutosh to understand diff --git a/src/components/ReplyCollection/styles.js b/src/components/ReplyCollection/styles.js new file mode 100644 index 00000000..9c094b87 --- /dev/null +++ b/src/components/ReplyCollection/styles.js @@ -0,0 +1,12 @@ +import DefaultStyleGenerator from '../../theme/styles/DefaultStyleGenerator'; + +let stylesMap = { + deleteButton: { + height: 24, + width: 40, + justifyContent: 'center', + alignItems: 'center' + } +}; + +export default styles = DefaultStyleGenerator.generate(stylesMap); diff --git a/src/components/UserVideoHistory/UserVideoHistoryRow.js b/src/components/UserVideoHistory/UserVideoHistoryRow.js index 133d6da8..b080c731 100644 --- a/src/components/UserVideoHistory/UserVideoHistoryRow.js +++ b/src/components/UserVideoHistory/UserVideoHistoryRow.js @@ -11,7 +11,6 @@ import CurrentUser from '../../models/CurrentUser'; import BottomStatus from '../Home/BottomStatus'; import VideoAmountStat from '../CommonComponents/VideoAmoutStat'; -import ShareVideo from '../../services/shareVideo'; import inlineStyles from './styles'; import utilities from '../../services/Utilities'; @@ -45,11 +44,6 @@ class UserVideoHistoryRow extends PureComponent { return this.props.userId == CurrentUser.getUserId(); } - shareVideo = () => { - let shareVideo = new ShareVideo(this.props.videoId); - shareVideo.perform(); - }; - onDescriptionClick = ( tapEntity , tapText ) => { if (!tapEntity) { diff --git a/src/constants/DataContract.js b/src/constants/DataContract.js index 0e8c5470..a9ce3de3 100644 --- a/src/constants/DataContract.js +++ b/src/constants/DataContract.js @@ -41,7 +41,10 @@ export default { validateReply: "replies/validate-upload", getReplyListApi : (id) => { return `/videos/${id}/replies` - } + }, + getDeleteVideoReplyApi : (id) => { + return `/replies/${id}/delete`; + } }, common: { @@ -54,6 +57,12 @@ export default { tags: { userTags: "/tags" + }, + + videos: { + getDeleteVideoApi : (id) => { + return `/videos/${id}/delete`; + } } } diff --git a/src/services/Pagination.js b/src/services/Pagination.js index 9329cb97..89510490 100644 --- a/src/services/Pagination.js +++ b/src/services/Pagination.js @@ -111,6 +111,10 @@ class Pagination { console.log("this.fetchServices.results" ,this.fetchServices.results ); } + addItems( items ) { + this.getResults().unshift( items ); + } + }; From b3e3cccb32d5369830860fc990c2499275a4bbad Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Tue, 12 Nov 2019 17:19:24 +0530 Subject: [PATCH 026/302] slide up panel UI --- src/components/VideoReplies/index.js | 56 +++++++++++++++------------ src/components/VideoReplies/styles.js | 7 +++- 2 files changed, 36 insertions(+), 27 deletions(-) diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index 7c4bb9da..29ef363e 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -5,8 +5,7 @@ import { Image, TouchableOpacity, Dimensions, - Animated, - StatusBar + Animated } from "react-native"; import {SafeAreaView} from "react-navigation"; @@ -61,7 +60,7 @@ class VideoRepliesScreen extends PureComponent { } componentWillUnmount() { - onAnimatedValueChange= () => {}; + this.onAnimatedValueChange= () => {}; this.animatedValue.removeListener(this.listener) } @@ -91,45 +90,52 @@ class VideoRepliesScreen extends PureComponent { utilities.handleVideoUploadModal(activeTab, navigation, params); } + onData = ( data ) => { + this.dataLoaded = true; + } + render(){ return ( - (this._panel = c)} - animatedValue={this.animatedValue} - ref={c => (this._panel = c)} - draggableRange={{ - top: height - topPadding - bottomPadding, //TODO check is top expand - bottom: 0 - }} - showBackdrop={this.state.showBackdrop} - snappingPoints={[0, this.initialHeight, height]}> - {dragHandler => ( + (this._panel = c)} + animatedValue={this.animatedValue} + ref={c => (this._panel = c)} + draggableRange={{ + top: height - topPadding - bottomPadding, //TODO check is top expand + bottom: 0 + }} + showBackdrop={this.state.showBackdrop} + snappingPoints={[0, this.initialHeight, height]}> + {dragHandler => ( + + - - + - + - Replies to Frankie + Replies to Frankie {/* {TODO integration pending} */} Send a reply with Pepo5 - + - + - + - )} - + + )} + ); } diff --git a/src/components/VideoReplies/styles.js b/src/components/VideoReplies/styles.js index 1c293a91..9e1e5b4b 100644 --- a/src/components/VideoReplies/styles.js +++ b/src/components/VideoReplies/styles.js @@ -10,12 +10,15 @@ let stylesMap = { backgroundColor: '#fff', }, dragHandler: { - alignSelf: 'stretch', + position: 'absolute', height: 65, + top: -65, alignItems: 'center', justifyContent: 'center', - backgroundColor: '#fff', + backgroundColor: Colors.white, flexDirection: 'row', + zIndex: 9, + width: '100%', borderTopLeftRadius: 30, borderTopRightRadius: 30, overflow: 'hidden' From 629dea928c1a353df44be4b77d0f13182cf8ee25 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Tue, 12 Nov 2019 19:01:49 +0530 Subject: [PATCH 027/302] Minor fix --- RootNavigationContainer.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/RootNavigationContainer.js b/RootNavigationContainer.js index 1d15e2c5..43265094 100644 --- a/RootNavigationContainer.js +++ b/RootNavigationContainer.js @@ -118,12 +118,17 @@ const txModalConfig = { const IOS_MODAL_ROUTES = ['VideoReplies']; let dynamicModalTransition = (transitionProps, prevTransitionProps) => { - const isModal = IOS_MODAL_ROUTES.some( - screenName => - screenName === transitionProps.scene.route.routeName || - (prevTransitionProps && - screenName === prevTransitionProps.scene.route.routeName) - ); + let isModal = false; + const scene = transitionProps.scene; + let routeName = scene.route.routeName; + if( IOS_MODAL_ROUTES.includes(routeName) ) { + let sceneLen = transitionProps.scenes.length; + if ( sceneLen && transitionProps.scenes[sceneLen - 1] === scene ) { + isModal = true; + } else { + console.log("transitionProps===== :: ignoring modal transition"); + } + } return StackViewTransitionConfigs.defaultTransitionConfig( transitionProps, prevTransitionProps, From ed58839b7bdd7a124e88245f8a6b0a6a4d88c0e7 Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Tue, 12 Nov 2019 19:31:10 +0530 Subject: [PATCH 028/302] camera worker changes --- src/components/CaptureVideo/index.js | 15 +- .../CommonComponents/ReplyIcon/index.js | 6 +- src/components/FanVideoDetails/index.js | 98 +++++++++- src/components/FanVideoDetails/styles.js | 20 ++ src/components/FanVideoReplyDetails/index.js | 36 +++- src/components/FanVideoReplyDetails/styles.js | 9 + src/components/VideoRecorder/index.js | 61 +++--- src/constants/DataContract.js | 5 +- src/services/CameraWorker.js | 176 +++++++++++++++++- 9 files changed, 371 insertions(+), 55 deletions(-) diff --git a/src/components/CaptureVideo/index.js b/src/components/CaptureVideo/index.js index b0eaeee9..1a11edeb 100644 --- a/src/components/CaptureVideo/index.js +++ b/src/components/CaptureVideo/index.js @@ -37,15 +37,24 @@ class CaptureVideo extends Component { this.videoType = null; this.proceedWithExisting = null; this.setReplyVideoParams(); + this.showCoachForVideoRecord(); } componentDidMount () { + + } + + + showCoachForVideoRecord() { + const oThis = this; if (! this.isVideoTypeReply) { - utilities.getItem(`${CurrentUser.getUserId()}-accepted-camera-t-n-c`).then((terms) => { - this.setState({ acceptedCameraTnC: terms }); - }); + utilities.getItem(`${CurrentUser.getUserId()}-accepted-camera-t-n-c`).then((terms) => { + console.log(terms, 'acceptedCameraTnCacceptedCameraTnCacceptedCameraTnCacceptedCameraTnC'); + oThis.setState({ acceptedCameraTnC: terms }); + console.log('acceptedCameraTnC:::acceptedCameraTnC', oThis.state.acceptedCameraTnC); + }); } } diff --git a/src/components/CommonComponents/ReplyIcon/index.js b/src/components/CommonComponents/ReplyIcon/index.js index 73a5cf0c..4d513ced 100644 --- a/src/components/CommonComponents/ReplyIcon/index.js +++ b/src/components/CommonComponents/ReplyIcon/index.js @@ -40,7 +40,7 @@ class ReplyIcon extends PureComponent { return this.getWeiToNumber(this.props.balance) >= this.getWeiToNumber(this.props.requiredPepo); }; - getWeiToNumber = ( val ) => { //Move this to utilities + getWeiToNumber = ( val ) => { //Move this to utilities return val && Math.floor(Number(pricer.getFromDecimal(val))) || 0; }; @@ -52,12 +52,12 @@ class ReplyIcon extends PureComponent { return; } - if (this.props.videoReplyCount > 0 || true){ //TODO remove || true + if (this.props.videoReplyCount > 0 ){ this.props.navigation.push('VideoReplies', {'videoId': this.props.videoId , 'userId': this.props.userId, 'amount': this.props.requiredPepo, - 'videoReplyCount': this.props.videoReplyCount || 1 //TODO @preshita remove this + 'videoReplyCount': this.props.videoReplyCount }); } else { let activeTab = NavigationService.getActiveTab(); diff --git a/src/components/FanVideoDetails/index.js b/src/components/FanVideoDetails/index.js index 2d1afc8f..95bdf89e 100644 --- a/src/components/FanVideoDetails/index.js +++ b/src/components/FanVideoDetails/index.js @@ -6,7 +6,8 @@ import { View, Text, Keyboard, - ScrollView + ScrollView, + TextInput } from 'react-native'; import deepGet from 'lodash/get'; import utilities from '../../services/Utilities'; @@ -27,6 +28,8 @@ import { upsertRecordedVideo } from '../../actions'; import multipleClickHandler from '../../services/MultipleClickHandler'; import { getBottomSpace } from 'react-native-iphone-x-helper'; import { StackActions } from 'react-navigation'; +import PepoApi from "../../services/PepoApi"; +import DataContract from "../../constants/DataContract"; const mapStateToProps = (state, ownProps) => { return { @@ -67,19 +70,25 @@ class FanVideoDetails extends Component { static saveToRedux = (navigation) => { let desc = navigation.state.params.videoDesc, - link = navigation.state.params.videoLink; - Store.dispatch(upsertRecordedVideo({ video_desc: desc, video_link: link })); + link = navigation.state.params.videoLink, + amount = navigation.state.params.replyAmount; + Store.dispatch(upsertRecordedVideo({ video_desc: desc, video_link: link, reply_amount:amount })); }; constructor(props) { super(props); this.videoDesc = this.props.recordedVideo.video_desc; this.videoLink = this.props.recordedVideo.video_link; + this.replyAmount = this.props.recordedVideo.reply_amount; this.state = { viewStyle: { paddingBottom: 10 }, - error: null + error: null, + amountError: null, + linkError: null, + descError : null + }; } _keyboardShown = (e) => { @@ -110,7 +119,8 @@ class FanVideoDetails extends Component { componentDidMount() { this.props.navigation.setParams({ videoDesc: this.props.recordedVideo.video_desc, - videoLink: this.props.recordedVideo.video_link + videoLink: this.props.recordedVideo.video_link, + replyAmount: this.props.recordedVideo.reply_amount }); } @@ -123,15 +133,67 @@ class FanVideoDetails extends Component { enableStartUploadFlag = () => { // if (!this.validLink()) return; + this.clearErrors(); + this.validateData().then((res)=>{ + + console.log('CurrentUser.getUserId()CurrentUser.getUserId()', CurrentUser.getUserId()); utilities.saveItem(`${CurrentUser.getUserId()}-accepted-camera-t-n-c`, true); Store.dispatch( - upsertRecordedVideo({ video_desc: this.videoDesc, video_link: this.videoLink, do_upload: true }) + upsertRecordedVideo({ video_desc: this.videoDesc, video_link: this.videoLink, reply_amount: this.replyAmount, do_upload: true }) ); this.props.navigation.dispatch(StackActions.popToTop()); this.props.navigation.dispatch(StackActions.popToTop()); - this.props.navigation.navigate('HomeScreen'); + this.props.navigation.navigate('HomeScreen'); + }).catch((err)=>{ + // show error on UI. + this.showError(err); + }); + }; + + clearErrors = () => { + this.setState({ + linkError: null, + descError: null, + amountError: null, + error: null + }); + }; + + showError = (err) => { + for (let error of err.error_data){ + switch (error.parameter) { + case "link": + this.setState({linkError: error.msg}); + break; + case "video_description": + this.setState({descError: error.msg}); + break; + case "per_reply_amount_in_wei": + this.setState({amountError: error.msg}); + break; + } + } }; + validateData = () => { + let params = {}; + params['video_description'] = this.videoDesc; + params['link'] = this.videoLink; + params['per_reply_amount_in_wei'] = this.replyAmount; + return new Promise((resolve, reject) => { + new PepoApi(DataContract.replies.validatePost) + .post(params) + .then((res)=>{ + if (res && res.success){ + return resolve(res); + } else { + return reject(res.err); + } + }) + }); + }; + + onChangeDesc = (desc) => { this.videoDesc = desc; //Done for the value to be accessible in static navigationOptions @@ -175,6 +237,15 @@ class FanVideoDetails extends Component { return true; }; + + replyAmountChange = (amount) => { + this.replyAmount = amount; + //Done for the value to be accessible in static navigationOptions + this.props.navigation.setParams({ + replyAmount: amount + }); + }; + render() { let imageUrl = this.props.recordedVideo.cover_image; return ( @@ -199,10 +270,19 @@ class FanVideoDetails extends Component { - - Link + {this.state.descError } + + Link + {this.state.linkError } + + Set Price for replies + + + + {this.state.amountError } + {this.state.error} diff --git a/src/components/FanVideoDetails/styles.js b/src/components/FanVideoDetails/styles.js index 139fbac3..6a81263e 100644 --- a/src/components/FanVideoDetails/styles.js +++ b/src/components/FanVideoDetails/styles.js @@ -31,6 +31,26 @@ let stylesMap = { paddingHorizontal: 15, paddingVertical: 20 }, + videoLinkItem: { + flexDirection: 'row', + borderBottomWidth: 1, + borderColor: '#ccd3cd', + paddingBottom: 16, + alignItems: 'center', + paddingHorizontal: 12, + zIndex: -1 + }, + videoAmountItem: { + flexDirection: 'row', + borderBottomWidth: 1, + borderColor: '#ccd3cd', + + alignItems: 'center', + paddingBottom: 16, + paddingHorizontal: 12, + zIndex: -1 + + }, videoDescription: { color: 'rgba(42, 41, 59, 0.8)', // flex: 1, diff --git a/src/components/FanVideoReplyDetails/index.js b/src/components/FanVideoReplyDetails/index.js index 4fce518e..278ed27c 100644 --- a/src/components/FanVideoReplyDetails/index.js +++ b/src/components/FanVideoReplyDetails/index.js @@ -92,7 +92,9 @@ class FanVideoReplyDetails extends Component { viewStyle: { paddingBottom: 10 }, - error: null + error: null, + linkError: null, + descError : null }; } _keyboardShown = (e) => { @@ -135,6 +137,7 @@ class FanVideoReplyDetails extends Component { } enableStartUploadFlag = () => { + this.clearErrors(); this.validateData().then((res)=>{ Store.dispatch( upsertRecordedVideo({ video_desc: this.videoDesc, video_link: this.videoLink, do_upload: true }) @@ -144,10 +147,31 @@ class FanVideoReplyDetails extends Component { this.props.navigation.navigate('HomeScreen'); }).catch((err)=>{ // show error on UI. + this.showError(err); }) ; + }; + showError = (err) => { + for (let error of err.error_data){ + switch (error.parameter) { + case "link": + this.setState({linkError: error.msg}); + break; + case "video_description": + this.setState({descError: error.msg}); + break; + } + } + }; + + clearErrors = () => { + this.setState({ + linkError: null, + descError: null, + error: null + }); }; @@ -156,7 +180,7 @@ class FanVideoReplyDetails extends Component { params['video_description'] = this.videoDesc; params['link'] = this.videoLink; params['parent_kind'] = 'video'; - params['parent_id'] = this.replyObject.parent_video_id; + params['parent_id'] = this.replyObject.replyReceiverVideoId; return new Promise((resolve, reject) => { new PepoApi(DataContract.replies.validateReply) @@ -165,7 +189,7 @@ class FanVideoReplyDetails extends Component { if (res && res.success){ return resolve(res); } else { - return reject(res); + return reject(res.err); } }) }); @@ -219,7 +243,7 @@ class FanVideoReplyDetails extends Component { }; getAmountToSend = () => { - return this.replyObject.amount_to_send || 0; + return this.replyObject.amountToSendWithReply || 0; }; render() { @@ -246,10 +270,12 @@ class FanVideoReplyDetails extends Component { - + {this.state.descError } + Link + {this.state.linkError } {this.state.error} diff --git a/src/components/FanVideoReplyDetails/styles.js b/src/components/FanVideoReplyDetails/styles.js index 993a8497..4660b8fe 100644 --- a/src/components/FanVideoReplyDetails/styles.js +++ b/src/components/FanVideoReplyDetails/styles.js @@ -48,6 +48,15 @@ let stylesMap = { paddingLeft: 0, height: 100 }, + videoLinkItem: { + flexDirection: 'row', + borderBottomWidth: 1, + borderColor: '#ccd3cd', + paddingBottom: 16, + alignItems: 'center', + paddingHorizontal: 12, + zIndex: -1 + }, dropDownStyle: { marginLeft: -90, width: Dimensions.get('window').width, diff --git a/src/components/VideoRecorder/index.js b/src/components/VideoRecorder/index.js index 72f4d681..12437880 100644 --- a/src/components/VideoRecorder/index.js +++ b/src/components/VideoRecorder/index.js @@ -22,10 +22,11 @@ import { upsertRecordedVideo } from '../../actions'; import closeIcon from '../../assets/camera-cross-icon.png'; import { withNavigation } from 'react-navigation'; import AppConfig from '../../constants/AppConfig'; -import utilities from '../../services/Utilities'; -import CurrentUser from '../../models/CurrentUser'; +import deepGet from 'lodash/get'; import LinearGradient from "react-native-linear-gradient"; import Theme from "../../theme/styles"; +import multipleClickHandler from "../../services/MultipleClickHandler"; +import TouchableButton from "../FanVideoReplyDetails/TouchableButton"; const ACTION_SHEET_BUTTONS = ['Reshoot', 'Continue with already recorded']; const ACTION_SHEET_CONTINUE_INDEX = 1; const ACTION_SHEET_RESHOOT_INDEX = 0; @@ -51,6 +52,18 @@ class VideoRecorder extends Component { nextAppState === 'background' && this.cancleVideoHandling(); }; + componentWillReceiveProps( nextProps ){ + let newState; + if( nextProps.acceptedCameraTnC != this.state.acceptedCameraTnC ){ + this.setState({acceptedCameraTnC: nextProps.acceptedCameraTnC }) + } + + if ( nextProps.hasVideoReplies != this.state.hasVideoReplies ) { + this.setState({hasVideoReplies: nextProps.hasVideoReplies }) + } + } + + isStaleReduxObjectPresent(){ let acceptableKeys = ['reply_obj', 'video_type']; @@ -64,14 +77,6 @@ class VideoRecorder extends Component { async componentDidMount() { - // if (!this.props.isVideoTypeReply) { - // if (this.props.acceptedCameraTnC === null) { - // utilities.getItem(`${CurrentUser.getUserId()}-accepted-camera-t-n-c`).then((terms) => { - // this.setState({ acceptedCameraTnC: terms }); - // }); - // } - // } - BackHandler.addEventListener('hardwareBackPress', this._handleBackPress); AppState.addEventListener('change', this._handleAppStateChange); if (this.props.actionSheetOnRecordVideo) { @@ -159,10 +164,18 @@ class VideoRecorder extends Component { return isFileExists; }; + getPepoAmount = () => { + return deepGet(this.recordedVideoObj, 'reply_obj.amountToSendWithReply'); + }; + + getUserName = () => { + let userId = deepGet(this.recordedVideoObj, 'reply_obj.replyReceiverUserId'); + return reduxGetters.getUserName(userId) + }; + showCoachForPosting = () => { // If already recorded video present in local, do not show coach. - console.log('showCoachForPosting :::'); if (this.state.isLocalVideoPresent) return; if (this.props.isVideoTypeReply) { @@ -178,7 +191,7 @@ class VideoRecorder extends Component { - Be the first one to reply to @annikpolit’s video, once you postt the reply you will pay 5 Pepo Coins + Be the first one to reply to @{this.getUserName()}’s video, once you postt the reply you will pay {this.getPepoAmount()} Pepo Coins - - - Reply - - + { + this.replyToVideo(); + })} + /> @@ -206,7 +218,10 @@ class VideoRecorder extends Component { } // if (no video reply present) { return Coach } } else { + console.log(this.state.acceptedCameraTnC, 'this.state.acceptedCameraTnC-----------'); if (this.state.acceptedCameraTnC !== 'true'){ + console.log('=========----============-----------'); + return Submit your first video diff --git a/src/constants/DataContract.js b/src/constants/DataContract.js index a9ce3de3..620e88ee 100644 --- a/src/constants/DataContract.js +++ b/src/constants/DataContract.js @@ -38,13 +38,14 @@ export default { }, replies: { - validateReply: "replies/validate-upload", + validateReply: "/replies/validate-upload", getReplyListApi : (id) => { return `/videos/${id}/replies` }, getDeleteVideoReplyApi : (id) => { return `/replies/${id}/delete`; - } + }, + validatePost: "/videos/validate-upload" }, common: { diff --git a/src/services/CameraWorker.js b/src/services/CameraWorker.js index 61007edf..686b4204 100644 --- a/src/services/CameraWorker.js +++ b/src/services/CameraWorker.js @@ -29,6 +29,7 @@ const recordedVideoStates = [ 's3_cover_image', 'video_desc', 'video_link', + 'reply_amount', 'video_type', 'reply_obj' ]; @@ -120,18 +121,169 @@ class CameraWorker extends PureComponent { console.log( 'processVideo :: Got upload consent. Uploading video and cover image to s3 and attempting post Video with Cover Image...' ); - this.updateProfileViewRawVideo(); - await this.uploadVideo(); - await this.uploadCoverImage(); - await this.postVideoWithCoverImage(); + await this.processVideoBasedOnType (); + } } - updateProfileViewRawVideo() { - if (this.props.recorded_video.cover_image && !this.props.recorded_video.video_s3_upload_processing) { - // this.updateProfileViewVideo(this.props.recorded_video.cover_image, this.props.recorded_video.raw_video); + + processVideoBasedOnType = async () => { + let videoType = this.props.recorded_video.video_type; + if (! videoType){ + return; } - } + if (videoType === 'post'){ + await this.processPostVideo(); + } else if (videoType === 'reply'){ + await this.processReplyVideo(); + } + }; + + + processPostVideo = async () => { + await this.uploadVideo(); + await this.uploadCoverImage(); + await this.postVideoToPepoApi(); + }; + + + processReplyVideo = async () => { + let sessionCreated = await this.sessionHandling(); + + if (! sessionCreated){ + return ; + } + await this.uploadReplyVideo(); + + + }; + + uploadReplyVideo = async () => { + await this.uploadVideo(); + await this.uploadCoverImage(); + await this.postReplyVideoToPepoApi(); + }; + + + postReplyVideoToPepoApi = async () => { + let replyDetailId = this.props.recorded_video.reply_obj.replyDetailId; + + if (replyDetailId){ + // we have reply + return true + } + if ( + this.props.recorded_video.s3_video && + !this.props.recorded_video.pepo_api_posting && + !this.postToPepoApi + ) { + this.postToPepoApi = true; + let videoInfo = await RNFS.stat(this.props.recorded_video.compressed_video); + let videoSize = videoInfo.size; + let imageInfo, imageSize; + if(this.props.recorded_video.cover_image !== INVALID){ + imageInfo = await RNFS.stat(this.props.recorded_video.cover_image); + imageSize = imageInfo.size; + } + + Store.dispatch( + upsertRecordedVideo({ + pepo_api_posting: true + }) + ); + + let payloadWithoutImage = { + video_url: this.props.recorded_video.s3_video, + video_description: this.props.recorded_video.video_desc, + link: this.props.recorded_video.video_link, + video_width: appConfig.cameraConstants.VIDEO_WIDTH, + video_height: appConfig.cameraConstants.VIDEO_HEIGHT, + image_width: appConfig.cameraConstants.VIDEO_WIDTH, + image_height: appConfig.cameraConstants.VIDEO_HEIGHT, + video_size: videoSize, + per_reply_amount_in_wei: String(this.props.recorded_video.reply_amount) + }; + + let payload = payloadWithoutImage; + + if(this.props.recorded_video.cover_image !== INVALID){ + payload = { + ...payload, + poster_image_url: this.props.recorded_video.s3_cover_image, + image_size: imageSize + }; + } + + new PepoApi(`/users/${this.props.currentUserId}/fan-video`) + .post(payload) + .then((responseData) => { + if (responseData.success && responseData.data) { + console.log('Video uploaded Successfully'); + Toast.show({ + text: 'Your video uploaded successfully.', + icon: 'success', + imageUri: this.props.recorded_video.cover_image + }); + Store.dispatch( + upsertRecordedVideo({ + do_discard: true, + pepo_api_posting: false + }) + ); + } else { + videoUploaderComponent.emit('hide'); + Store.dispatch(videoInProcessing(false)); + } + this.postToPepoApi = false; + }) + .catch(() => { + this.postToPepoApi = false; + Store.dispatch( + upsertRecordedVideo({ + pepo_api_posting: false + }) + ); + Toast.show({ + text: 'Video upload failed - Try Again', + icon: 'error' + }); + }); + } + + + // here we will get reply_id + + + }; + + + + + + + + sessionHandling = async () => { + let isSessionActive = await this.checkForActiveSession(); + if (isSessionActive){ + return true; + } else { + return await this.activateSession(); + } + }; + + + checkForActiveSession = async () => { + // check If session active + }; + + activateSession = async () => { + // Activate session. + }; + + + + + async cleanUp() { // stop ffmpge processing @@ -337,7 +489,7 @@ class CameraWorker extends PureComponent { return uploadToS3.perform(); } - async postVideoWithCoverImage() { + async postVideoToPepoApi() { if ( this.props.recorded_video.s3_video && !this.props.recorded_video.pepo_api_posting && @@ -366,7 +518,8 @@ class CameraWorker extends PureComponent { video_height: appConfig.cameraConstants.VIDEO_HEIGHT, image_width: appConfig.cameraConstants.VIDEO_WIDTH, image_height: appConfig.cameraConstants.VIDEO_HEIGHT, - video_size: videoSize + video_size: videoSize, + per_reply_amount_in_wei: String(this.props.recorded_video.reply_amount) }; let payload = payloadWithoutImage; @@ -395,6 +548,9 @@ class CameraWorker extends PureComponent { pepo_api_posting: false }) ); + } else { + videoUploaderComponent.emit('hide'); + Store.dispatch(videoInProcessing(false)); } this.postToPepoApi = false; }) From 325cb72df47a6593de7e3c63818fa579147d3a3d Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Tue, 12 Nov 2019 19:42:26 +0530 Subject: [PATCH 029/302] Navigation Code --- RootNavigationContainer.js | 72 +++++++------------ .../FullScreenReplyCollection/index.js | 6 +- .../Transaction/TransactionScreen.js | 2 +- 3 files changed, 30 insertions(+), 50 deletions(-) diff --git a/RootNavigationContainer.js b/RootNavigationContainer.js index 43265094..037c6626 100644 --- a/RootNavigationContainer.js +++ b/RootNavigationContainer.js @@ -87,7 +87,7 @@ const modalStackConfig = { const txModalConfig = { transparentCard: true, - cardStyle: { backgroundColor: 'rgba(0,0,0,0.5)' }, + cardStyle: { backgroundColor: 'rgba(0,0,0,0)' }, gesturesEnabled: false, transitionConfig: () => ({ transitionSpec: { @@ -116,32 +116,6 @@ const txModalConfig = { }; -const IOS_MODAL_ROUTES = ['VideoReplies']; -let dynamicModalTransition = (transitionProps, prevTransitionProps) => { - let isModal = false; - const scene = transitionProps.scene; - let routeName = scene.route.routeName; - if( IOS_MODAL_ROUTES.includes(routeName) ) { - let sceneLen = transitionProps.scenes.length; - if ( sceneLen && transitionProps.scenes[sceneLen - 1] === scene ) { - isModal = true; - } else { - console.log("transitionProps===== :: ignoring modal transition"); - } - } - return StackViewTransitionConfigs.defaultTransitionConfig( - transitionProps, - prevTransitionProps, - isModal - ); -}; - -//TODO find a way for conditional transparentCard config -const slidingUpConfig = { - transparentCard: true, - transitionConfig: dynamicModalTransition -} - const CaptureVideoStack = createStackNavigator( { CaptureVideo: CaptureVideo, @@ -162,24 +136,34 @@ const InAppBrowserStack = createStackNavigator( } ); +const FullScreenReplyStack = createStackNavigator( + { + FullScreenReplyCollection: FullScreenReplyCollection, + UsersProfileScreen: UsersProfileScreen, + UserVideoHistory: UserVideoHistory, + SupportingListScreen: SupportingListScreen, + SupportersListScreen: SupportersListScreen, + VideoTags: VideoTags, + }, + { + headerLayoutPreset: 'center' + } +); + const HomePushStack = createStackNavigator( { HomeScreen: HomeScreen, UsersProfileScreen: UsersProfileScreen, UserVideoHistory: UserVideoHistory, - VideoReplies: VideoReplies, - FullScreenReplyCollection: FullScreenReplyCollection, SupportingListScreen: SupportingListScreen, SupportersListScreen: SupportersListScreen, VideoTags: VideoTags, - VideoReplies:VideoReplies , FullScreenVideoCollection: FullScreenVideoCollection }, { initialRouteName: 'HomeScreen', - headerLayoutPreset: 'center' , - ...slidingUpConfig + headerLayoutPreset: 'center' } ); @@ -193,6 +177,8 @@ const HomeStack = createStackNavigator( InviteCodeScreen: InviteCodeScreen, AuthDeviceDrawer: AuthDeviceDrawer, AddEmailScreen: AddEmailScreen, + VideoReplies:VideoReplies , + FullScreenReplyCollection: FullScreenReplyStack, CouchMarks: CouchMarks }, { @@ -206,8 +192,6 @@ const NotificationPushStack = createStackNavigator( NotificationScreen: NotificationScreen, UsersProfileScreen: UsersProfileScreen, UserVideoHistory: UserVideoHistory, - VideoReplies: VideoReplies, - FullScreenReplyCollection: FullScreenReplyCollection, VideoPlayer: VideoPlayer, SupportingListScreen: SupportingListScreen, SupportersListScreen: SupportersListScreen, @@ -215,8 +199,7 @@ const NotificationPushStack = createStackNavigator( FullScreenVideoCollection: FullScreenVideoCollection }, { - headerLayoutPreset: 'center', - ...slidingUpConfig + headerLayoutPreset: 'center' } ); @@ -227,7 +210,8 @@ const NotificationStack = createStackNavigator( AuthDeviceDrawer: AuthDeviceDrawer, SayThanksScreen: SayThanksScreen, CaptureVideo: CaptureVideoStack, - VideoReplies: VideoReplies, + VideoReplies:VideoReplies , + FullScreenReplyCollection: FullScreenReplyStack, InAppBrowserStack: InAppBrowserStack }, { ...modalStackConfig, ...txModalConfig } @@ -237,8 +221,6 @@ const ProfilePushStack = createStackNavigator( { ProfileScreen: ProfileScreen, UserVideoHistory: UserVideoHistory, - VideoReplies: VideoReplies, - FullScreenReplyCollection: FullScreenReplyCollection, SupportingListScreen: SupportingListScreen, SupportersListScreen: SupportersListScreen, UsersProfileScreen: UsersProfileScreen, @@ -253,8 +235,7 @@ const ProfilePushStack = createStackNavigator( FullScreenVideoCollection: FullScreenVideoCollection }, { - headerLayoutPreset: 'center', - ...slidingUpConfig + headerLayoutPreset: 'center' } ); @@ -269,6 +250,7 @@ const ProfileStack = createStackNavigator( InAppBrowserStack: InAppBrowserStack, StoreProductsScreen: StoreProductsScreen, VideoReplies: VideoReplies, + FullScreenReplyCollection: FullScreenReplyStack, RedemptiomScreen: RedemptiomScreen }, { @@ -291,14 +273,11 @@ const SearchPushStack = createStackNavigator( SupportingListScreen: SupportingListScreen, SupportersListScreen: SupportersListScreen, UserVideoHistory: UserVideoHistory, - VideoReplies: VideoReplies, - FullScreenReplyCollection: FullScreenReplyCollection, VideoTags: VideoTags, - FullScreenVideoCollection: FullScreenVideoCollection + FullScreenVideoCollection: FullScreenVideoCollection }, { - headerLayoutPreset: 'center', - ...slidingUpConfig + headerLayoutPreset: 'center' } ); @@ -309,6 +288,7 @@ const SearchStack = createStackNavigator( InAppBrowserStack: InAppBrowserStack, TransactionScreen: TransactionScreen, VideoReplies: VideoReplies, + FullScreenReplyCollection: FullScreenReplyStack, AuthDeviceDrawer: AuthDeviceDrawer }, { diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index 1465b4f6..3c882184 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -8,7 +8,7 @@ import backIcon from '../../assets/back-arrow.png'; import plusIcon from '../../assets/user-video-capture-icon-selected.png'; import VideoReply from "./VideoReply";import NavigationService from "../../services/NavigationService"; import utilities from '../../services/Utilities'; - +import crossIcon from '../../assets/cross_icon.png'; const navigateToCamera = (navigation) => { @@ -29,11 +29,11 @@ const HeaderLeft = (props) => { return ( { - props.navigation.goBack(); + props.navigation.goBack(null); }} style={inlineStyles.iconWrapper} > - + ); }; diff --git a/src/components/Transaction/TransactionScreen.js b/src/components/Transaction/TransactionScreen.js index 11506e71..a24605bb 100644 --- a/src/components/Transaction/TransactionScreen.js +++ b/src/components/Transaction/TransactionScreen.js @@ -544,7 +544,7 @@ class TransactionScreen extends Component { } }} > - + From 7ab4df7ce66f0dc0821e8a1426c24b9511fba871 Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Tue, 12 Nov 2019 19:55:22 +0530 Subject: [PATCH 030/302] remove unnecessary comment --- src/components/FanVideoDetails/index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/FanVideoDetails/index.js b/src/components/FanVideoDetails/index.js index 95bdf89e..7f855bcc 100644 --- a/src/components/FanVideoDetails/index.js +++ b/src/components/FanVideoDetails/index.js @@ -134,9 +134,7 @@ class FanVideoDetails extends Component { enableStartUploadFlag = () => { // if (!this.validLink()) return; this.clearErrors(); - this.validateData().then((res)=>{ - - console.log('CurrentUser.getUserId()CurrentUser.getUserId()', CurrentUser.getUserId()); + this.validateData().then((res) => { utilities.saveItem(`${CurrentUser.getUserId()}-accepted-camera-t-n-c`, true); Store.dispatch( upsertRecordedVideo({ video_desc: this.videoDesc, video_link: this.videoLink, reply_amount: this.replyAmount, do_upload: true }) From 36119d7a4ac962bf25c73f76da82d832d277ca45 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Tue, 12 Nov 2019 20:01:47 +0530 Subject: [PATCH 031/302] code changes --- .../CommonComponents/ReplyIcon/index.js | 4 +++- .../FullScreenReplyCollection/index.js | 11 ++++++++-- src/components/ReplyCollection/index.js | 20 +++++++++++++------ src/components/VideoReplies/index.js | 13 +++++++----- src/constants/DataContract.js | 19 ++++++++++-------- src/helpers/Emitters.js | 3 ++- 6 files changed, 47 insertions(+), 23 deletions(-) diff --git a/src/components/CommonComponents/ReplyIcon/index.js b/src/components/CommonComponents/ReplyIcon/index.js index 4d513ced..bdf291c1 100644 --- a/src/components/CommonComponents/ReplyIcon/index.js +++ b/src/components/CommonComponents/ReplyIcon/index.js @@ -22,7 +22,8 @@ const mapStateToProps = (state , ownProps) => { balance : state.balance, requiredPepo : reduxGetter.getVideoReplyAmount(ownProps.videoId, state), videoReplyCount : reduxGetter.getVideoReplyCount(ownProps.videoId, state), - isReplyAllowed : reduxGetter.getVideoReplyAllowed(ownProps.videoId, state) + isReplyAllowed : reduxGetter.getVideoReplyAllowed(ownProps.videoId, state), + userName : reduxGetter.getUserName(ownProps.userId) } }; @@ -56,6 +57,7 @@ class ReplyIcon extends PureComponent { this.props.navigation.push('VideoReplies', {'videoId': this.props.videoId , 'userId': this.props.userId, + 'userName': this.props.userName, 'amount': this.props.requiredPepo, 'videoReplyCount': this.props.videoReplyCount }); diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index 3c882184..272faa60 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -5,10 +5,13 @@ import deepGet from "lodash/get"; import Pagination from "../../services/Pagination"; import inlineStyles from "./styles"; import backIcon from '../../assets/back-arrow.png'; +import pepoIcon from '../../assets/pepo-tx-icon.png'; import plusIcon from '../../assets/user-video-capture-icon-selected.png'; import VideoReply from "./VideoReply";import NavigationService from "../../services/NavigationService"; import utilities from '../../services/Utilities'; import crossIcon from '../../assets/cross_icon.png'; +import ReduxGetters from "../../services/ReduxGetters"; + const navigateToCamera = (navigation) => { @@ -47,12 +50,16 @@ const HeaderLeft = (props) => { }; const HeaderTitle = (props) => { + let userId = props.navigation.getParam('parentUserId'), + userName = ReduxGetters.getUserName(userId); return ( - Replies to Frankie + Replies to {userName} - Send a reply with Pepo5 + Send a reply with{' '} + + {props.navigation.getParam('amount')} ); }; diff --git a/src/components/ReplyCollection/index.js b/src/components/ReplyCollection/index.js index 63a99ee4..6ddb7a23 100644 --- a/src/components/ReplyCollection/index.js +++ b/src/components/ReplyCollection/index.js @@ -2,11 +2,10 @@ import React, { PureComponent } from 'react'; import { FlatList, ActivityIndicator, - Text, - StatusBar, + Dimensions, View } from "react-native"; -import {SafeAreaView, withNavigation} from "react-navigation"; +import { withNavigation} from "react-navigation"; import deepGet from "lodash/get"; import LinearGradient from "react-native-linear-gradient"; @@ -16,6 +15,8 @@ import DeleteVideo from "../CommonComponents/DeleteVideo"; import inlineStyles from './styles'; import CurrentUser from '../../models/CurrentUser'; import DataContract from '../../constants/DataContract'; +import { VideoReplyEmitter } from '../../helpers/Emitters'; +import PepoApi from '../../services/PepoApi'; class VideoReplyList extends PureComponent { @@ -40,11 +41,18 @@ class VideoReplyList extends PureComponent { } bindEvents(){ - + VideoReplyEmitter.on('videoUploaded', ( payload )=>{ + this.fetchVideoReply( payload.videoId ); + }) } - fetchVideoReply = ()=> { - + fetchVideoReply = (id)=> { + new PepoApi(DataContract.replies.getSingleVideoReplyApi(id)) + .get() + .then((res)=> { + let newVideoReply = res.data['result_type']; + this.addVideo( newVideoReply ); + }) } componentWillUnmount() { diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index 29ef363e..e8706dc9 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -7,9 +7,9 @@ import { Dimensions, Animated } from "react-native"; -import {SafeAreaView} from "react-navigation"; import plusIcon from '../../assets/user-video-capture-icon-selected.png'; +import pepoIcon from "../../assets/pepo-tx-icon.png"; import inlineStyles from './styles'; import crossIcon from '../../assets/cross_icon.png'; import ReplyCollection from '../ReplyCollection'; @@ -38,6 +38,7 @@ class VideoRepliesScreen extends PureComponent { constructor(props){ super(props); this.userId = props.navigation.getParam('userId'); + this.userName = props.navigation.getParam('userName'); this.videoId = props.navigation.getParam('videoId'); this.amount = props.navigation.getParam('amount'); this.videoReplyCount = props.navigation.getParam('videoReplyCount'); @@ -84,8 +85,8 @@ class VideoRepliesScreen extends PureComponent { videoTypeReply: true, videoId: this.videoId, userId: this.userId, - amount: navigation.getParam('amount'), - videoReplyCount: navigation.getParam('videoReplyCount') + amount: this.amount, + videoReplyCount: this.videoReplyCount }; utilities.handleVideoUploadModal(activeTab, navigation, params); } @@ -116,10 +117,12 @@ class VideoRepliesScreen extends PureComponent { - Replies to Frankie + Replies to {this.userName} {/* {TODO integration pending} */} - Send a reply with Pepo5 + Send a reply with{' '} + + {this.amount} diff --git a/src/constants/DataContract.js b/src/constants/DataContract.js index 620e88ee..ab5500a0 100644 --- a/src/constants/DataContract.js +++ b/src/constants/DataContract.js @@ -38,14 +38,17 @@ export default { }, replies: { - validateReply: "/replies/validate-upload", - getReplyListApi : (id) => { - return `/videos/${id}/replies` - }, - getDeleteVideoReplyApi : (id) => { - return `/replies/${id}/delete`; - }, - validatePost: "/videos/validate-upload" + validateReply: "/replies/validate-upload", + getReplyListApi : (id) => { + return `/videos/${id}/replies` + }, + getDeleteVideoReplyApi : (id) => { + return `/replies/${id}/delete`; + }, + validatePost: "/videos/validate-upload", + getSingleVideoReplyApi : (id) => { + return `/replies/${id}`; + } }, common: { diff --git a/src/helpers/Emitters.js b/src/helpers/Emitters.js index c63dce6a..13a77023 100644 --- a/src/helpers/Emitters.js +++ b/src/helpers/Emitters.js @@ -1,5 +1,6 @@ import EventEmitter from 'eventemitter3'; let VideoPlayPauseEmitter = new EventEmitter(); let DrawerEmitter = new EventEmitter(); +let VideoReplyEmitter = new EventEmitter(); -export { VideoPlayPauseEmitter, DrawerEmitter }; +export { VideoPlayPauseEmitter, DrawerEmitter, VideoReplyEmitter }; From 57b4bb403d346f0d868b67d30a3efc2ed932fe31 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Tue, 12 Nov 2019 20:58:57 +0530 Subject: [PATCH 032/302] code changes --- src/components/VideoReplies/index.js | 139 ++++++++++++++++++--------- 1 file changed, 95 insertions(+), 44 deletions(-) diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index e8706dc9..df69ccc5 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -7,6 +7,7 @@ import { Dimensions, Animated } from "react-native"; +import { ifIphoneX } from 'react-native-iphone-x-helper'; import plusIcon from '../../assets/user-video-capture-icon-selected.png'; import pepoIcon from "../../assets/pepo-tx-icon.png"; @@ -17,7 +18,8 @@ import NavigationService from "../../services/NavigationService"; import utilities from "../../services/Utilities"; import SlidingUpPanel from "../CommonComponents/SlidingUpPanel"; - +import VideoLoadingFlyer from '../CommonComponents/VideoLoadingFlyer'; +import videoUploaderComponent from '../../services/CameraWorkerEventEmitter'; import { getInset } from 'react-native-safe-area-view'; import DataContract from '../../constants/DataContract'; @@ -49,26 +51,49 @@ class VideoRepliesScreen extends PureComponent { this.panelAnimateTimeOut = 0 ; this.state = { - showBackdrop : false + showBackdrop : false, + videoUploaderVisible: false, + videoUploaderText: 'Posting reply' } } componentDidMount(){ this.listener = this.animatedValue.addListener(this.onAnimatedValueChange); setTimeout(()=> { - this.setState({showBackdrop: true}); + this.setState({ + showBackdrop: true, + videoUploaderVisible: true//find from redux @mayur + }); + }, 500) + videoUploaderComponent.on('show', this.showVideoUploader); + videoUploaderComponent.on('hide', this.hideVideoUploader); } componentWillUnmount() { this.onAnimatedValueChange= () => {}; - this.animatedValue.removeListener(this.listener) + this.animatedValue.removeListener(this.listener); + videoUploaderComponent.removeListener('show'); + videoUploaderComponent.removeListener('hide'); } + showVideoUploader = () => { + this.setState({ + videoUploaderVisible: true + }); + }; + + hideVideoUploader = () => { + this.setState({ + videoUploaderVisible: false + }); + }; + onAnimatedValueChange = ({ value }) => { clearTimeout(this.panelAnimateTimeOut); this.panelAnimateTimeOut = setTimeout(()=> { if( value < 10){ + this.hideVideoUploader(); this.props.navigation.goBack(); } } , 10) @@ -97,48 +122,74 @@ class VideoRepliesScreen extends PureComponent { render(){ return ( - (this._panel = c)} - animatedValue={this.animatedValue} - ref={c => (this._panel = c)} - draggableRange={{ - top: height - topPadding - bottomPadding, //TODO check is top expand - bottom: 0 - }} - showBackdrop={this.state.showBackdrop} - snappingPoints={[0, this.initialHeight, height]}> - {dragHandler => ( - - - - - - - - - - - Replies to {this.userName} - - {/* {TODO integration pending} */} - Send a reply with{' '} - - {this.amount} - - - - - + + {this.userId && this.state.videoUploaderVisible && ( + + )} + (this._panel = c)} + containerStyle={{zIndex: 99}} + animatedValue={this.animatedValue} + ref={c => (this._panel = c)} + draggableRange={{ + top: height - topPadding - bottomPadding, //TODO check is top expand + bottom: 0 + }} + showBackdrop={this.state.showBackdrop} + snappingPoints={[0, this.initialHeight, height]}> + {dragHandler => ( + + + + + + + + + + + Replies to {this.userName} + + {/* {TODO integration pending} */} + Send a reply with{' '} + + {this.amount} + + + + + + + - - - - )} - + + )} + + ); } From ade7592e964478902ee2da5df0715e9039f33a1e Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Tue, 12 Nov 2019 21:03:45 +0530 Subject: [PATCH 033/302] pepo capture camera --- src/components/VideoReplies/index.js | 2 +- src/services/CameraWorker.js | 19 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index df69ccc5..b8973159 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -113,7 +113,7 @@ class VideoRepliesScreen extends PureComponent { amount: this.amount, videoReplyCount: this.videoReplyCount }; - utilities.handleVideoUploadModal(activeTab, navigation, params); + utilities.handleVideoUploadModal(activeTab, this.props.navigation, params); } onData = ( data ) => { diff --git a/src/services/CameraWorker.js b/src/services/CameraWorker.js index 686b4204..697b96b0 100644 --- a/src/services/CameraWorker.js +++ b/src/services/CameraWorker.js @@ -2,6 +2,7 @@ import React, { PureComponent } from 'react'; import { connect } from 'react-redux'; import RNFS from 'react-native-fs'; import Store from '../store'; +import deepGet from 'lodash/get'; import { upsertRecordedVideo, @@ -166,9 +167,10 @@ class CameraWorker extends PureComponent { postReplyVideoToPepoApi = async () => { - let replyDetailId = this.props.recorded_video.reply_obj.replyDetailId; + let replyDetailId = deepGet(this.props.recorded_video , 'reply_obj.replyDetailId' ), + parentVideoId = deepGet(this.props.recorded_video , 'reply_obj.replyReceiverVideoId'); - if (replyDetailId){ + if (replyDetailId || !parentVideoId) { // we have reply return true } @@ -201,7 +203,8 @@ class CameraWorker extends PureComponent { image_width: appConfig.cameraConstants.VIDEO_WIDTH, image_height: appConfig.cameraConstants.VIDEO_HEIGHT, video_size: videoSize, - per_reply_amount_in_wei: String(this.props.recorded_video.reply_amount) + parent_kind: 'video', + parent_id: parentVideoId }; let payload = payloadWithoutImage; @@ -214,19 +217,15 @@ class CameraWorker extends PureComponent { }; } - new PepoApi(`/users/${this.props.currentUserId}/fan-video`) + new PepoApi(`/replies`) .post(payload) .then((responseData) => { if (responseData.success && responseData.data) { console.log('Video uploaded Successfully'); - Toast.show({ - text: 'Your video uploaded successfully.', - icon: 'success', - imageUri: this.props.recorded_video.cover_image - }); + // save reply_detail_id + Store.dispatch( upsertRecordedVideo({ - do_discard: true, pepo_api_posting: false }) ); From b40ce08e5d7209274cc20c9526661e0d626cf01c Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Tue, 12 Nov 2019 21:20:42 +0530 Subject: [PATCH 034/302] Animation --- RootNavigationContainer.js | 40 +++++++--------- src/helpers/NavigationAnimation.js | 73 ++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+), 24 deletions(-) create mode 100644 src/helpers/NavigationAnimation.js diff --git a/RootNavigationContainer.js b/RootNavigationContainer.js index 037c6626..7b57c244 100644 --- a/RootNavigationContainer.js +++ b/RootNavigationContainer.js @@ -3,6 +3,7 @@ import { View, Dimensions, Easing, Animated } from 'react-native'; import { Root } from 'native-base'; import { createSwitchNavigator, createAppContainer } from 'react-navigation'; import { createStackNavigator , StackViewTransitionConfigs} from 'react-navigation-stack'; +import NavigationAnimation from "./src/helpers/NavigationAnimation"; import { createBottomTabNavigator } from 'react-navigation-tabs'; import deepGet from 'lodash/get'; @@ -85,34 +86,25 @@ const modalStackConfig = { } }; -const txModalConfig = { +const txModalConfig = { transparentCard: true, cardStyle: { backgroundColor: 'rgba(0,0,0,0)' }, gesturesEnabled: false, - transitionConfig: () => ({ - transitionSpec: { - duration: 300, - easing: Easing.out(Easing.poly(4)), - timing: Animated.timing - }, - screenInterpolator: (sceneProps) => { - const { layout, position, scene } = sceneProps; - const { index } = scene; - - const height = layout.initHeight; - const translateY = position.interpolate({ - inputRange: [index - 1, index, index + 1], - outputRange: [height, 0, 0] - }); - - const opacity = position.interpolate({ - inputRange: [index - 1, index - 0.99, index], - outputRange: [0, 1, 1] - }); - - return { opacity, transform: [{ translateY }] }; + transitionConfig: (transitionProps, prevTransitionProps) => { + const scenes = transitionProps["scenes"]; + const prevScene = scenes[scenes.length - 2]; + const nextScene = scenes[scenes.length - 1]; + if (prevScene + && prevScene.route.routeName === 'VideoReplies' + && nextScene.route.routeName === 'FullScreenReplyCollection') { + return NavigationAnimation.zoomIn(); + } else if (prevScene + && prevScene.route.routeName === 'FullScreenReplyCollection' + && nextScene.route.routeName === 'VideoReplies') { + return NavigationAnimation.zoomOut(); } - }) + return NavigationAnimation.defaultTransition(); + } }; diff --git a/src/helpers/NavigationAnimation.js b/src/helpers/NavigationAnimation.js new file mode 100644 index 00000000..4a5428ba --- /dev/null +++ b/src/helpers/NavigationAnimation.js @@ -0,0 +1,73 @@ + +import { Easing, Animated } from 'react-native'; + +export default { + zoomIn: ( duration=300 ) =>{ + return { + transitionSpec: { + duration, + easing: Easing.out(Easing.poly(4)), + timing: Animated.timing, + useNativeDriver: true, + }, + screenInterpolator: ({ position, scene }) => { + const { index } = scene; + let start = 0; + + + const scale = position.interpolate({ + inputRange: [index - 1, index], + outputRange: [start, 1], + }); + + return { transform: [{ scale }] }; + }, + } + }, + zoomOut : ( duration=300 ) => { + return { + transitionSpec: { + duration, + easing: Easing.out(Easing.poly(4)), + timing: Animated.timing, + useNativeDriver: true, + }, + screenInterpolator: ({ position, scene }) => { + const { index } = scene; + + const scale = position.interpolate({ + inputRange: [index - 1, index], + outputRange: [10, 1], + }); + + return { transform: [{ scale }] }; + }, + } + }, + defaultTransition: ( duration=300 ) => { + return { + transitionSpec: { + duration: 300, + easing: Easing.out(Easing.poly(4)), + timing: Animated.timing + }, + screenInterpolator: (sceneProps) => { + const { layout, position, scene } = sceneProps; + const { index } = scene; + + const height = layout.initHeight; + const translateY = position.interpolate({ + inputRange: [index - 1, index, index + 1], + outputRange: [height, 0, 0] + }); + + const opacity = position.interpolate({ + inputRange: [index - 1, index - 0.99, index], + outputRange: [0, 1, 1] + }); + + return { opacity, transform: [{ translateY }] }; + } + } + } +} \ No newline at end of file From 5809c3353a3d06f4e96c598cd76f4a3cb9f15af6 Mon Sep 17 00:00:00 2001 From: Shraddha Date: Tue, 12 Nov 2019 21:42:31 +0530 Subject: [PATCH 035/302] reply click animation fix --- src/helpers/NavigationAnimation.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/helpers/NavigationAnimation.js b/src/helpers/NavigationAnimation.js index 4a5428ba..00461374 100644 --- a/src/helpers/NavigationAnimation.js +++ b/src/helpers/NavigationAnimation.js @@ -1,5 +1,6 @@ -import { Easing, Animated } from 'react-native'; +import { Easing, Animated,Platform } from 'react-native'; + export default { zoomIn: ( duration=300 ) =>{ @@ -13,7 +14,9 @@ export default { screenInterpolator: ({ position, scene }) => { const { index } = scene; let start = 0; - + if (Platform.OS !== 'ios') { + start = 0.005 + } const scale = position.interpolate({ inputRange: [index - 1, index], From 0cfd985b70b8dc12564dbba081ccf13e81869b2e Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Wed, 13 Nov 2019 12:48:06 +0530 Subject: [PATCH 036/302] code changes --- .../CommonComponents/VideoPlayer/index.js | 1 - .../{VideoReply.js => VideoReplyRow.js} | 4 +- .../FullScreenReplyCollection/index.js | 5 +- .../VideoRepliesFullScreen/index.js | 264 ------------------ 4 files changed, 5 insertions(+), 269 deletions(-) rename src/components/FullScreenReplyCollection/{VideoReply.js => VideoReplyRow.js} (97%) delete mode 100644 src/components/VideoRepliesFullScreen/index.js diff --git a/src/components/CommonComponents/VideoPlayer/index.js b/src/components/CommonComponents/VideoPlayer/index.js index 6d1e4ff6..c6ea360d 100644 --- a/src/components/CommonComponents/VideoPlayer/index.js +++ b/src/components/CommonComponents/VideoPlayer/index.js @@ -77,7 +77,6 @@ class VideoPlayer extends Component { if (this.state.userId == CurrentUser.getUserId()) { this.props.navigation.navigate('ProfileScreen'); } else { - this.isActiveScreen = false; this.props.navigation.push('UsersProfileScreen', { userId: this.state.userId }); } } diff --git a/src/components/FullScreenReplyCollection/VideoReply.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js similarity index 97% rename from src/components/FullScreenReplyCollection/VideoReply.js rename to src/components/FullScreenReplyCollection/VideoReplyRow.js index 87526931..a7d5cdcd 100644 --- a/src/components/FullScreenReplyCollection/VideoReply.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -16,7 +16,7 @@ import inlineStyles from './styles'; import utilities from '../../services/Utilities'; -class VideoReply extends PureComponent { +class VideoReplyRow extends PureComponent { constructor(props) { super(props); this.userId = deepGet(this.props.payload, 'user_id'); @@ -102,4 +102,4 @@ class VideoReply extends PureComponent { } } -export default withNavigation(VideoReply); +export default withNavigation(VideoReplyRow); diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index 272faa60..007da88a 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -7,7 +7,8 @@ import inlineStyles from "./styles"; import backIcon from '../../assets/back-arrow.png'; import pepoIcon from '../../assets/pepo-tx-icon.png'; import plusIcon from '../../assets/user-video-capture-icon-selected.png'; -import VideoReply from "./VideoReply";import NavigationService from "../../services/NavigationService"; +import VideoReplyRow from "./VideoReplyRow"; +import NavigationService from "../../services/NavigationService"; import utilities from '../../services/Utilities'; import crossIcon from '../../assets/cross_icon.png'; import ReduxGetters from "../../services/ReduxGetters"; @@ -189,7 +190,7 @@ class FullScreenReplyCollection extends PureComponent{ _renderItem = ({ item, index }) => { const payload = { user_id : deepGet(item, "payload.user_id") , video_id: deepGet(item, "payload.reply_detail_id")} - return { - let activeTab = NavigationService.getActiveTab(); - let params = { - videoTypeReply: true, - videoId: navigation.getParam('parentVideoId'), - userId: navigation.getParam('parentUserId'), - amount: navigation.getParam('amount'), - videoReplyCount: navigation.getParam('videoReplyCount') - }; - console.log('params:::VideoRepliesFullScreen', params); - utilities.handleVideoUploadModal(activeTab, navigation, params); -}; - -const maxVideosThreshold = 3; -const HeaderLeft = (props) => { - return ( - { - props.navigation.goBack(); - }} - style={inlineStyles.iconWrapper} - > - - - ); - }; - - const HeaderRight = (props) => { - return ({ - navigateToCamera(props.navigation); - }} style={inlineStyles.iconWrapper} > - - ) - }; - - const HeaderTitle = (props) => { - return ( - - - Replies to Frankie - - Send a reply with Pepo 5 - - ); - }; - -class VideoRepliesFullScreen extends PureComponent{ - - static navigationOptions = (props) => { - return { - headerBackTitle: null, - headerStyle: inlineStyles.headerStyles, - headerLeft: , - headerRight: , - headerTitle: - }; - }; - - constructor(props){ - super(props); - this.setVideoPagination(); - this.paginationEvent = this.getVideoPagination().event; - this.currentIndex = this.props.navigation.getParam("currentIndex"); - this.isScrolled = false ; - this.willFocusSubscription = null ; - this.flatlistRef = null; - - this.state = { - list : this.getVideoPagination().getResults(), - activeIndex: this.currentIndex, - refreshing : false, - loadingNext: false - }; - this.isActiveScreen = true; - } - - getBaseUrl(){ - return this.props.navigation.getParam("baseUrl"); - } - - getPassedFetchServices(){ - return this.props.navigation.getParam("fetchServices") - } - - setVideoPagination(){ - this.fullPagePagination = new Pagination( this.getBaseUrl(), null , this.getPassedFetchServices()); - } - - getVideoPagination(){ - return this.fullPagePagination; - } - - componentDidMount(){ - this.paginationEvent.on("onBeforeRefresh" , this.beforeRefresh.bind(this) ); - this.paginationEvent.on("onRefresh" , this.onRefresh.bind(this) ); - this.paginationEvent.on("onRefreshError" , this.onRefreshError.bind(this) ); - this.paginationEvent.on("onBeforeNext" , this.beforeNext.bind(this) ); - this.paginationEvent.on("onNext" , this.onNext.bind(this) ); - this.paginationEvent.on("onNextError" , this.onNextError.bind(this) ); - - //This is an hack for reset scroll for flatlist. Need to debug a bit more. - this.willFocusSubscription = this.props.navigation.addListener('willFocus', (payload) => { - const offset = this.state.activeIndex > 0 ? inlineStyles.fullScreen.height * this.state.activeIndex : 0 ; - this.flatlistRef && this.flatlistRef.scrollToOffset({offset: offset , animated: false}); - this.isActiveScreen = true ; - }); - - this.willBlurSubscription = this.props.navigation.addListener('willBlur', (payload) => { - this.isActiveScreen = false ; - }); - } - - componentWillUnmount(){ - this.paginationEvent.removeListener('onBeforeRefresh'); - this.paginationEvent.removeListener('onRefresh'); - this.paginationEvent.removeListener('onRefreshError'); - this.paginationEvent.removeListener('onBeforeNext'); - this.paginationEvent.removeListener('onNext'); - this.paginationEvent.removeListener('onNextError'); - this.willFocusSubscription && this.willFocusSubscription.remove(); - this.willBlurSubscription && this.willBlurSubscription.remove(); - } - - shouldPlay = () => { - return this.isActiveScreen; - }; - - beforeRefresh = ( ) => { - this.setState({ refreshing : true }); - } - - onRefresh = ( res ) => { - let paginationService = this.getVideoPagination(); - let resultList = paginationService.getResults(); - this.setState({ refreshing : false , list : resultList }); - } - - onRefreshError = ( error ) => { - this.setState({ refreshing : false }); - } - - beforeNext =() => { - this.isScrolled = false; - this.setState({ loadingNext : true }); - } - - onNext = ( res ) => { - let paginationService = this.getVideoPagination(); - let resultList = paginationService.getResults(); - this.setState({ loadingNext : false , list : resultList }); - } - - onNextError = ( error ) => { - this.setState({ loadingNext : false }); - } - - getNext = () => { - // if(!this.isScrolled) return; - this.getVideoPagination().getNext(); - } - - refresh = () => { - this.getVideoPagination().refresh(); - } - - _keyExtractor = (item, index) => { - return `id_${item.id}`; - } - - _renderItem = ({ item, index }) => { - const payload = item.payload; - return ; - }; - - onViewableItemsChanged = (data) => { - this.currentIndex = deepGet(data, 'viewableItems[0].index') || 0; - } - - setActiveIndex() { - this.setState({ activeIndex: this.currentIndex }); - } - - onMomentumScrollEndCallback = () => { - this.setActiveIndex(); - }; - - onMomentumScrollBeginCallback = () => { - this.isScrolled = true; - } - - onScrollToIndexFailed =( info) => { - console.log("======onScrollToIndexFailed=====" , info ); - } - - getItemLayout= (data, index) => { - return {length: inlineStyles.fullScreen.height, offset: inlineStyles.fullScreen.height * index, index} ; - } - - closeVideo = () => { - this.navigateBack(); - }; - - navigateBack() { - this.props.navigation.goBack(); - } - - onScrollToTop = () => { - this.setActiveIndex(); - } - - render() { - - return ( - - - {this.flatlistRef = ref }} - onEndReachedThreshold={7} - onViewableItemsChanged={this.onViewableItemsChanged} - onMomentumScrollEnd={this.onMomentumScrollEndCallback} - onMomentumScrollBegin={this.onMomentumScrollBeginCallback} - renderItem={this._renderItem} - style={[inlineStyles.fullScreen , {backgroundColor: "#000"}]} - showsVerticalScrollIndicator={false} - onScrollToTop={this.onScrollToTop} - initialScrollIndex={this.state.activeIndex} - getItemLayout={this.getItemLayout} - onScrollToIndexFailed={this.onScrollToIndexFailed} - /> - - ); - } - -} - -export default VideoRepliesFullScreen ; From 252fac8e8ff149b625f4bba9999e65a8cdfc02f7 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Wed, 13 Nov 2019 13:43:00 +0530 Subject: [PATCH 037/302] move common functions to respective components --- .../CommonComponents/ReplyIcon/index.js | 8 ++--- .../CommonComponents/VideoAmoutStat.js | 18 +++++++--- .../CommonComponents/VideoPlayer/index.js | 1 + .../VideoReplyRow.js | 28 --------------- .../FullScreeVideoRow.js | 27 -------------- src/components/Home/BottomStatus.js | 35 +++++++++++++++---- src/components/Home/HomeFeedRow.js | 29 +-------------- .../UserVideoHistory/UserVideoHistoryRow.js | 16 --------- 8 files changed, 47 insertions(+), 115 deletions(-) diff --git a/src/components/CommonComponents/ReplyIcon/index.js b/src/components/CommonComponents/ReplyIcon/index.js index bdf291c1..8de27d70 100644 --- a/src/components/CommonComponents/ReplyIcon/index.js +++ b/src/components/CommonComponents/ReplyIcon/index.js @@ -1,5 +1,5 @@ import React, { PureComponent } from 'react'; -import {TouchableWithoutFeedback , Image, View, Text} from "react-native"; +import {TouchableOpacity , Image, View, Text} from "react-native"; import { connect } from 'react-redux'; import {withNavigation} from "react-navigation"; @@ -53,7 +53,7 @@ class ReplyIcon extends PureComponent { return; } - if (this.props.videoReplyCount > 0 ){ + if (this.props.videoReplyCount > 0){ this.props.navigation.push('VideoReplies', {'videoId': this.props.videoId , 'userId': this.props.userId, @@ -79,11 +79,11 @@ class ReplyIcon extends PureComponent { return ( {this.props.videoReplyCount} - this.replyVideo())} > - + ); } diff --git a/src/components/CommonComponents/VideoAmoutStat.js b/src/components/CommonComponents/VideoAmoutStat.js index 69fc0f1b..164c89ea 100644 --- a/src/components/CommonComponents/VideoAmoutStat.js +++ b/src/components/CommonComponents/VideoAmoutStat.js @@ -1,6 +1,7 @@ import React, { PureComponent } from 'react'; import { View, Text } from 'react-native'; import { connect } from 'react-redux'; +import { withNavigation } from 'react-navigation'; import reduxGetter from '../../services/ReduxGetters'; @@ -10,6 +11,7 @@ import inlineStyles from '../Home/styles'; import { TouchableWithoutFeedback } from 'react-native-gesture-handler'; import multipleClickHandler from '../../services/MultipleClickHandler'; import Utilities from "../../services/Utilities"; +import CurrentUser from '../../models/CurrentUser'; const mapStateToProps = (state, ownProps) => { @@ -30,13 +32,19 @@ class VideoAmountStat extends PureComponent { return (priceOracle && priceOracle.btToFiat(btAmount, 2)) || 0; } - onWrapperClick = (e) => { - this.props.onWrapperClick && this.props.onWrapperClick(); - }; + navigateToUserProfile = () => { + if (Utilities.checkActiveUser()) { + if (this.props.userId == CurrentUser.getUserId()) { + this.props.navigation.navigate('ProfileScreen'); + } else { + this.props.navigation.push('UsersProfileScreen', { userId: this.props.userId }); + } + } + }; render() { return ( - this.onWrapperClick())} pointerEvents={'auto'}> + this.navigateToUserProfile())} pointerEvents={'auto'}> {/*{*/} {/* {}); }; - //TODO @preshita move to bottom status - navigateToUserProfile = (e) => { - if (utilities.checkActiveUser()) { - if (this.userId == CurrentUser.getUserId()) { - this.props.navigation.navigate('ProfileScreen'); - } else { - this.props.navigation.push('UsersProfileScreen', { userId: this.userId }); - } - } - }; - - //TODO @preshita move to bottom status - onDescriptionClick = ( tapEntity ) => { - if (!tapEntity) { - return; - } - - if( tapEntity.kind === 'tags'){ - this.props.navigation.push('VideoTags', { - "tagId": tapEntity.id - }); - } - - } - //Required from Backend , we need video stats entity render() { @@ -85,15 +60,12 @@ class VideoReplyRow extends PureComponent { )} diff --git a/src/components/FullScreenVideoCollection/FullScreeVideoRow.js b/src/components/FullScreenVideoCollection/FullScreeVideoRow.js index ecf9466a..fa0a0e7f 100644 --- a/src/components/FullScreenVideoCollection/FullScreeVideoRow.js +++ b/src/components/FullScreenVideoCollection/FullScreeVideoRow.js @@ -32,30 +32,6 @@ class FullScreeVideoRow extends PureComponent { .catch((error) => {}); }; - - navigateToUserProfile = (e) => { - if (utilities.checkActiveUser()) { - if (this.userId == CurrentUser.getUserId()) { - this.props.navigation.navigate('ProfileScreen'); - } else { - this.props.navigation.push('UsersProfileScreen', { userId: this.userId }); - } - } - }; - - onDescriptionClick = ( tapEntity , tapText ) => { - if (!tapEntity) { - return; - } - - if( tapEntity.kind === 'tags'){ - this.props.navigation.push('VideoTags', { - "tagId": tapEntity.id - }); - } - - } - render() { return ( @@ -85,15 +61,12 @@ class FullScreeVideoRow extends PureComponent { )} diff --git a/src/components/Home/BottomStatus.js b/src/components/Home/BottomStatus.js index 2e6248aa..691b051f 100644 --- a/src/components/Home/BottomStatus.js +++ b/src/components/Home/BottomStatus.js @@ -4,11 +4,13 @@ import { connect } from 'react-redux'; import { withNavigation } from 'react-navigation'; import inlineStyles from './styles'; -import { TouchableWithoutFeedback, TouchableOpacity } from 'react-native-gesture-handler'; +import { TouchableWithoutFeedback } from 'react-native-gesture-handler'; import reduxGetter from '../../services/ReduxGetters'; import multipleClickHandler from '../../services/MultipleClickHandler'; import InAppBrowser from '../../services/InAppBrowser'; +import Utilities from '../../services/Utilities'; +import CurrentUser from '../../models/CurrentUser'; const mapStateToProps = (state, ownProps) => { return { @@ -27,17 +29,13 @@ class BottomStatus extends PureComponent { this.videoDescriptionId = reduxGetter.getVideoDescriptionId(this.props.videoId); } - onWrapperClick = (e) => { - this.props.onWrapperClick && this.props.onWrapperClick(); - }; - onLinkClick = () => { InAppBrowser.openBrowser(this.props.link); }; onTagPressed = (tag) => { let entity = reduxGetter.getTappedIncludesEntity(this.videoDescriptionId, tag); - this.props.onDescriptionClick && this.props.onDescriptionClick(entity, tag); + this.onDescriptionClick(entity, tag); }; isValidTag(videoId, tappedText) { @@ -45,12 +43,35 @@ class BottomStatus extends PureComponent { return !!entity } + //TODO @preshita move to bottom status + navigateToUserProfile = () => { + if (Utilities.checkActiveUser()) { + if (this.props.userId == CurrentUser.getUserId()) { + this.props.navigation.navigate('ProfileScreen'); + } else { + this.props.navigation.push('UsersProfileScreen', { userId: this.props.userId }); + } + } + }; + + //TODO @preshita move to bottom status + onDescriptionClick = ( tapEntity ) => { + if (!tapEntity) { + return; + } + if( tapEntity.kind === 'tags'){ + this.props.navigation.push('VideoTags', { + "tagId": tapEntity.id + }); + } + } + render() { return ( - this.onWrapperClick())} pointerEvents={'auto'}> + this.navigateToUserProfile())} pointerEvents={'auto'}> {`@${this.props.userName}`} diff --git a/src/components/Home/HomeFeedRow.js b/src/components/Home/HomeFeedRow.js index de6afc3f..08ff6f86 100644 --- a/src/components/Home/HomeFeedRow.js +++ b/src/components/Home/HomeFeedRow.js @@ -47,32 +47,6 @@ class HomeFeedRow extends PureComponent { } }; - navigateToUserProfile = (e) => { - if (utilities.checkActiveUser()) { - if (this.userId == CurrentUser.getUserId()) { - this.props.navigation.navigate('ProfileScreen'); - } else { - this.props.navigation.push('UsersProfileScreen', { userId: this.userId }); - } - } - }; - - onDescriptionClick = ( tapEntity , tapText ) => { - if (utilities.checkActiveUser()) { - if (!tapEntity) { - return; - } - - if( tapEntity.kind === 'tags'){ - this.props.navigation.push('VideoTags', { - "tagId": tapEntity.id - }); - } - - } - }; - - render() { return ( @@ -101,13 +75,12 @@ class HomeFeedRow extends PureComponent { - + ); diff --git a/src/components/UserVideoHistory/UserVideoHistoryRow.js b/src/components/UserVideoHistory/UserVideoHistoryRow.js index b080c731..1f32653e 100644 --- a/src/components/UserVideoHistory/UserVideoHistoryRow.js +++ b/src/components/UserVideoHistory/UserVideoHistoryRow.js @@ -44,19 +44,6 @@ class UserVideoHistoryRow extends PureComponent { return this.props.userId == CurrentUser.getUserId(); } - onDescriptionClick = ( tapEntity , tapText ) => { - - if (!tapEntity) { - return; - } - - if(tapEntity.kind === 'tags'){ - this.props.navigation.push('VideoTags', { - "tagId": tapEntity.id - }); - } - }; - render() { return ( @@ -86,15 +73,12 @@ class UserVideoHistoryRow extends PureComponent { )} From 1cadde0d18e515e9a4ec7709232cdeaa801b4d80 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Wed, 13 Nov 2019 15:27:42 +0530 Subject: [PATCH 038/302] Transaction Excequtor --- src/services/TransactionExecutor.js | 122 ++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 src/services/TransactionExecutor.js diff --git a/src/services/TransactionExecutor.js b/src/services/TransactionExecutor.js new file mode 100644 index 00000000..5d0b1fc1 --- /dev/null +++ b/src/services/TransactionExecutor.js @@ -0,0 +1,122 @@ +import { OstWalletSdk } from '@ostdotcom/ost-wallet-sdk-react-native'; +import {ensureDeivceAndSession} from '../helpers/TransactionHelper'; +import ExecuteTransactionWorkflow from '../services/OstWalletCallbacks/ExecuteTransactionWorkFlow'; + +import CurrentUser from "../models/CurrentUser"; +import AppConfig from '../constants/AppConfig'; +import ReduxGetters from './ReduxGetters'; + + +/*** + * Mandatory config + * - apiEndpoint + * - metaProperties + * + * Optional config + * - ruleName + * + * CallBack + * onDeviceUnauthorized + * onEnsureDeivceAndSessionSuccess + * onEnsureDeivceAndSessionError + * onRequestAcknowledge + * onFlowInterrupt + * onPlatfromAcknowledgeSuccess + * onPlatfromAcknowledgeError + * onPlatfromAcknowledgeComplete + */ + +class TransactionExecutor { + + constructor( config , callbacks ){ + this.config = config || {}; + this.callbacks = callbacks || {}; + } + + sendTransactionToSdk(btAmount=0 , toUserId , validateSession=true ) { + const btInDecimal = pricer.getToDecimal(btAmount); + this.setToUser( toUserId ); + + if( !validateSession ){ + return this._executeTransaction(btInDecimal); + } + + ensureDeivceAndSession(CurrentUser.getOstUserId(), btInDecimal, (device) => { + this._deviceUnauthorizedCallback(device); + }, (errorMessage, success) => { + this._ensureDeivceAndSessionCallback(btInDecimal,errorMessage, success); + }); + } + + setToUser( toUserId ){ + this.toUser = ReduxGetters.getUser( toUserId ) || {}; + } + + _deviceUnauthorizedCallback(device){ + this.callbacks.onDeviceUnauthorized && this.callbacks.onDeviceUnauthorized( device ); + } + + _ensureDeivceAndSessionCallback(btInDecimal,errorMessage, success){ + if( success ){ + this.callbacks.onEnsureDeivceAndSessionSuccess && this.callbacks.onEnsureDeivceAndSessionSuccess( btInDecimal,errorMessage, success ); + return this._executeTransaction(btInDecimal); + } + + if( errorMessage ){ + this.callbacks.onEnsureDeivceAndSessionError && this.callbacks.onEnsureDeivceAndSessionError( btInDecimal,errorMessage, success ); + } + } + + _executeTransaction(btInDecimal) { + this.workflow = new ExecuteTransactionWorkflow(this); + OstWalletSdk.executeTransaction( + CurrentUser.getOstUserId(), + [this.toUser.ost_token_holder_address], + [btInDecimal], + this.config.ruleName || AppConfig.ruleTypeMap.directTransfer, + this.getSdkMetaProperties(), + this.workflow + ); + } + + getSdkMetaProperties() { + return this.config.metaProperties || {}; + } + + onRequestAcknowledge(ostWorkflowContext, ostWorkflowEntity) { + this.sendTransactionToPlatform(ostWorkflowEntity); + this.callbacks.onRequestAcknowledge && this.callbacks.onRequestAcknowledge( ostWorkflowContext, ostWorkflowEntity ); + } + + onFlowInterrupt(ostWorkflowContext, error) { + this.callbacks.onFlowInterrupt && this.callbacks.onFlowInterrupt( ostWorkflowContext, error ); + } + + sendTransactionToPlatform(ostWorkflowEntity) { + const params = this.getSendTransactionPlatformData(ostWorkflowEntity); + const apiEndpoint = this.config.apiEndpoint || '/ost-transactions'; + new PepoApi(apiEndpoint) + .post(params) + .then((res) => { + this.callbacks.onPlatfromAcknowledgeSuccess && this.callbacks.onPlatfromAcknowledgeSuccess(res); + }) + .catch((error) => { + this.callbacks.onPlatfromAcknowledgeError && this.callbacks.onPlatfromAcknowledgeError(error); + }) + .finally(() => { + this.callbacks.onPlatfromAcknowledgeComplete && this.callbacks.onPlatfromAcknowledgeComplete(); + }); + } + + getSendTransactionPlatformData(ostWorkflowEntity) { + const params = { + ost_transaction: deepGet(ostWorkflowEntity, 'entity'), + ost_transaction_uuid: deepGet(ostWorkflowEntity, 'entity.id') + }; + return params; + } + + +} + +export { TransactionExecutor }; \ No newline at end of file From 05d83e9307c2263076b9b5f8066b9d67a0071da6 Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Wed, 13 Nov 2019 16:54:40 +0530 Subject: [PATCH 039/302] update cartfile --- ios/Cartfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/Cartfile b/ios/Cartfile index 6f03e337..6ad59fcb 100644 --- a/ios/Cartfile +++ b/ios/Cartfile @@ -1 +1 @@ -github "ostdotcom/ost-wallet-sdk-ios" "team/select-query-fix" +github "ostdotcom/ost-wallet-sdk-ios" == 2.3.4 From 5d55beb727ad9be51c0a350f1b78e8459f486497 Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Wed, 13 Nov 2019 18:39:20 +0530 Subject: [PATCH 040/302] session creation --- RootNavigationContainer.js | 3 +- src/components/CaptureVideo/index.js | 1 + src/components/FanVideoReplyDetails/index.js | 58 +++++++++++-- src/services/CameraWorker.js | 89 ++++++++++++-------- 4 files changed, 110 insertions(+), 41 deletions(-) diff --git a/RootNavigationContainer.js b/RootNavigationContainer.js index 7b57c244..7c7b4824 100644 --- a/RootNavigationContainer.js +++ b/RootNavigationContainer.js @@ -112,7 +112,8 @@ const CaptureVideoStack = createStackNavigator( { CaptureVideo: CaptureVideo, FanVideoDetails: FanVideoDetails, - FanVideoReplyDetails: FanVideoReplyDetails + FanVideoReplyDetails: FanVideoReplyDetails, + WalletSettingScreen: WalletSettingScreen }, { headerLayoutPreset: 'center' diff --git a/src/components/CaptureVideo/index.js b/src/components/CaptureVideo/index.js index 1a11edeb..92328453 100644 --- a/src/components/CaptureVideo/index.js +++ b/src/components/CaptureVideo/index.js @@ -93,6 +93,7 @@ class CaptureVideo extends Component { saveVideoPrimaryInfo = () => { + this.proceedWithExisting = false; this.videoType = this.isVideoTypeReply ? VideoTypesConfig.reply.type : VideoTypesConfig.post.type; Store.dispatch(upsertRecordedVideo(this.getPrimaryVideoInfo())); }; diff --git a/src/components/FanVideoReplyDetails/index.js b/src/components/FanVideoReplyDetails/index.js index 278ed27c..fbd42018 100644 --- a/src/components/FanVideoReplyDetails/index.js +++ b/src/components/FanVideoReplyDetails/index.js @@ -29,6 +29,9 @@ import { getBottomSpace } from 'react-native-iphone-x-helper'; import { StackActions } from 'react-navigation'; import PepoApi from "../../services/PepoApi"; import DataContract from "../../constants/DataContract"; +import pricer from "../../services/Pricer"; +import {ensureDeivceAndSession} from "../../helpers/TransactionHelper"; +import Toast from "../../theme/components/NotificationToast"; const mapStateToProps = (state, ownProps) => { return { @@ -136,15 +139,56 @@ class FanVideoReplyDetails extends Component { this.keyboardDidHideListener.remove(); } + ensureSession = () => { + return new Promise((resolve, reject)=> { + let btAmount = this.getAmountToSend(); + const btInDecimal = pricer.getToDecimal(btAmount); + ensureDeivceAndSession(CurrentUser.getOstUserId(), btInDecimal, (device) => { + this._deviceUnauthorizedCallback(device); + reject(); + }, (errorMessage, success) => { + if ( success ) { + return resolve(); + } else { + Toast.show({ + text: errorMessage, + icon: 'error' + }); + return reject() + } + }); + }); + + // check If session active + }; + + + _deviceUnauthorizedCallback = (device) => { + this.props.navigation.push('AuthDeviceDrawer', { device }); + }; + + + + enableStartUploadFlag = () => { this.clearErrors(); - this.validateData().then((res)=>{ - Store.dispatch( - upsertRecordedVideo({ video_desc: this.videoDesc, video_link: this.videoLink, do_upload: true }) - ); - this.props.navigation.dispatch(StackActions.popToTop()); - this.props.navigation.dispatch(StackActions.popToTop()); - this.props.navigation.navigate('HomeScreen'); + this.validateData().then((res) => { + + this.ensureSession().then(() => { + + Store.dispatch( + upsertRecordedVideo({ video_desc: this.videoDesc, video_link: this.videoLink, do_upload: true }) + ); + this.props.navigation.dispatch(StackActions.popToTop()); + this.props.navigation.dispatch(StackActions.popToTop()); + this.props.navigation.navigate('HomeScreen'); + + }).catch(()=> { + + }); + + + }).catch((err)=>{ // show error on UI. this.showError(err); diff --git a/src/services/CameraWorker.js b/src/services/CameraWorker.js index 697b96b0..1e7a91b4 100644 --- a/src/services/CameraWorker.js +++ b/src/services/CameraWorker.js @@ -4,6 +4,7 @@ import RNFS from 'react-native-fs'; import Store from '../store'; import deepGet from 'lodash/get'; + import { upsertRecordedVideo, clearRecordedVideo, @@ -21,6 +22,10 @@ import videoUploaderComponent from './CameraWorkerEventEmitter'; import createObjectForRedux from '../helpers/createObjectForRedux'; import Toast from '../theme/components/NotificationToast'; import CurrentUser from '../models/CurrentUser'; +import {ensureDeivceAndSession, ON_USER_CANCLLED_ERROR_MSG} from "../helpers/TransactionHelper"; +import pricer from "./Pricer"; +import {VideoPlayPauseEmitter} from "../helpers/Emitters"; +import DataContract from "../constants/DataContract"; const recordedVideoStates = [ 'raw_video', @@ -32,7 +37,8 @@ const recordedVideoStates = [ 'video_link', 'reply_amount', 'video_type', - 'reply_obj' + 'reply_obj', + 'go_for_tx' ]; const processingStatuses = [ @@ -149,31 +155,43 @@ class CameraWorker extends PureComponent { processReplyVideo = async () => { - let sessionCreated = await this.sessionHandling(); - - if (! sessionCreated){ - return ; - } + // let sessionCreated = await this.ensureSession(); + // + // if (! sessionCreated) { + // return ; + // } await this.uploadReplyVideo(); + await this.executeTransaction() + + }; + + executeTransaction = () => { + let goForTx = this.props.recorded_video.go_for_tx; + if (! goForTx){ + return; + } + // todo : Execute transaction code. call clean up after that. }; + uploadReplyVideo = async () => { await this.uploadVideo(); await this.uploadCoverImage(); - await this.postReplyVideoToPepoApi(); + await this.postReplyVideoToPepoApi() ; }; postReplyVideoToPepoApi = async () => { - let replyDetailId = deepGet(this.props.recorded_video , 'reply_obj.replyDetailId' ), + let readyForTx = deepGet(this.props.recorded_video , 'go_for_tx' ), parentVideoId = deepGet(this.props.recorded_video , 'reply_obj.replyReceiverVideoId'); - if (replyDetailId || !parentVideoId) { - // we have reply + if ( readyForTx || !parentVideoId ) { + // we have reply OR we dont have video Id return true } + if ( this.props.recorded_video.s3_video && !this.props.recorded_video.pepo_api_posting && @@ -217,18 +235,39 @@ class CameraWorker extends PureComponent { }; } + let replyDetailId = deepGet(this.props.recorded_video , 'reply_obj.replyDetailId' ); + if (replyDetailId) { + payload['reply_detail_id'] = replyDetailId; + } + new PepoApi(`/replies`) .post(payload) .then((responseData) => { if (responseData.success && responseData.data) { console.log('Video uploaded Successfully'); - // save reply_detail_id + let resultType = deepGet(responseData, DataContract.common.resultType), + reply = deepGet(responseData, `data.${resultType}` ); + + if (reply && reply.length > 0 ){ + let replyObj = deepGet(this.props.recorded_video , 'reply_obj' ); + replyObj['replyDetailId'] = reply[0].id; + Store.dispatch( + upsertRecordedVideo({ + pepo_api_posting: false, + reply_obj: replyObj, + go_for_tx: true + }) + ) + } else { + Store.dispatch( + upsertRecordedVideo({ + pepo_api_posting: false + }) + ) + } + + - Store.dispatch( - upsertRecordedVideo({ - pepo_api_posting: false - }) - ); } else { videoUploaderComponent.emit('hide'); Store.dispatch(videoInProcessing(false)); @@ -248,11 +287,7 @@ class CameraWorker extends PureComponent { }); }); } - - // here we will get reply_id - - }; @@ -261,19 +296,7 @@ class CameraWorker extends PureComponent { - sessionHandling = async () => { - let isSessionActive = await this.checkForActiveSession(); - if (isSessionActive){ - return true; - } else { - return await this.activateSession(); - } - }; - - checkForActiveSession = async () => { - // check If session active - }; activateSession = async () => { // Activate session. @@ -593,6 +616,6 @@ class CameraWorker extends PureComponent { } } -const mapStateToProps = ({ recorded_video }) => ({ recorded_video, currentUserId: CurrentUser.getUserId() }); +const mapStateToProps = ({ recorded_video }) => ({ recorded_video, currentUserId: CurrentUser.getUserId(), currentOstUserId: CurrentUser.getOstUserId() }); export default connect(mapStateToProps)(CameraWorker); From 4bf64abd97bfaa86663464c81e922acbd2e79796 Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Wed, 13 Nov 2019 18:46:55 +0530 Subject: [PATCH 041/302] sliding up panel UI --- src/components/VideoReplies/index.js | 1 - src/components/VideoReplies/styles.js | 12 +++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index b8973159..43e436c6 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -158,7 +158,6 @@ class VideoRepliesScreen extends PureComponent { snappingPoints={[0, this.initialHeight, height]}> {dragHandler => ( - diff --git a/src/components/VideoReplies/styles.js b/src/components/VideoReplies/styles.js index 9e1e5b4b..59a9dfbb 100644 --- a/src/components/VideoReplies/styles.js +++ b/src/components/VideoReplies/styles.js @@ -7,21 +7,19 @@ let stylesMap = { zIndex: 1, alignItems: 'center', justifyContent: 'center', - backgroundColor: '#fff', + backgroundColor: Colors.white, + borderTopLeftRadius: 30, + borderTopRightRadius: 30, + overflow: 'hidden' }, dragHandler: { - position: 'absolute', height: 65, - top: -65, alignItems: 'center', justifyContent: 'center', backgroundColor: Colors.white, flexDirection: 'row', zIndex: 9, - width: '100%', - borderTopLeftRadius: 30, - borderTopRightRadius: 30, - overflow: 'hidden' + width: '100%' }, iconWrapper: { flex: 1, From 11b76021de5e250a114a0ec25b6e030270c40426 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Wed, 13 Nov 2019 19:07:30 +0530 Subject: [PATCH 042/302] ReplyTXBTn --- .../VideoReplyRow.js | 6 +- .../FullScreeVideoRow.js | 8 +- src/components/Home/HomeFeedRow.js | 9 +- src/components/PepoTransactionButton/Base.js | 271 ++++++++++++++++++ .../PepoButton/ClapBubble.js | 5 - .../PepoButton/ClapButton.js | 2 +- .../PepoButton/index.js | 2 +- .../PepoTransactionButton/PepoTxBtn.js | 18 ++ .../PepoTransactionButton/ReplyPepoTxBtn.js | 79 +++++ .../PepoTransactionButton/styles.js | 19 ++ .../UserVideoHistory/UserVideoHistoryRow.js | 5 +- 11 files changed, 400 insertions(+), 24 deletions(-) create mode 100644 src/components/PepoTransactionButton/Base.js rename src/components/{Home => PepoTransactionButton}/PepoButton/ClapBubble.js (93%) rename src/components/{Home => PepoTransactionButton}/PepoButton/ClapButton.js (98%) rename src/components/{Home => PepoTransactionButton}/PepoButton/index.js (98%) create mode 100644 src/components/PepoTransactionButton/PepoTxBtn.js create mode 100644 src/components/PepoTransactionButton/ReplyPepoTxBtn.js create mode 100644 src/components/PepoTransactionButton/styles.js diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index b1f0793e..73996035 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -5,15 +5,13 @@ import VideoWrapper from '../Home/VideoWrapper'; import ShareIcon from "../CommonComponents/ShareIcon"; import ReportVideo from "../CommonComponents/ReportVideo"; import PepoApi from '../../services/PepoApi'; -import TransactionPepoButton from '../Home/TransactionPepoButton'; import deepGet from 'lodash/get'; -import CurrentUser from '../../models/CurrentUser'; import BottomStatus from '../Home/BottomStatus'; import VideoAmountStat from '../CommonComponents/VideoAmoutStat'; import inlineStyles from './styles'; -import utilities from '../../services/Utilities'; +import PepoTxBtn from '../PepoTransactionButton/PepoTxBtn'; class VideoReplyRow extends PureComponent { @@ -48,7 +46,7 @@ class VideoReplyRow extends PureComponent { - - - + diff --git a/src/components/PepoTransactionButton/Base.js b/src/components/PepoTransactionButton/Base.js new file mode 100644 index 00000000..ebddc05d --- /dev/null +++ b/src/components/PepoTransactionButton/Base.js @@ -0,0 +1,271 @@ +import React, { PureComponent } from 'react'; +import { TouchableWithoutFeedback, View } from 'react-native'; +import { OstWalletSdk } from '@ostdotcom/ost-wallet-sdk-react-native'; +import Toast from '../../theme/components/NotificationToast'; +import deepGet from 'lodash/get'; +import clone from 'lodash/clone'; + +import { withNavigation } from 'react-navigation'; + +import CurrentUser from '../../models/CurrentUser'; +import PepoButton from './PepoButton'; +import appConfig from '../../constants/AppConfig'; +import PepoApi from '../../services/PepoApi'; +import pricer from '../../services/Pricer'; +import Store from '../../store'; +import { updateExecuteTransactionStatus, updateBalance, upsertVideoStatEntities } from '../../actions'; +import ExecuteTransactionWorkflow from '../../services/OstWalletCallbacks/ExecuteTransactionWorkFlow'; +import reduxGetter from '../../services/ReduxGetters'; +import { ostErrors } from '../../services/OstErrors'; +import { ostSdkErrors } from '../../services/OstSdkErrors'; +import Pricer from '../../services/Pricer'; +import utilities from '../../services/Utilities'; +import PixelCall from '../../services/PixelCall'; +import {ON_USER_CANCLLED_ERROR_MSG, ensureDeivceAndSession} from '../../helpers/TransactionHelper'; +import {VideoPlayPauseEmitter} from "../../helpers/Emitters"; + + +class Base extends PureComponent { + constructor(props) { + super(props); + this.localSupported = this.props.isSupporting; + } + + isDisabled = () => { + return ( + this.props.userId == CurrentUser.getUserId() || !this.isBalance() || !this.props.isCurrentUserActivated || this.props.disabled || !this.props.isVideoUserActivated + ); + }; + + isBalance = () => { + return this.getBalanceToNumber() >= 1 ? true : false; + }; + + getBalanceToNumber = () => { + return (this.props.balance && Math.floor(Number(pricer.getFromDecimal(this.props.balance)))) || 0; + }; + + getBtAmount = () => { + let btAmount = Pricer.getToBT(Pricer.getFromDecimal(this.props.totalBt), 2) || 0; + return Number(btAmount); + }; + + get toUser() { + return reduxGetter.getUser(this.props.userId); + } + + sendTransactionToSdk(btAmount) { + const user = CurrentUser.getUser(); + // const option = { wait_for_finalization: false }; + const btInDecimal = pricer.getToDecimal(btAmount); + ensureDeivceAndSession(user.ost_user_id, btInDecimal, (device) => { + this._deviceUnauthorizedCallback(device); + }, (errorMessage, success) => { + this._ensureDeivceAndSessionCallback(btAmount,errorMessage, success); + }); + } + + _ensureDeivceAndSessionCallback(btAmount, errorMessage, success) { + + const btInDecimal = pricer.getToDecimal(btAmount); + VideoPlayPauseEmitter.emit('play'); + if ( success ) { + return this._executeTransaction(btInDecimal); + } + + if ( errorMessage ) { + if ( ON_USER_CANCLLED_ERROR_MSG === errorMessage) { + //Cancel the flow. + this.syncData(1000); + return; + } + + // Else: Show the error message. + this.syncData(1000); + Toast.show({ + text: errorMessage, + icon: 'error' + }); + + } + } + + _deviceUnauthorizedCallback( device ) { + //Cancel the flow. + this.syncData(1000); + + this.props.navigation.push('AuthDeviceDrawer', { device }); + } + + _executeTransaction(btInDecimal) { + this.workflow = new ExecuteTransactionWorkflow(this); + OstWalletSdk.executeTransaction( + CurrentUser.getOstUserId(), + [this.toUser.ost_token_holder_address], + [btInDecimal], + appConfig.ruleTypeMap.directTransfer, + this.getSdkMetaProperties(), + this.workflow + ); + } + + getSdkMetaProperties() { + const metaProperties = clone(appConfig.metaProperties); + if (this.props.videoId) { + metaProperties['name'] = 'video'; + metaProperties['details'] = `vi_${this.props.videoId}`; + } + return metaProperties; + } + + onRequestAcknowledge(ostWorkflowContext, ostWorkflowEntity) { + this.sendTransactionToPlatform(ostWorkflowEntity); + this.dropPixel(); + } + + getDropPixel(){ + return { + e_entity: 'video', + e_action: 'contribution', + e_data_json: { + video_id: this.props.videoId, + profile_user_id: this.props.userId, + amount: this.btAmount + }, + p_type: 'feed' + } + } + + dropPixel() { + PixelCall(this.getDropPixel()); + } + + onFlowInterrupt(ostWorkflowContext, error) { + this.onSdkError(error, ostWorkflowContext); + } + + sendTransactionToPlatform(ostWorkflowEntity) { + const params = this.getSendTransactionPlatformData(ostWorkflowEntity); + new PepoApi('/ost-transactions') + .post(params) + .then((res) => {}) + .catch((error) => {}) + .finally(() => { + this.syncData(); + }); + } + + onSdkError(error, ostWorkflowContext) { + this.syncData(1000); + let errMsg; + if ( ostWorkflowContext ) { + errMsg = ostSdkErrors.getErrorMessage(ostWorkflowContext, error); + } else { + errMsg = ostErrors.getErrorMessage(error); + } + Toast.show({ + text: errMsg, + icon: 'error' + }); + } + + getSendTransactionPlatformData(ostWorkflowEntity) { + return { + ost_transaction: deepGet(ostWorkflowEntity, 'entity'), + ost_transaction_uuid: deepGet(ostWorkflowEntity, 'entity.id') + }; + } + + onTransactionIconWrapperClick = () => { + utilities.checkActiveUser() && CurrentUser.isUserActivated(true); + }; + + reduxUpdate(isTXBtnDisabled, balance, totalBt, supporters) { + if (isTXBtnDisabled !== undefined) { + Store.dispatch(updateExecuteTransactionStatus(isTXBtnDisabled)); + } + + if (balance) { + balance = pricer.getToDecimal(balance); + Store.dispatch(updateBalance(balance)); + } + + let videoStats = reduxGetter.getVideoStats(this.props.videoId), + updateVideoStats = false; + if (totalBt && totalBt > 0) { + videoStats['total_amount_raised_in_wei'] = Pricer.getToDecimal(totalBt); + updateVideoStats = true; + } + + if (supporters && !this.props.isSupporting) { + videoStats['total_contributed_by'] = supporters; + updateVideoStats = true; + } + + if (updateVideoStats) { + Store.dispatch(upsertVideoStatEntities(utilities._getEntityFromObj(videoStats))); + } + } + + onPressOut = (btAmount, totalBt) => { + this.onLocalUpdate(btAmount, totalBt); + this.sendTransactionToSdk(btAmount); + }; + + onLocalUpdate(btAmount) { + this.btAmount = btAmount; + let expectedTotal = this.getBtAmount() + btAmount; + this.localSupported = true; + this.reduxUpdate(true, this.getBalanceToUpdate(btAmount), expectedTotal, this.props.supporters + 1); + } + + getBalanceToUpdate(updateAmount, isRevert) { + if (!updateAmount) return; + let balance = pricer.getFromDecimal(this.props.balance); + balance = (balance && Number(balance)) || 0; + updateAmount = (updateAmount && Number(updateAmount)) || 0; + if (isRevert) { + return balance + updateAmount; + } else { + return balance - updateAmount; + } + } + + onMaxReached = () => { + Toast.show({ + text: ostErrors.getUIErrorMessage('maxAllowedBt'), + icon: 'error' + }); + }; + + syncData(timeOut) { + this.props.resyncDataDelegate && this.props.resyncDataDelegate(); + pricer.getBalance(); + setTimeout(() => { + this.reduxUpdate(false); + if (!this.props.isSupporting) { + this.localSupported = false; + } + }, timeOut); + } + + render() { + return ( + + + + + + ); + } +} + +export default withNavigation(Base); diff --git a/src/components/Home/PepoButton/ClapBubble.js b/src/components/PepoTransactionButton/PepoButton/ClapBubble.js similarity index 93% rename from src/components/Home/PepoButton/ClapBubble.js rename to src/components/PepoTransactionButton/PepoButton/ClapBubble.js index 583af462..3fd5d778 100644 --- a/src/components/Home/PepoButton/ClapBubble.js +++ b/src/components/PepoTransactionButton/PepoButton/ClapBubble.js @@ -1,8 +1,5 @@ import * as React from "react"; import { - Text, - View, - TouchableOpacity, StyleSheet, Image, Easing, @@ -64,7 +61,6 @@ export default class ClapBubble extends React.Component { }; return ( - {/*+ {this.props.count}*/} ); @@ -73,7 +69,6 @@ export default class ClapBubble extends React.Component { const styles = StyleSheet.create({ clapbubble: { elevation: 4, - // backgroundColor:Colors.primary , height: 40, width: 40, borderRadius: 20, diff --git a/src/components/Home/PepoButton/ClapButton.js b/src/components/PepoTransactionButton/PepoButton/ClapButton.js similarity index 98% rename from src/components/Home/PepoButton/ClapButton.js rename to src/components/PepoTransactionButton/PepoButton/ClapButton.js index 2c0b7710..b90c263c 100644 --- a/src/components/Home/PepoButton/ClapButton.js +++ b/src/components/PepoTransactionButton/PepoButton/ClapButton.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import { Animated, Easing, View, Vibration } from 'react-native'; +import { Animated, Easing, View } from 'react-native'; import ReactNativeHapticFeedback from 'react-native-haptic-feedback'; import pepo_tx_img from '../../../assets/pepo_anim_btn.png'; diff --git a/src/components/Home/PepoButton/index.js b/src/components/PepoTransactionButton/PepoButton/index.js similarity index 98% rename from src/components/Home/PepoButton/index.js rename to src/components/PepoTransactionButton/PepoButton/index.js index 5c76758a..a16ce52d 100644 --- a/src/components/Home/PepoButton/index.js +++ b/src/components/PepoTransactionButton/PepoButton/index.js @@ -6,7 +6,7 @@ import { TouchableWithoutFeedback } from "react-native"; import ClapBubble from "./ClapBubble"; -import inlineStyles from '../styles' +import inlineStyles from '../styles'; import ClapButton from "./ClapButton"; import appConfig from "../../../constants/AppConfig"; import Pricer from "../../../services/Pricer"; diff --git a/src/components/PepoTransactionButton/PepoTxBtn.js b/src/components/PepoTransactionButton/PepoTxBtn.js new file mode 100644 index 00000000..426ffc7d --- /dev/null +++ b/src/components/PepoTransactionButton/PepoTxBtn.js @@ -0,0 +1,18 @@ +import { connect } from 'react-redux'; +import reduxGetter from "../../services/ReduxGetters"; +import utilities from "../../services/Utilities"; +import CurrentUser from "../../models/CurrentUser"; +import Base from "./Base"; + +const mapStateToProps = (state, ownProps) => ({ + balance: state.balance, + disabled: state.executeTransactionDisabledStatus, + isVideoUserActivated: utilities.isUserActivated(reduxGetter.getUserActivationStatus(ownProps.userId)), + supporters: reduxGetter.getVideoSupporters(ownProps.videoId), + isSupporting: reduxGetter.isVideoSupported(ownProps.videoId), + totalBt: reduxGetter.getVideoBt(ownProps.videoId, state), + isCurrentUserActivated: CurrentUser.isUserActivated() + }); + + const PepoTxBtn = connect(mapStateToProps)(Base); + export default PepoTxBtn; \ No newline at end of file diff --git a/src/components/PepoTransactionButton/ReplyPepoTxBtn.js b/src/components/PepoTransactionButton/ReplyPepoTxBtn.js new file mode 100644 index 00000000..4a242173 --- /dev/null +++ b/src/components/PepoTransactionButton/ReplyPepoTxBtn.js @@ -0,0 +1,79 @@ +import { updateExecuteTransactionStatus, updateBalance, upsertVideoStatEntities } from '../../actions'; +import reduxGetter from "../../services/ReduxGetters"; +import CurrentUser from "../../models/CurrentUser"; +import utilities from "../../services/Utilities"; +import { connect } from 'react-redux'; +import Store from '../../store'; +import Base from "./Base"; + +const mapStateToProps = (state, ownProps) => ({ + balance: state.balance, + disabled: state.executeTransactionDisabledStatus, + isVideoUserActivated: utilities.isUserActivated(reduxGetter.getUserActivationStatus(ownProps.userId)), + isCurrentUserActivated: CurrentUser.isUserActivated() , + supporters: "", //TODO + isSupporting:"", //TODO + totalBt: "", //TODO + videoId : "", //TODO + }); + +class ReplyPepoTxBtn extends Base { + + constructor(props){ + super(props); + } + + getSdkMetaProperties() { + const metaProperties = clone(appConfig.metaProperties); + if (this.props.videoId) { + metaProperties['name'] = 'pepo_on_reply'; + metaProperties['details'] = `rdi_${this.props.replyId}`; + } + return metaProperties; + } + + getDropPixel(){ + //TODO + return { + e_entity: 'video', + e_action: 'contribution', + e_data_json: { + video_id: this.props.videoId, + profile_user_id: this.props.userId, + amount: this.btAmount + }, + p_type: 'reply' + } + } + + reduxUpdate(isTXBtnDisabled, balance, totalBt, supporters) { + //TODO + if (isTXBtnDisabled !== undefined) { + Store.dispatch(updateExecuteTransactionStatus(isTXBtnDisabled)); + } + + if (balance) { + balance = pricer.getToDecimal(balance); + Store.dispatch(updateBalance(balance)); + } + + let videoStats = reduxGetter.getVideoStats(this.props.videoId), + updateVideoStats = false; + if (totalBt && totalBt > 0) { + videoStats['total_amount_raised_in_wei'] = Pricer.getToDecimal(totalBt); + updateVideoStats = true; + } + + if (supporters && !this.props.isSupporting) { + videoStats['total_contributed_by'] = supporters; + updateVideoStats = true; + } + + if (updateVideoStats) { + Store.dispatch(upsertVideoStatEntities(utilities._getEntityFromObj(videoStats))); + } + } + +} + +export default connect(mapStateToProps)(ReplyPepoTxBtn); \ No newline at end of file diff --git a/src/components/PepoTransactionButton/styles.js b/src/components/PepoTransactionButton/styles.js new file mode 100644 index 00000000..9c8173c2 --- /dev/null +++ b/src/components/PepoTransactionButton/styles.js @@ -0,0 +1,19 @@ +import DefaultStyleGenerator from '../../theme/styles/DefaultStyleGenerator'; +import Colors from '../../theme/styles/Colors'; + +let stylesMap = { + pepoTxCount: { + fontSize: 18, + color: Colors.white, + alignSelf: 'center', + marginBottom: 8, + textShadowColor: 'rgba(0, 0, 0, 0.65)', + textShadowOffset: {width: 1, height: 1}, + textShadowRadius: 1, + fontFamily: 'AvenirNext-DemiBold' + } +} + +; + +export default styles = DefaultStyleGenerator.generate(stylesMap); diff --git a/src/components/UserVideoHistory/UserVideoHistoryRow.js b/src/components/UserVideoHistory/UserVideoHistoryRow.js index 1f32653e..6eec3320 100644 --- a/src/components/UserVideoHistory/UserVideoHistoryRow.js +++ b/src/components/UserVideoHistory/UserVideoHistoryRow.js @@ -5,7 +5,7 @@ import VideoWrapper from '../Home/VideoWrapper'; import ShareIcon from "../CommonComponents/ShareIcon"; import ReportVideo from "../CommonComponents/ReportVideo"; import PepoApi from '../../services/PepoApi'; -import TransactionPepoButton from '../Home/TransactionPepoButton'; + import CurrentUser from '../../models/CurrentUser'; @@ -15,6 +15,7 @@ import inlineStyles from './styles'; import utilities from '../../services/Utilities'; import ReplyIcon from '../CommonComponents/ReplyIcon'; +import PepoTxBtn from '../PepoTransactionButton/PepoTxBtn'; class UserVideoHistoryRow extends PureComponent { @@ -60,7 +61,7 @@ class UserVideoHistoryRow extends PureComponent { - Date: Wed, 13 Nov 2019 19:46:01 +0530 Subject: [PATCH 043/302] VideoWrapper --- .../VideoReplyRow.js | 5 +- .../FullScreeVideoRow.js | 5 +- src/components/Home/HomeFeedRow.js | 7 +- src/components/Home/TransactionPepoButton.js | 280 ------------------ .../UserVideoHistory/UserVideoHistoryRow.js | 6 +- .../VideoWrapper.js => VideoWrapper/Base.js} | 15 +- src/components/VideoWrapper/FanVideo.js | 15 + src/components/VideoWrapper/ReplyVideo.js | 16 + src/components/VideoWrapper/styles.js | 21 ++ 9 files changed, 66 insertions(+), 304 deletions(-) delete mode 100644 src/components/Home/TransactionPepoButton.js rename src/components/{Home/VideoWrapper.js => VideoWrapper/Base.js} (93%) create mode 100644 src/components/VideoWrapper/FanVideo.js create mode 100644 src/components/VideoWrapper/ReplyVideo.js create mode 100644 src/components/VideoWrapper/styles.js diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index 73996035..6c68db8f 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -1,7 +1,7 @@ import React, { PureComponent } from 'react'; import { View } from 'react-native'; import { withNavigation } from 'react-navigation'; -import VideoWrapper from '../Home/VideoWrapper'; +import FanVideo from "../VideoWrapper/FanVideo"; import ShareIcon from "../CommonComponents/ShareIcon"; import ReportVideo from "../CommonComponents/ReportVideo"; import PepoApi from '../../services/PepoApi'; @@ -14,6 +14,7 @@ import inlineStyles from './styles'; import PepoTxBtn from '../PepoTransactionButton/PepoTxBtn'; + class VideoReplyRow extends PureComponent { constructor(props) { super(props); @@ -33,7 +34,7 @@ class VideoReplyRow extends PureComponent { render() { return ( - - - ({ - balance: state.balance, - disabled: state.executeTransactionDisabledStatus, - isVideoUserActivated: utilities.isUserActivated(reduxGetter.getUserActivationStatus(ownProps.userId)), - supporters: reduxGetter.getVideoSupporters(ownProps.videoId), - isSupporting: reduxGetter.isVideoSupported(ownProps.videoId), - totalBt: reduxGetter.getVideoBt(ownProps.videoId, state), - isCurrentUserActivated: CurrentUser.isUserActivated() -}); - -class TransactionPepoButton extends PureComponent { - constructor(props) { - super(props); - this.localSupported = this.props.isSupporting; - } - - isDisabled = () => { - return ( - this.props.userId == CurrentUser.getUserId() || !this.isBalance() || !this.props.isCurrentUserActivated || this.props.disabled || !this.props.isVideoUserActivated - ); - }; - - isBalance = () => { - return this.getBalanceToNumber() >= 1 ? true : false; - }; - - getBalanceToNumber = () => { - return (this.props.balance && Math.floor(Number(pricer.getFromDecimal(this.props.balance)))) || 0; - }; - - getBtAmount = () => { - let btAmount = Pricer.getToBT(Pricer.getFromDecimal(this.props.totalBt), 2) || 0; - return Number(btAmount); - }; - - get toUser() { - return reduxGetter.getUser(this.props.userId); - } - - sendTransactionToSdk(btAmount) { - const user = CurrentUser.getUser(); - // const option = { wait_for_finalization: false }; - const btInDecimal = pricer.getToDecimal(btAmount); - ensureDeivceAndSession(user.ost_user_id, btInDecimal, (device) => { - this._deviceUnauthorizedCallback(device); - }, (errorMessage, success) => { - this._ensureDeivceAndSessionCallback(btAmount,errorMessage, success); - }); - } - - _ensureDeivceAndSessionCallback(btAmount, errorMessage, success) { - - const btInDecimal = pricer.getToDecimal(btAmount); - VideoPlayPauseEmitter.emit('play'); - if ( success ) { - return this._executeTransaction(btInDecimal); - } - - if ( errorMessage ) { - if ( ON_USER_CANCLLED_ERROR_MSG === errorMessage) { - //Cancel the flow. - this.syncData(1000); - return; - } - - // Else: Show the error message. - this.syncData(1000); - Toast.show({ - text: errorMessage, - icon: 'error' - }); - - } - } - - _deviceUnauthorizedCallback( device ) { - //Cancel the flow. - this.syncData(1000); - - this.props.navigation.push('AuthDeviceDrawer', { device }); - } - - _executeTransaction(btInDecimal) { - this.workflow = new ExecuteTransactionWorkflow(this); - OstWalletSdk.executeTransaction( - CurrentUser.getOstUserId(), - [this.toUser.ost_token_holder_address], - [btInDecimal], - appConfig.ruleTypeMap.directTransfer, - this.getSdkMetaProperties(), - this.workflow - ); - } - - getSdkMetaProperties() { - const metaProperties = clone(appConfig.metaProperties); - if (this.props.videoId) { - metaProperties['name'] = 'video'; - metaProperties['details'] = `vi_${this.props.videoId}`; - } - return metaProperties; - } - - onRequestAcknowledge(ostWorkflowContext, ostWorkflowEntity) { - this.sendTransactionToPlatform(ostWorkflowEntity); - this.dropPixel(); - } - - dropPixel() { - let pixelParams = { - e_entity: 'video', - e_action: 'contribution', - e_data_json: { - video_id: this.props.videoId, - profile_user_id: this.props.userId, - amount: this.btAmount - }, - p_type: 'feed' - }; - PixelCall(pixelParams); - } - - onFlowInterrupt(ostWorkflowContext, error) { - this.onSdkError(error, ostWorkflowContext); - } - - sendTransactionToPlatform(ostWorkflowEntity) { - const params = this.getSendTransactionPlatformData(ostWorkflowEntity); - new PepoApi('/ost-transactions') - .post(params) - .then((res) => {}) - .catch((error) => {}) - .finally(() => { - this.syncData(); - }); - } - - onSdkError(error, ostWorkflowContext) { - this.syncData(1000); - let errMsg; - if ( ostWorkflowContext ) { - errMsg = ostSdkErrors.getErrorMessage(ostWorkflowContext, error); - } else { - errMsg = ostErrors.getErrorMessage(error); - } - Toast.show({ - text: errMsg, - icon: 'error' - }); - } - - getSendTransactionPlatformData(ostWorkflowEntity) { - return { - ost_transaction: deepGet(ostWorkflowEntity, 'entity'), - ost_transaction_uuid: deepGet(ostWorkflowEntity, 'entity.id'), - meta: { - vi: this.props.videoId - } - }; - } - - onTransactionIconWrapperClick = () => { - utilities.checkActiveUser() && CurrentUser.isUserActivated(true); - }; - - reduxUpdate(isTXBtnDisabled, balance, totalBt, supporters) { - if (isTXBtnDisabled !== undefined) { - Store.dispatch(updateExecuteTransactionStatus(isTXBtnDisabled)); - } - - if (balance) { - balance = pricer.getToDecimal(balance); - Store.dispatch(updateBalance(balance)); - } - - let videoStats = reduxGetter.getVideoStats(this.props.videoId), - updateVideoStats = false; - if (totalBt && totalBt > 0) { - videoStats['total_amount_raised_in_wei'] = Pricer.getToDecimal(totalBt); - updateVideoStats = true; - } - - if (supporters && !this.props.isSupporting) { - videoStats['total_contributed_by'] = supporters; - updateVideoStats = true; - } - - if (updateVideoStats) { - Store.dispatch(upsertVideoStatEntities(utilities._getEntityFromObj(videoStats))); - } - } - - onPressOut = (btAmount, totalBt) => { - this.onLocalUpdate(btAmount, totalBt); - this.sendTransactionToSdk(btAmount); - }; - - onLocalUpdate(btAmount) { - this.btAmount = btAmount; - let expectedTotal = this.getBtAmount() + btAmount; - this.localSupported = true; - this.reduxUpdate(true, this.getBalanceToUpdate(btAmount), expectedTotal, this.props.supporters + 1); - } - - getBalanceToUpdate(updateAmount, isRevert) { - if (!updateAmount) return; - let balance = pricer.getFromDecimal(this.props.balance); - balance = (balance && Number(balance)) || 0; - updateAmount = (updateAmount && Number(updateAmount)) || 0; - if (isRevert) { - return balance + updateAmount; - } else { - return balance - updateAmount; - } - } - - onMaxReached = () => { - Toast.show({ - text: ostErrors.getUIErrorMessage('maxAllowedBt'), - icon: 'error' - }); - }; - - syncData(timeOut) { - this.props.resyncDataDelegate && this.props.resyncDataDelegate(); - pricer.getBalance(); - setTimeout(() => { - this.reduxUpdate(false); - if (!this.props.isSupporting) { - this.localSupported = false; - } - }, timeOut); - } - - render() { - return ( - - - - - - ); - } -} - -export default connect(mapStateToProps)(withNavigation(TransactionPepoButton)); diff --git a/src/components/UserVideoHistory/UserVideoHistoryRow.js b/src/components/UserVideoHistory/UserVideoHistoryRow.js index 6eec3320..0297e7e1 100644 --- a/src/components/UserVideoHistory/UserVideoHistoryRow.js +++ b/src/components/UserVideoHistory/UserVideoHistoryRow.js @@ -1,12 +1,11 @@ import React, { PureComponent } from 'react'; import { View } from 'react-native'; import { withNavigation } from 'react-navigation'; -import VideoWrapper from '../Home/VideoWrapper'; +import FanVideo from '../VideoWrapper/FanVideo'; import ShareIcon from "../CommonComponents/ShareIcon"; import ReportVideo from "../CommonComponents/ReportVideo"; import PepoApi from '../../services/PepoApi'; - import CurrentUser from '../../models/CurrentUser'; import BottomStatus from '../Home/BottomStatus'; @@ -17,7 +16,6 @@ import utilities from '../../services/Utilities'; import ReplyIcon from '../CommonComponents/ReplyIcon'; import PepoTxBtn from '../PepoTransactionButton/PepoTxBtn'; - class UserVideoHistoryRow extends PureComponent { constructor(props) { super(props); @@ -48,7 +46,7 @@ class UserVideoHistoryRow extends PureComponent { render() { return ( - { - return { - videoImgUrl: reduxGetter.getVideoImgUrl(ownProps.videoId, state), - videoUrl: reduxGetter.getVideoUrl(ownProps.videoId, state), - loginPopover: ownProps.isActive && state.login_popover.show - }; -}; const VIDEO_PLAY_START_EVENT_NAME = "video_play_start"; const VIDEO_PLAY_END_EVENT_NAME = "video_play_end"; -class VideoWrapper extends PureComponent { +class Base extends PureComponent { constructor(props) { super(props); this.state = { @@ -248,7 +239,7 @@ class VideoWrapper extends PureComponent { } } -VideoWrapper.defaultProps = { +Base.defaultProps = { shouldPlay: function(){ return true; }, @@ -256,4 +247,4 @@ VideoWrapper.defaultProps = { isActive: true }; -export default connect(mapStateToProps)(withNavigation(VideoWrapper)); +export default withNavigation(Base); diff --git a/src/components/VideoWrapper/FanVideo.js b/src/components/VideoWrapper/FanVideo.js new file mode 100644 index 00000000..9b53894e --- /dev/null +++ b/src/components/VideoWrapper/FanVideo.js @@ -0,0 +1,15 @@ + +import reduxGetter from "../../services/ReduxGetters"; +import { connect } from 'react-redux'; +import Base from "./Base"; + +const mapStateToProps = (state, ownProps) => { + return { + videoImgUrl: reduxGetter.getVideoImgUrl(ownProps.videoId, state), + videoUrl: reduxGetter.getVideoUrl(ownProps.videoId, state), + loginPopover: ownProps.isActive && state.login_popover.show + }; +}; + +const FanVideo = connect(mapStateToProps)(Base); +export default FanVideo; \ No newline at end of file diff --git a/src/components/VideoWrapper/ReplyVideo.js b/src/components/VideoWrapper/ReplyVideo.js new file mode 100644 index 00000000..c4a4aae3 --- /dev/null +++ b/src/components/VideoWrapper/ReplyVideo.js @@ -0,0 +1,16 @@ + +import reduxGetter from "../../services/ReduxGetters"; +import { connect } from 'react-redux'; +import Base from "./Base"; + +const mapStateToProps = (state, ownProps) => { + //TODO + return { + videoImgUrl: reduxGetter.getVideoImgUrl(ownProps.videoId, state), + videoUrl: reduxGetter.getVideoUrl(ownProps.videoId, state), + loginPopover: ownProps.isActive && state.login_popover.show + }; +}; + +const ReplyVideo = connect(mapStateToProps)(Base); +export default ReplyVideo; \ No newline at end of file diff --git a/src/components/VideoWrapper/styles.js b/src/components/VideoWrapper/styles.js new file mode 100644 index 00000000..2af13b42 --- /dev/null +++ b/src/components/VideoWrapper/styles.js @@ -0,0 +1,21 @@ +import { Dimensions} from 'react-native'; +import DefaultStyleGenerator from '../../theme/styles/DefaultStyleGenerator'; + +const {width, height} = Dimensions.get('window'); + +let stylesMap = { + + fullHeightWidthSkipFont: { + width: "100%", + height: "100%" + }, + playIconSkipFont: { + position: 'absolute', + height: 25, + width: 25, + top: height * 0.5 - 12, + left: width * 0.5 - 12 + } +}; + +export default styles = DefaultStyleGenerator.generate(stylesMap); From de4e364d0893e0a954548112cb24a573452fb189 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Wed, 13 Nov 2019 20:28:47 +0530 Subject: [PATCH 044/302] Bottom Status --- .../BottomStatus.js => BottomStatus /Base.js} | 14 +-------- .../BottomStatus /ReplyVideoBottomStatus.js | 17 +++++++++++ .../BottomStatus /VideoBottomStatus.js | 17 +++++++++++ src/components/BottomStatus /styles.js | 30 +++++++++++++++++++ .../VideoReplyRow.js | 6 ++-- .../FullScreeVideoRow.js | 6 ++-- src/components/Home/HomeFeedRow.js | 5 ++-- .../UserVideoHistory/UserVideoHistoryRow.js | 4 +-- 8 files changed, 74 insertions(+), 25 deletions(-) rename src/components/{Home/BottomStatus.js => BottomStatus /Base.js} (86%) create mode 100644 src/components/BottomStatus /ReplyVideoBottomStatus.js create mode 100644 src/components/BottomStatus /VideoBottomStatus.js create mode 100644 src/components/BottomStatus /styles.js diff --git a/src/components/Home/BottomStatus.js b/src/components/BottomStatus /Base.js similarity index 86% rename from src/components/Home/BottomStatus.js rename to src/components/BottomStatus /Base.js index 691b051f..c789cbd7 100644 --- a/src/components/Home/BottomStatus.js +++ b/src/components/BottomStatus /Base.js @@ -1,6 +1,5 @@ import React, { PureComponent } from 'react'; import { View, Text } from 'react-native'; -import { connect } from 'react-redux'; import { withNavigation } from 'react-navigation'; import inlineStyles from './styles'; @@ -12,17 +11,6 @@ import InAppBrowser from '../../services/InAppBrowser'; import Utilities from '../../services/Utilities'; import CurrentUser from '../../models/CurrentUser'; -const mapStateToProps = (state, ownProps) => { - return { - userName: reduxGetter.getUserName(ownProps.userId, state), - name: reduxGetter.getName(ownProps.userId, state), - description: reduxGetter.getVideoDescription(reduxGetter.getVideoDescriptionId(ownProps.videoId, state), state), - link: reduxGetter.getVideoLink(reduxGetter.getVideoLinkId(ownProps.videoId, state), state), - supporters: reduxGetter.getVideoSupporters(ownProps.videoId), - totalBt: reduxGetter.getVideoBt(ownProps.videoId, state) - }; -}; - class BottomStatus extends PureComponent { constructor(props) { super(props); @@ -131,4 +119,4 @@ class BottomStatus extends PureComponent { }; } -export default connect(mapStateToProps)(withNavigation(BottomStatus)); +export default withNavigation(BottomStatus); diff --git a/src/components/BottomStatus /ReplyVideoBottomStatus.js b/src/components/BottomStatus /ReplyVideoBottomStatus.js new file mode 100644 index 00000000..c7acb93a --- /dev/null +++ b/src/components/BottomStatus /ReplyVideoBottomStatus.js @@ -0,0 +1,17 @@ +import reduxGetter from "../../services/ReduxGetters"; +import { connect } from 'react-redux'; +import Base from "./Base" + +const mapStateToProps = (state, ownProps) => { + return { + userName: reduxGetter.getUserName(ownProps.userId, state), + name: reduxGetter.getName(ownProps.userId, state), + description: reduxGetter.getVideoDescription(reduxGetter.getVideoDescriptionId(ownProps.videoId, state), state), + link: reduxGetter.getVideoLink(reduxGetter.getVideoLinkId(ownProps.videoId, state), state), + supporters: reduxGetter.getVideoSupporters(ownProps.videoId), + totalBt: reduxGetter.getVideoBt(ownProps.videoId, state) + }; + }; + + const ReplyVideoBottomStatus = connect(mapStateToProps)(Base); + export default ReplyVideoBottomStatus; \ No newline at end of file diff --git a/src/components/BottomStatus /VideoBottomStatus.js b/src/components/BottomStatus /VideoBottomStatus.js new file mode 100644 index 00000000..7024d288 --- /dev/null +++ b/src/components/BottomStatus /VideoBottomStatus.js @@ -0,0 +1,17 @@ +import reduxGetter from "../../services/ReduxGetters"; +import { connect } from 'react-redux'; +import Base from "./Base" + +const mapStateToProps = (state, ownProps) => { + return { + userName: reduxGetter.getUserName(ownProps.userId, state), + name: reduxGetter.getName(ownProps.userId, state), + description: reduxGetter.getVideoDescription(reduxGetter.getVideoDescriptionId(ownProps.videoId, state), state), + link: reduxGetter.getVideoLink(reduxGetter.getVideoLinkId(ownProps.videoId, state), state), + supporters: reduxGetter.getVideoSupporters(ownProps.videoId), + totalBt: reduxGetter.getVideoBt(ownProps.videoId, state) + }; + }; + + const VideoBottomStatus = connect(mapStateToProps)(Base); + export default VideoBottomStatus; \ No newline at end of file diff --git a/src/components/BottomStatus /styles.js b/src/components/BottomStatus /styles.js new file mode 100644 index 00000000..f06df144 --- /dev/null +++ b/src/components/BottomStatus /styles.js @@ -0,0 +1,30 @@ +import { Dimensions} from 'react-native'; +import DefaultStyleGenerator from '../../theme/styles/DefaultStyleGenerator'; +import Colors from '../../theme/styles/Colors'; + +const { height} = Dimensions.get('window'); + +let stylesMap = { + + bottomBg: { + backgroundColor: 'rgba(0, 0, 0, 0.6)', + borderTopLeftRadius: 20, + minHeight: height * 0.05, + paddingHorizontal: 12 + }, + + bottomBgTxt: { + color: Colors.white + }, + handle: { + fontSize: 15, + paddingBottom: 3, + color: Colors.white, + fontFamily: 'AvenirNext-DemiBold', + fontWeight: '700' + } +} + +; + +export default styles = DefaultStyleGenerator.generate(stylesMap); diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index 6c68db8f..289b868a 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -7,14 +7,12 @@ import ReportVideo from "../CommonComponents/ReportVideo"; import PepoApi from '../../services/PepoApi'; import deepGet from 'lodash/get'; -import BottomStatus from '../Home/BottomStatus'; +import VideoBottomStatus from '../BottomStatus /VideoBottomStatus'; import VideoAmountStat from '../CommonComponents/VideoAmoutStat'; import inlineStyles from './styles'; import PepoTxBtn from '../PepoTransactionButton/PepoTxBtn'; - - class VideoReplyRow extends PureComponent { constructor(props) { super(props); @@ -62,7 +60,7 @@ class VideoReplyRow extends PureComponent { /> - diff --git a/src/components/FullScreenVideoCollection/FullScreeVideoRow.js b/src/components/FullScreenVideoCollection/FullScreeVideoRow.js index 728e34af..5dca724f 100644 --- a/src/components/FullScreenVideoCollection/FullScreeVideoRow.js +++ b/src/components/FullScreenVideoCollection/FullScreeVideoRow.js @@ -7,8 +7,7 @@ import ReportVideo from "../CommonComponents/ReportVideo"; import PepoApi from '../../services/PepoApi'; import deepGet from 'lodash/get'; - -import BottomStatus from '../Home/BottomStatus'; +import VideoBottomStatus from '../BottomStatus /VideoBottomStatus'; import VideoAmountStat from '../CommonComponents/VideoAmoutStat'; import inlineStyles from './styles'; @@ -16,7 +15,6 @@ import ReplyIcon from '../CommonComponents/ReplyIcon'; import PepoTxBtn from '../PepoTransactionButton/PepoTxBtn'; - class FullScreeVideoRow extends PureComponent { constructor(props) { super(props); @@ -63,7 +61,7 @@ class FullScreeVideoRow extends PureComponent { /> - diff --git a/src/components/Home/HomeFeedRow.js b/src/components/Home/HomeFeedRow.js index 8ce9d72c..202268be 100644 --- a/src/components/Home/HomeFeedRow.js +++ b/src/components/Home/HomeFeedRow.js @@ -8,7 +8,7 @@ import PepoApi from '../../services/PepoApi'; import reduxGetter from '../../services/ReduxGetters'; import CurrentUser from '../../models/CurrentUser'; -import BottomStatus from './BottomStatus'; +import VideoBottomStatus from '../BottomStatus /VideoBottomStatus'; import VideoAmountStat from '../CommonComponents/VideoAmoutStat'; import inlineStyles from './styles'; @@ -17,6 +17,7 @@ import ReportVideo from "../CommonComponents/ReportVideo"; import ReplyIcon from '../CommonComponents/ReplyIcon'; import PepoTxBtn from '../PepoTransactionButton/PepoTxBtn'; + class HomeFeedRow extends PureComponent { constructor(props) { super(props); @@ -76,7 +77,7 @@ class HomeFeedRow extends PureComponent { /> - + ); diff --git a/src/components/UserVideoHistory/UserVideoHistoryRow.js b/src/components/UserVideoHistory/UserVideoHistoryRow.js index 0297e7e1..5e0d39ab 100644 --- a/src/components/UserVideoHistory/UserVideoHistoryRow.js +++ b/src/components/UserVideoHistory/UserVideoHistoryRow.js @@ -8,7 +8,7 @@ import PepoApi from '../../services/PepoApi'; import CurrentUser from '../../models/CurrentUser'; -import BottomStatus from '../Home/BottomStatus'; +import VideoBottomStatus from '../BottomStatus /VideoBottomStatus'; import VideoAmountStat from '../CommonComponents/VideoAmoutStat'; import inlineStyles from './styles'; @@ -75,7 +75,7 @@ class UserVideoHistoryRow extends PureComponent { /> - From 4bc45755e3920f9697bb9751a709f885a41753b4 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Wed, 13 Nov 2019 20:29:56 +0530 Subject: [PATCH 045/302] Update VideoReplyRow.js --- src/components/FullScreenReplyCollection/VideoReplyRow.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index 6c68db8f..43de5bd2 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -8,11 +8,10 @@ import PepoApi from '../../services/PepoApi'; import deepGet from 'lodash/get'; import BottomStatus from '../Home/BottomStatus'; -import VideoAmountStat from '../CommonComponents/VideoAmoutStat'; import inlineStyles from './styles'; import PepoTxBtn from '../PepoTransactionButton/PepoTxBtn'; - +import VideoReplySupporterStat from '../CommonComponents/VideoSupporterStat/VideoReplySupporterStat'; class VideoReplyRow extends PureComponent { @@ -56,7 +55,7 @@ class VideoReplyRow extends PureComponent { - From 984839e485ecd133d77e9aee6ea458eed8a940fc Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Wed, 13 Nov 2019 20:32:20 +0530 Subject: [PATCH 046/302] code changes --- .../CommonComponents/ReplyIcon/index.js | 2 +- .../UserProfileFlatList/index.js | 4 +- .../CommonComponents/VideoAmoutStat.js | 76 ------------------- .../VideoThumbnailItem/index.js | 64 ---------------- .../VideoThumbnailItem/style.js | 43 ----------- .../FullScreenReplyCollection/index.js | 2 +- .../FullScreeVideoRow.js | 4 +- src/components/Home/HomeFeedRow.js | 4 +- src/components/ReplyCollection/index.js | 55 ++++++++------ src/components/TopsList/index.js | 4 +- .../UserVideoHistory/UserVideoHistoryRow.js | 4 +- src/components/VideoCollections/index.js | 5 +- src/constants/DataContract.js | 10 ++- src/services/ReduxGetters.js | 35 ++++++++- 14 files changed, 86 insertions(+), 226 deletions(-) delete mode 100644 src/components/CommonComponents/VideoAmoutStat.js delete mode 100644 src/components/CommonComponents/VideoThumbnailItem/index.js delete mode 100644 src/components/CommonComponents/VideoThumbnailItem/style.js diff --git a/src/components/CommonComponents/ReplyIcon/index.js b/src/components/CommonComponents/ReplyIcon/index.js index 8de27d70..af09d1db 100644 --- a/src/components/CommonComponents/ReplyIcon/index.js +++ b/src/components/CommonComponents/ReplyIcon/index.js @@ -53,7 +53,7 @@ class ReplyIcon extends PureComponent { return; } - if (this.props.videoReplyCount > 0){ + if (this.props.videoReplyCount > 0 || true){ this.props.navigation.push('VideoReplies', {'videoId': this.props.videoId , 'userId': this.props.userId, diff --git a/src/components/CommonComponents/UserProfileFlatList/index.js b/src/components/CommonComponents/UserProfileFlatList/index.js index ba452777..4c5e30c1 100644 --- a/src/components/CommonComponents/UserProfileFlatList/index.js +++ b/src/components/CommonComponents/UserProfileFlatList/index.js @@ -25,7 +25,7 @@ import CurrentUser from "../../../models/CurrentUser"; import DeleteVideo from "../DeleteVideo"; import Colors from '../../../theme/styles/Colors'; import CommonStyle from "../../../theme/styles/Common" -import VideoThumbnailItem from '../VideoThumbnailItem'; +import VideoThumbnail from '../../CommonComponents/VideoThumbnail/VideoThumbnail'; import DataContract from '../../../constants/DataContract'; @@ -153,7 +153,7 @@ class UserProfileFlatList extends PureComponent { {this.removeVideo(videoId , index )}} /> } - {this.onVideoClick(item, index)}}/> ); }; diff --git a/src/components/CommonComponents/VideoAmoutStat.js b/src/components/CommonComponents/VideoAmoutStat.js deleted file mode 100644 index 164c89ea..00000000 --- a/src/components/CommonComponents/VideoAmoutStat.js +++ /dev/null @@ -1,76 +0,0 @@ -import React, { PureComponent } from 'react'; -import { View, Text } from 'react-native'; -import { connect } from 'react-redux'; -import { withNavigation } from 'react-navigation'; - -import reduxGetter from '../../services/ReduxGetters'; - -import pricer from '../../services/Pricer'; - -import inlineStyles from '../Home/styles'; -import { TouchableWithoutFeedback } from 'react-native-gesture-handler'; -import multipleClickHandler from '../../services/MultipleClickHandler'; -import Utilities from "../../services/Utilities"; -import CurrentUser from '../../models/CurrentUser'; - - -const mapStateToProps = (state, ownProps) => { - return { - supporters: reduxGetter.getUserSupporters(ownProps.userId, state), - totalBt: reduxGetter.getVideoBt(ownProps.videoId, state) - }; -}; - -class VideoAmountStat extends PureComponent { - constructor(props) { - super(props); - } - - btToFiat(btAmount) { - const priceOracle = pricer.getPriceOracle(); - btAmount = priceOracle.fromDecimal(btAmount); - return (priceOracle && priceOracle.btToFiat(btAmount, 2)) || 0; - } - - navigateToUserProfile = () => { - if (Utilities.checkActiveUser()) { - if (this.props.userId == CurrentUser.getUserId()) { - this.props.navigation.navigate('ProfileScreen'); - } else { - this.props.navigation.push('UsersProfileScreen', { userId: this.props.userId }); - } - } - }; - - render() { - return ( - this.navigateToUserProfile())} pointerEvents={'auto'}> - - {/*{*/} - {/**/} - {/*${`${ pricer.toDisplayAmount(this.btToFiat(this.props.totalBt))}`}{' '}RAISED*/} - {/**/} - {/*}*/} - { - - - {this.props.supporters || 0} - {Utilities.getSingularPluralText(this.props.supporters , "Supporter")} - - - - } - - - ); - } -} - -export default connect(mapStateToProps)(withNavigation(VideoAmountStat)); diff --git a/src/components/CommonComponents/VideoThumbnailItem/index.js b/src/components/CommonComponents/VideoThumbnailItem/index.js deleted file mode 100644 index ad22a395..00000000 --- a/src/components/CommonComponents/VideoThumbnailItem/index.js +++ /dev/null @@ -1,64 +0,0 @@ -import {Dimensions, Image, Text, TouchableWithoutFeedback, View} from "react-native"; -import React from 'react'; -import FastImage from 'react-native-fast-image'; -import Colors from "../../../theme/styles/Colors"; -import LinearGradient from "react-native-linear-gradient"; -import pepoWhiteIcon from "../../../assets/pepo-white-icon.png"; -import inlineStyles from "./style"; -import reduxGetters from "../../../services/ReduxGetters"; -import AppConfig from "../../../constants/AppConfig"; -import multipleClickHandler from '../../../services/MultipleClickHandler' -import Pricer from "../../../services/Pricer"; -import deepGet from 'lodash/get'; -import ProfilePicture from "../../ProfilePicture"; - -let getVideoBtAmount = (videoId) => { - return Pricer.displayAmountWithKFomatter( Pricer.getFromDecimal( reduxGetters.getVideoBt(videoId) ) ) ; -} - -export default (props) => { - const videoId = deepGet(props, 'payload.video_id'), - userId = deepGet(props, 'payload.user_id'), - userName = reduxGetters.getUserName(userId), - imageUrl = reduxGetters.getVideoImgUrl(videoId,null, AppConfig.userVideos.userScreenCoverImageWidth), - videoDesc =reduxGetters.getVideoDescription(reduxGetters.getVideoDescriptionId(videoId)); - - - return { props.onVideoClick && props.onVideoClick(videoId, props.index );} )} - > - - - - - {videoDesc} - - - - @{userName} - - - - {getVideoBtAmount(videoId)} - - - - - - - -} \ No newline at end of file diff --git a/src/components/CommonComponents/VideoThumbnailItem/style.js b/src/components/CommonComponents/VideoThumbnailItem/style.js deleted file mode 100644 index 51b50659..00000000 --- a/src/components/CommonComponents/VideoThumbnailItem/style.js +++ /dev/null @@ -1,43 +0,0 @@ -import DefaultStyleGenerator from '../../../theme/styles/DefaultStyleGenerator'; -import Colors from '../../../theme/styles/Colors'; - -let stylesMap = { - videoStatsContainer: { - flexDirection: 'row', - textAlign: 'right', - flex: 1, - justifyContent: 'flex-end' - }, - videoStatsTxt: { - color: Colors.white, - fontSize: 14, - fontFamily: 'AvenirNext-Regular', - marginLeft: 2 - }, - videoDescStyle: { - color: Colors.white, - fontSize: 14, - fontFamily: 'AvenirNext-Regular', - }, - - videoUserNameStyle: { - color: Colors.white, - fontSize: 14, - fontFamily: 'AvenirNext-Regular', - fontWeight: '600', - marginLeft: 5 - }, - - videoInfoContainer: { - padding: 5, - width: '100%', - marginBottom : 3 - }, - - userNameStyle: { - - } - -}; - -export default styles = DefaultStyleGenerator.generate(stylesMap); diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index 007da88a..846204c5 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -190,7 +190,7 @@ class FullScreenReplyCollection extends PureComponent{ _renderItem = ({ item, index }) => { const payload = { user_id : deepGet(item, "payload.user_id") , video_id: deepGet(item, "payload.reply_detail_id")} - return - diff --git a/src/components/Home/HomeFeedRow.js b/src/components/Home/HomeFeedRow.js index 202268be..c31ac02a 100644 --- a/src/components/Home/HomeFeedRow.js +++ b/src/components/Home/HomeFeedRow.js @@ -9,13 +9,13 @@ import reduxGetter from '../../services/ReduxGetters'; import CurrentUser from '../../models/CurrentUser'; import VideoBottomStatus from '../BottomStatus /VideoBottomStatus'; -import VideoAmountStat from '../CommonComponents/VideoAmoutStat'; import inlineStyles from './styles'; import utilities from '../../services/Utilities'; import ReportVideo from "../CommonComponents/ReportVideo"; import ReplyIcon from '../CommonComponents/ReplyIcon'; import PepoTxBtn from '../PepoTransactionButton/PepoTxBtn'; +import VideoSupporterStat from '../CommonComponents/VideoSupporterStat/VideoSupporterStat'; class HomeFeedRow extends PureComponent { @@ -70,7 +70,7 @@ class HomeFeedRow extends PureComponent { - { - //TODO Let ask BE for same payload - const userId = deepGet(item, "payload.user_id"); - const videoId = deepGet(item, "payload.reply_detail_id"); - const payload = { user_id : userId , video_id: videoId} - return ( - {this.isCurrentUser( userId ) && - - {this.removeVideo(videoId , index )}} /> - - } - {this.onVideoClick(payload, index)}}/> - ); + return this.renderThumbnailItem(item , index) }; + renderThumbnailItem ( item , index ){ + const kind = deepGet( item , "kind"); + if( kind == DataContract.videos.videoKind.reply){ + const userId = deepGet(item, "payload.user_id"); + const reply_detail_id = deepGet(item,'payload.reply_detail_id'); + const videoId = ReduxGetters.getVideoReplyId(reply_detail_id); + const replyKind = ReduxGetters.getVideoReplyKind(reply_detail_id); + if(replyKind == DataContract.replies.videoReplyKind.video) { + return ( + {this.isCurrentUser( userId ) && + + {this.removeVideo(videoId , index )}} /> + + } + {this.onVideoClick(index)}}/> + ); + } + } + } + isCurrentUser = ( userId ) => { return userId === CurrentUser.getUserId(); } @@ -203,13 +211,12 @@ class VideoReplyList extends PureComponent { this.setState({list: array}); } - onVideoClick = (payload, index) => { + onVideoClick = ( index ) => { const clonedInstance = this.videoPagination.fetchServices.cloneInstance(); //TODO @ashutosh to understand this.props.navigation.push("FullScreenReplyCollection", { "fetchServices" : clonedInstance, "currentIndex": index, - "payload": payload, "baseUrl": this.props.fetchUrl, "amount": this.props.amount, "videoReplyCount": this.props.videoReplyCount, diff --git a/src/components/TopsList/index.js b/src/components/TopsList/index.js index e1d41e58..6ed2b34c 100644 --- a/src/components/TopsList/index.js +++ b/src/components/TopsList/index.js @@ -12,7 +12,7 @@ import TagsCell from '../TagsList/TagsCell'; import Pagination from "../../services/MultiSection/MultiSectionPagination"; import PeopleCell from "../PeopleList/PeopleCell"; -import VideoThumbnailItem from "../CommonComponents/VideoThumbnailItem"; +import VideoThumbnail from "../CommonComponents/VideoThumbnail/VideoThumbnail"; import {FetchServices} from "../../services/FetchServices"; const titleKeyName = 'title', @@ -191,7 +191,7 @@ class TopsList extends PureComponent { let itemKey = "top_list_" + i + "_" + itemData.id; items.push( - - diff --git a/src/components/VideoCollections/index.js b/src/components/VideoCollections/index.js index 8ec5f16a..bd5a6ca5 100644 --- a/src/components/VideoCollections/index.js +++ b/src/components/VideoCollections/index.js @@ -2,9 +2,9 @@ import React, { PureComponent } from 'react'; import { ActivityIndicator , FlatList} from "react-native"; import {SafeAreaView} from "react-navigation"; import Pagination from "../../services/Pagination"; -import VideoThumbnailItem from '../../components/CommonComponents/VideoThumbnailItem'; import CommonStyle from "../../theme/styles/Common"; +import VideoThumbnail from '../CommonComponents/VideoThumbnail/VideoThumbnail'; class VideoCollections extends PureComponent { constructor(props){ @@ -151,7 +151,7 @@ class VideoCollections extends PureComponent { }; _renderVideoCell = ({ item, index }) => { - return ( {this.onVideoClick(item.payload, index)}} @@ -170,6 +170,7 @@ class VideoCollections extends PureComponent { showBalanceFlyer: this.props.extraParams && this.props.extraParams.showBalanceFlyer }); } + renderFooter = () => { if (!this.state.loadingNext) return null; return ; diff --git a/src/constants/DataContract.js b/src/constants/DataContract.js index ab5500a0..85f0565a 100644 --- a/src/constants/DataContract.js +++ b/src/constants/DataContract.js @@ -48,7 +48,10 @@ export default { validatePost: "/videos/validate-upload", getSingleVideoReplyApi : (id) => { return `/replies/${id}`; - } + }, + videoReplyKind: { + video: "VIDEO" + } }, common: { @@ -66,7 +69,10 @@ export default { videos: { getDeleteVideoApi : (id) => { return `/videos/${id}/delete`; - } + }, + videoKind: { + reply : "VIDEO_REPLY" + }, } } diff --git a/src/services/ReduxGetters.js b/src/services/ReduxGetters.js index 0493ea24..2a64c59e 100644 --- a/src/services/ReduxGetters.js +++ b/src/services/ReduxGetters.js @@ -42,6 +42,10 @@ class ReduxGetters { state = state || Store.getState(); size = size || appConfig.videoConstant.videoImageWidth; let posterImageId = deepGet(state, `video_entities.id_${id}.poster_image_id`); + return this.getImageUrl(posterImageId, state, size); + } + + getImageUrl( posterImageId, state, size) { return ( deepGet(state, `image_entities.id_${posterImageId}.resolutions.${size}.url`) || deepGet(state, `image_entities.id_${posterImageId}.resolutions.original.url`) @@ -109,6 +113,11 @@ class ReduxGetters { return deepGet(state, `video_stat_entities.id_${id}.total_amount_raised_in_wei`); } + getVideoReplyBt(id, state) { + state = state || Store.getState(); + return deepGet(state, `video_reply_stat_entities.id_${id}.total_amount_raised_in_wei`); + } + getVideoStats(id, state) { state = state || Store.getState(); return deepGet(state, `video_stat_entities.id_${id}`); @@ -425,17 +434,37 @@ class ReduxGetters { getVideoReplyCount(id, state){ state = state || Store.getState(); - return deepGet(state, `video_stat_entities.id_${id}.total_replies`, 0); + return deepGet(state, `video_reply_stat_entities.id_${id}.total_replies`, 0); } getVideoReplyAmount(id, state){ state = state || Store.getState(); - return deepGet(state, `video_stat_entities.id_${id}.per_reply_amount_in_wei`, 0); + return deepGet(state, `video_reply_stat_entities.id_${id}.per_reply_amount_in_wei`, 0); } getVideoReplyAllowed(id, state){ state = state || Store.getState(); - return deepGet(state, `video_stat_entities.id_${id}.is_reply_allowed`, true); + return deepGet(state, `video_reply_stat_entities.id_${id}.is_reply_allowed`, true); + } + + getVideoReplyKind(id, state){ + state = state || Store.getState(); + return deepGet(state, `video_reply_stat_entities.id_${id}.entity_kind`); + } + + getVideoReplyId(id, state){ + state = state || Store.getState(); + return deepGet(state, `video_reply_stat_entities.id_${id}.entity_id`); + } + + getVideoReplyDescriptionId(id, state) { + state = state || Store.getState(); + return deepGet(state, `video_reply_stat_entities.id_${id}.description_id`); + } + + getVideoReplyBt(id, state) { + state = state || Store.getState(); + return deepGet(state, `video_reply_stat_entities.id_${id}.total_amount_raised_in_wei`); } } From e1d001cc412e2d639f5abe513216d5cf5ee3206d Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Wed, 13 Nov 2019 20:32:38 +0530 Subject: [PATCH 047/302] add files --- .../VideoSupporterStat/Base.js | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 src/components/CommonComponents/VideoSupporterStat/Base.js diff --git a/src/components/CommonComponents/VideoSupporterStat/Base.js b/src/components/CommonComponents/VideoSupporterStat/Base.js new file mode 100644 index 00000000..8ba9446a --- /dev/null +++ b/src/components/CommonComponents/VideoSupporterStat/Base.js @@ -0,0 +1,64 @@ +import React, { PureComponent } from 'react'; +import { View, Text } from 'react-native'; +import { withNavigation } from 'react-navigation'; + +import pricer from '../../../services/Pricer'; +import inlineStyles from '../../Home/styles'; +import { TouchableWithoutFeedback } from 'react-native-gesture-handler'; +import multipleClickHandler from '../../../services/MultipleClickHandler'; +import Utilities from "../../../services/Utilities"; +import CurrentUser from '../../../models/CurrentUser'; + +class VideoSupporterStat extends PureComponent { + constructor(props) { + super(props); + } + + btToFiat(btAmount) { + const priceOracle = pricer.getPriceOracle(); + btAmount = priceOracle.fromDecimal(btAmount); + return (priceOracle && priceOracle.btToFiat(btAmount, 2)) || 0; + } + + navigateToUserProfile = () => { + if (Utilities.checkActiveUser()) { + if (this.props.userId == CurrentUser.getUserId()) { + this.props.navigation.navigate('ProfileScreen'); + } else { + this.props.navigation.push('UsersProfileScreen', { userId: this.props.userId }); + } + } + }; + + render() { + return ( + this.navigateToUserProfile())} pointerEvents={'auto'}> + + {/*{*/} + {/**/} + {/*${`${ pricer.toDisplayAmount(this.btToFiat(this.props.totalBt))}`}{' '}RAISED*/} + {/**/} + {/*}*/} + { + + + {this.props.supporters || 0} + {Utilities.getSingularPluralText(this.props.supporters , "Supporter")} + + + + } + + + ); + } +} + +export default withNavigation(VideoSupporterStat); From b3f8bf203ba252068a30efe2b5386818b07a0a16 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Wed, 13 Nov 2019 20:32:54 +0530 Subject: [PATCH 048/302] add files --- .../VideoReplySupporterStat.js | 20 +++++++ .../VideoSupporterStat/VideoSupporterStat.js | 22 +++++++ .../CommonComponents/VideoThumbnail/Base.js | 60 +++++++++++++++++++ .../VideoThumbnail/ReplyThumbnail.js | 23 +++++++ .../VideoThumbnail/VideoThumbnail.js | 22 +++++++ .../CommonComponents/VideoThumbnail/style.js | 43 +++++++++++++ 6 files changed, 190 insertions(+) create mode 100644 src/components/CommonComponents/VideoSupporterStat/VideoReplySupporterStat.js create mode 100644 src/components/CommonComponents/VideoSupporterStat/VideoSupporterStat.js create mode 100644 src/components/CommonComponents/VideoThumbnail/Base.js create mode 100644 src/components/CommonComponents/VideoThumbnail/ReplyThumbnail.js create mode 100644 src/components/CommonComponents/VideoThumbnail/VideoThumbnail.js create mode 100644 src/components/CommonComponents/VideoThumbnail/style.js diff --git a/src/components/CommonComponents/VideoSupporterStat/VideoReplySupporterStat.js b/src/components/CommonComponents/VideoSupporterStat/VideoReplySupporterStat.js new file mode 100644 index 00000000..be818ca9 --- /dev/null +++ b/src/components/CommonComponents/VideoSupporterStat/VideoReplySupporterStat.js @@ -0,0 +1,20 @@ +import { connect } from 'react-redux'; + +import reduxGetter from '../../../services/ReduxGetters'; +import Base from './Base'; + + +const mapStateToProps = (state, ownProps) => { + return { + supporters: reduxGetter.getUserSupporters(ownProps.userId, state), + totalBt: reduxGetter.getVideoReplyBt(ownProps.videoId, state) + }; +}; + +class VideoReplyAmountStat extends Base { + constructor(props) { + super(props); + } +} + +export default connect(mapStateToProps)(Base); diff --git a/src/components/CommonComponents/VideoSupporterStat/VideoSupporterStat.js b/src/components/CommonComponents/VideoSupporterStat/VideoSupporterStat.js new file mode 100644 index 00000000..d6006546 --- /dev/null +++ b/src/components/CommonComponents/VideoSupporterStat/VideoSupporterStat.js @@ -0,0 +1,22 @@ +import { connect } from 'react-redux'; + +import reduxGetter from '../../../services/ReduxGetters'; +import Base from './Base'; + + +const mapStateToProps = (state, ownProps) => { + return { + supporters: reduxGetter.getUserSupporters(ownProps.userId, state), + totalBt: reduxGetter.getVideoBt(ownProps.videoId, state) + }; +}; + +class VideoAmountStat extends Base { + constructor(props) { + super(props); + } +} + + + +export default connect(mapStateToProps)(Base); diff --git a/src/components/CommonComponents/VideoThumbnail/Base.js b/src/components/CommonComponents/VideoThumbnail/Base.js new file mode 100644 index 00000000..57aa116b --- /dev/null +++ b/src/components/CommonComponents/VideoThumbnail/Base.js @@ -0,0 +1,60 @@ +import {Dimensions, Image, Text, TouchableWithoutFeedback, View} from "react-native"; +import React, { PureComponent } from 'react'; +import FastImage from 'react-native-fast-image'; +import Colors from "../../../theme/styles/Colors"; +import LinearGradient from "react-native-linear-gradient"; +import pepoWhiteIcon from "../../../assets/pepo-white-icon.png"; +import inlineStyles from "./style"; +import multipleClickHandler from '../../../services/MultipleClickHandler' +import ProfilePicture from "../../ProfilePicture"; + + +class Base extends PureComponent { + + constructor(props){ + super(props); + } + + render(){ + return { this.props.onVideoClick && this.props.onVideoClick()} )} + > + + + + + {this.props.videoDesc} + + + + @{this.props.userName} + + + + {this.props.btAmount} + + + + + + + + } + +} + +export default Base; \ No newline at end of file diff --git a/src/components/CommonComponents/VideoThumbnail/ReplyThumbnail.js b/src/components/CommonComponents/VideoThumbnail/ReplyThumbnail.js new file mode 100644 index 00000000..3b5a1430 --- /dev/null +++ b/src/components/CommonComponents/VideoThumbnail/ReplyThumbnail.js @@ -0,0 +1,23 @@ +import Base from "./Base"; +import React, { PureComponent } from 'react'; +import reduxGetters from '../../../services/ReduxGetters'; +import AppConfig from '../../../constants/AppConfig'; +import deepGet from "lodash/get"; + +class ReplyThumbnail extends PureComponent { + constructor(props){ + super(props); + } + + render(){ + const replyId = deepGet(this.props , "payload.reply_detail_id"), + userId = deepGet(this.props , "payload.user_id") , + videoId = reduxGetters.getVideoReplyId( replyId ), + userName = reduxGetters.getUserName(userId), + imageUrl = reduxGetters.getVideoImgUrl(videoId, null, AppConfig.userVideos.userScreenCoverImageWidth) , + videoDesc = reduxGetters.getVideoDescription(reduxGetters.getVideoReplyDescriptionId(videoId)) + ; + return ; + } +} +export default ReplyThumbnail; \ No newline at end of file diff --git a/src/components/CommonComponents/VideoThumbnail/VideoThumbnail.js b/src/components/CommonComponents/VideoThumbnail/VideoThumbnail.js new file mode 100644 index 00000000..09ec7aa3 --- /dev/null +++ b/src/components/CommonComponents/VideoThumbnail/VideoThumbnail.js @@ -0,0 +1,22 @@ +import Base from "./Base"; +import React, { PureComponent } from 'react'; +import reduxGetters from '../../../services/ReduxGetters'; +import AppConfig from '../../../constants/AppConfig'; +import deepGet from "lodash/get"; + +class VideoThumbnail extends PureComponent { + constructor(props){ + super(props); + } + + render(){ + const videoId = deepGet(this.props , "payload.video_id"), + userId = deepGet(this.props , "payload.user_id") , + userName = reduxGetters.getUserName(userId), + imageUrl = reduxGetters.getVideoImgUrl(videoId, null, AppConfig.userVideos.userScreenCoverImageWidth) , + videoDesc = reduxGetters.getVideoDescription(reduxGetters.getVideoDescriptionId(videoId)) + ; + return ; + } +} +export default VideoThumbnail; \ No newline at end of file diff --git a/src/components/CommonComponents/VideoThumbnail/style.js b/src/components/CommonComponents/VideoThumbnail/style.js new file mode 100644 index 00000000..51b50659 --- /dev/null +++ b/src/components/CommonComponents/VideoThumbnail/style.js @@ -0,0 +1,43 @@ +import DefaultStyleGenerator from '../../../theme/styles/DefaultStyleGenerator'; +import Colors from '../../../theme/styles/Colors'; + +let stylesMap = { + videoStatsContainer: { + flexDirection: 'row', + textAlign: 'right', + flex: 1, + justifyContent: 'flex-end' + }, + videoStatsTxt: { + color: Colors.white, + fontSize: 14, + fontFamily: 'AvenirNext-Regular', + marginLeft: 2 + }, + videoDescStyle: { + color: Colors.white, + fontSize: 14, + fontFamily: 'AvenirNext-Regular', + }, + + videoUserNameStyle: { + color: Colors.white, + fontSize: 14, + fontFamily: 'AvenirNext-Regular', + fontWeight: '600', + marginLeft: 5 + }, + + videoInfoContainer: { + padding: 5, + width: '100%', + marginBottom : 3 + }, + + userNameStyle: { + + } + +}; + +export default styles = DefaultStyleGenerator.generate(stylesMap); From f585449f7bcb5d3e261e0089efa685fbb035d24c Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Wed, 13 Nov 2019 20:36:15 +0530 Subject: [PATCH 049/302] fix --- src/components/FullScreenReplyCollection/VideoReplyRow.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index 9a827115..4570da16 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -13,9 +13,6 @@ import PepoTxBtn from '../PepoTransactionButton/PepoTxBtn'; import VideoReplySupporterStat from '../CommonComponents/VideoSupporterStat/VideoReplySupporterStat'; import VideoBottomStatus from '../BottomStatus /VideoBottomStatus'; -import inlineStyles from './styles'; - -import PepoTxBtn from '../PepoTransactionButton/PepoTxBtn'; class VideoReplyRow extends PureComponent { constructor(props) { From 27456449a1adeba8b937fd0e5c231262a11b9f72 Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Wed, 13 Nov 2019 20:59:12 +0530 Subject: [PATCH 050/302] transaction success --- src/services/CameraWorker.js | 80 +++++++++++++++++++---------- src/services/TransactionExecutor.js | 8 +-- 2 files changed, 57 insertions(+), 31 deletions(-) diff --git a/src/services/CameraWorker.js b/src/services/CameraWorker.js index 1e7a91b4..689891d7 100644 --- a/src/services/CameraWorker.js +++ b/src/services/CameraWorker.js @@ -26,6 +26,8 @@ import {ensureDeivceAndSession, ON_USER_CANCLLED_ERROR_MSG} from "../helpers/Tra import pricer from "./Pricer"; import {VideoPlayPauseEmitter} from "../helpers/Emitters"; import DataContract from "../constants/DataContract"; +import {TransactionExecutor} from './TransactionExecutor'; +import { ostSdkErrors } from '../services/OstSdkErrors'; const recordedVideoStates = [ 'raw_video', @@ -37,8 +39,7 @@ const recordedVideoStates = [ 'video_link', 'reply_amount', 'video_type', - 'reply_obj', - 'go_for_tx' + 'reply_obj' ]; const processingStatuses = [ @@ -166,17 +167,53 @@ class CameraWorker extends PureComponent { }; + onRequestAcknowledge = ( ostWorkflowContext, ostWorkflowEntity ) => { + console.log('CameraWorker.onRequestAcknowledge'); + Toast.show({ + text: 'Your video uploaded successfully.', + icon: 'success', + imageUri: this.props.recorded_video.cover_image + }); + Store.dispatch( + upsertRecordedVideo({ + do_discard: true, + pepo_api_posting: false + }) + ); + }; + + onFlowInterrupt = (ostWorkflowContext, error) => { + console.log('CameraWorker.onFlowInterrupt', ostWorkflowContext, error); + videoUploaderComponent.emit('hide'); + Store.dispatch(videoInProcessing(false)); + Toast.show({ + text: ostSdkErrors.getErrorMessage(ostWorkflowContext, error), + icon: 'error' + }); + }; + executeTransaction = () => { + let goForTx = this.props.recorded_video.go_for_tx; - if (! goForTx){ + let receiverUserId = deepGet (this.props.recorded_video, 'reply_obj.replyReceiverUserId'); + let amountToSendWithReply = deepGet(this.props.recorded_video, 'reply_obj.amountToSendWithReply'); + if (! goForTx || ! receiverUserId || ! amountToSendWithReply ){ return; } + console.log('CameraWorker.executeTransaction'); + + + let callbacks = {onRequestAcknowledge: this.onRequestAcknowledge, onFlowInterrupt: this.onFlowInterrupt}; + + let txExecutor = new TransactionExecutor({}, callbacks); + txExecutor.sendTransactionToSdk( '10', receiverUserId, false); // todo : Execute transaction code. call clean up after that. }; uploadReplyVideo = async () => { + console.log('CameraWorker.uploadReplyVideo'); await this.uploadVideo(); await this.uploadCoverImage(); await this.postReplyVideoToPepoApi() ; @@ -184,13 +221,16 @@ class CameraWorker extends PureComponent { postReplyVideoToPepoApi = async () => { + let readyForTx = deepGet(this.props.recorded_video , 'go_for_tx' ), parentVideoId = deepGet(this.props.recorded_video , 'reply_obj.replyReceiverVideoId'); if ( readyForTx || !parentVideoId ) { + // we have reply OR we dont have video Id return true } + console.log('I ammmmmmmhereeeee', this.props.recorded_video.s3_video, this.props.recorded_video.pepo_api_posting, this.postToPepoApi ); if ( this.props.recorded_video.s3_video && @@ -205,7 +245,7 @@ class CameraWorker extends PureComponent { imageInfo = await RNFS.stat(this.props.recorded_video.cover_image); imageSize = imageInfo.size; } - + console.log('CameraWorker.postReplyVideoToPepoApi'); Store.dispatch( upsertRecordedVideo({ pepo_api_posting: true @@ -244,20 +284,20 @@ class CameraWorker extends PureComponent { .post(payload) .then((responseData) => { if (responseData.success && responseData.data) { - console.log('Video uploaded Successfully'); + console.log('reply sent Successfully to Pepo Api'); let resultType = deepGet(responseData, DataContract.common.resultType), reply = deepGet(responseData, `data.${resultType}` ); if (reply && reply.length > 0 ){ let replyObj = deepGet(this.props.recorded_video , 'reply_obj' ); - replyObj['replyDetailId'] = reply[0].id; + replyObj['replyDetailId'] = reply[0].payload.reply_detail_id; Store.dispatch( upsertRecordedVideo({ pepo_api_posting: false, reply_obj: replyObj, go_for_tx: true }) - ) + ); } else { Store.dispatch( upsertRecordedVideo({ @@ -265,10 +305,12 @@ class CameraWorker extends PureComponent { }) ) } - - - } else { + Toast.show({ + text: responseData.err.msg, + icon: 'error' + + }); videoUploaderComponent.emit('hide'); Store.dispatch(videoInProcessing(false)); } @@ -287,26 +329,8 @@ class CameraWorker extends PureComponent { }); }); } - // here we will get reply_id }; - - - - - - - - - activateSession = async () => { - // Activate session. - }; - - - - - - async cleanUp() { // stop ffmpge processing videoUploaderComponent.emit('hide'); diff --git a/src/services/TransactionExecutor.js b/src/services/TransactionExecutor.js index 5d0b1fc1..e4f51d6e 100644 --- a/src/services/TransactionExecutor.js +++ b/src/services/TransactionExecutor.js @@ -1,7 +1,9 @@ import { OstWalletSdk } from '@ostdotcom/ost-wallet-sdk-react-native'; import {ensureDeivceAndSession} from '../helpers/TransactionHelper'; import ExecuteTransactionWorkflow from '../services/OstWalletCallbacks/ExecuteTransactionWorkFlow'; - +import Pricer from "../services/Pricer"; +import deepGet from 'lodash/get'; +import PepoApi from '../services/PepoApi'; import CurrentUser from "../models/CurrentUser"; import AppConfig from '../constants/AppConfig'; import ReduxGetters from './ReduxGetters'; @@ -34,7 +36,7 @@ class TransactionExecutor { } sendTransactionToSdk(btAmount=0 , toUserId , validateSession=true ) { - const btInDecimal = pricer.getToDecimal(btAmount); + const btInDecimal = Pricer.getToDecimal(btAmount); this.setToUser( toUserId ); if( !validateSession ){ @@ -119,4 +121,4 @@ class TransactionExecutor { } -export { TransactionExecutor }; \ No newline at end of file +export { TransactionExecutor }; From ad85a43d4cb6bec107ea027adead3a56f632593a Mon Sep 17 00:00:00 2001 From: Shraddha Date: Wed, 13 Nov 2019 18:18:12 +0530 Subject: [PATCH 051/302] modal background + numberInput changes --- RootNavigationContainer.js | 5 +- src/components/AddEmail/index.js | 3 +- .../CommonComponents/NumberInput/index.js | 85 +++++++++++++++++++ src/components/FanVideoDetails/index.js | 47 +++++++++- src/components/FanVideoDetails/styles.js | 7 +- src/components/Home/AuthDeviceDrawer.js | 3 +- src/components/InviteCode/index.js | 3 +- src/components/Redemption/index.js | 3 +- src/components/SayThanks/index.js | 3 +- src/components/Search/styles.js | 3 +- src/components/StoreProducts/index.js | 3 +- .../Transaction/TransactionScreen.js | 3 +- src/services/NavigationStateHandler.js | 2 +- src/theme/styles/Common.js | 4 + 14 files changed, 158 insertions(+), 16 deletions(-) create mode 100644 src/components/CommonComponents/NumberInput/index.js diff --git a/RootNavigationContainer.js b/RootNavigationContainer.js index 7c7b4824..4b6deeb4 100644 --- a/RootNavigationContainer.js +++ b/RootNavigationContainer.js @@ -1,5 +1,5 @@ import React from 'react'; -import { View, Dimensions, Easing, Animated } from 'react-native'; +import { View, Dimensions, Easing, Animated , Platform} from 'react-native'; import { Root } from 'native-base'; import { createSwitchNavigator, createAppContainer } from 'react-navigation'; import { createStackNavigator , StackViewTransitionConfigs} from 'react-navigation-stack'; @@ -98,7 +98,8 @@ const txModalConfig = { && prevScene.route.routeName === 'VideoReplies' && nextScene.route.routeName === 'FullScreenReplyCollection') { return NavigationAnimation.zoomIn(); - } else if (prevScene + } + else if (prevScene && prevScene.route.routeName === 'FullScreenReplyCollection' && nextScene.route.routeName === 'VideoReplies') { return NavigationAnimation.zoomOut(); diff --git a/src/components/AddEmail/index.js b/src/components/AddEmail/index.js index 16f5cf85..66eaa5d6 100644 --- a/src/components/AddEmail/index.js +++ b/src/components/AddEmail/index.js @@ -14,6 +14,7 @@ import { ostErrors } from '../../services/OstErrors'; import Colors from '../../theme/styles/Colors'; import CurrentUser from '../../models/CurrentUser'; import { navigateTo } from '../../helpers/navigateTo'; +import CommonStyle from '../../theme/styles/Common'; const bottomSpace = getBottomSpace([true]), extraPadding = 10, @@ -214,7 +215,7 @@ class AddEmailScreen extends React.Component { render() { return ( - + {!this.state.emailSent ? this.emailSignUp() : this.confirmEmail()} diff --git a/src/components/CommonComponents/NumberInput/index.js b/src/components/CommonComponents/NumberInput/index.js new file mode 100644 index 00000000..427d4fcf --- /dev/null +++ b/src/components/CommonComponents/NumberInput/index.js @@ -0,0 +1,85 @@ +import React,{PureComponent} from 'react'; +import {View,Text,TextInput} from 'react-native'; + +import NumberFormatter from '../../../helpers/NumberFormatter'; +import { ostErrors } from '../../../services/OstErrors'; + +export default class NumberInput extends PureComponent{ + constructor( props ){ + super( props ); + + this.min = 1; + this.max = 500; + if(props.min){ + this.min = props.min; + } + if(props.max){ + this.max = props.max + } + this.state={ + value : props.value, + errorMsg : "" + } + this.numberFormatter = new NumberFormatter(); + + + } + isValidInput(val){ + let errorMsg = this.getErrorMessage(val); + if(errorMsg){ + this.props.onErrorCallBack(errorMsg); + this.setState({ + value: val, + valueError: errorMsg + }); + return false; + }else{ + + this.setState({ + value: val, + valueError: "" + }); + return true; + } + + } + onChangeText(value) { + console.log("value",value) + let formattedVal = this.numberFormatter.convertToValidFormat(value) + , val = this.numberFormatter.getFullStopValue(formattedVal); + this.props.onChangeText(val); + if(this.isValidInput(value)){ + this.setState({value : val}); + } + } + + getErrorMessage( val ){ + if (val && String(val).indexOf(',') > -1) { + return ostErrors.getUIErrorMessage('bt_amount_decimal_error'); + } + if (val && String(val).split('.')[1] && String(val).split('.')[1].length > 2) { + return ostErrors.getUIErrorMessage('bt_amount_decimal_allowed_error'); + } + val = val && Number(val); + if (!val || val < this.min) { + return ostErrors.getUIErrorMessage('bt_amount_error'); + } + if( val && val > this.max ){ + return ostErrors.getUIErrorMessage('bt_exceeds_bal_amount_error'); + } + + return undefined; + } + + render(){ + return( + + {this.onChangeText(value)}} + keyboardType = 'decimal-pad' + >{this.state.value} + + + ) + } +} diff --git a/src/components/FanVideoDetails/index.js b/src/components/FanVideoDetails/index.js index 7f855bcc..5b95e428 100644 --- a/src/components/FanVideoDetails/index.js +++ b/src/components/FanVideoDetails/index.js @@ -30,13 +30,20 @@ import { getBottomSpace } from 'react-native-iphone-x-helper'; import { StackActions } from 'react-navigation'; import PepoApi from "../../services/PepoApi"; import DataContract from "../../constants/DataContract"; +import NumberInput from "../CommonComponents/NumberInput"; +import NumberFormatter from "../../helpers/NumberFormatter"; +import pricer from '../../services/Pricer'; +import PepoPinkIcon from '../../assets/pepo-tx-icon.png'; const mapStateToProps = (state, ownProps) => { return { + balance : state.balance, recordedVideo: reduxGetter.getRecordedVideo() }; }; +const DEFAUT_BT_VALUE = 10; + class FanVideoDetails extends Component { static navigationOptions = ({ navigation }) => { return { @@ -80,6 +87,8 @@ class FanVideoDetails extends Component { this.videoDesc = this.props.recordedVideo.video_desc; this.videoLink = this.props.recordedVideo.video_link; this.replyAmount = this.props.recordedVideo.reply_amount; + this.priceOracle = pricer.getPriceOracle(); + this.numberFormatter = new NumberFormatter(); this.state = { viewStyle: { paddingBottom: 10 @@ -87,9 +96,12 @@ class FanVideoDetails extends Component { error: null, amountError: null, linkError: null, - descError : null + descError : null, + usdVal : this.getUSDValue(DEFAUT_BT_VALUE) }; + + } _keyboardShown = (e) => { let keyboardHeight = deepGet(e, 'endCoordinates.height') || 350; @@ -244,6 +256,25 @@ class FanVideoDetails extends Component { }); }; + onErrorCallBack = ( errMsg ) =>{ + this.setState({ + amountError : errMsg + }) + } + + onChangeText = ( value )=>{ + let formattedUsdVal = this.getUSDValue( value ); + this.setState({ + usdVal : formattedUsdVal, + amountError : "" + }); + } + getUSDValue = (value ) =>{ + let usdVal = this.priceOracle.btToFiat(value), + formattedUsdVal = this.numberFormatter.getFormattedValue( usdVal ); + return formattedUsdVal; + } + render() { let imageUrl = this.props.recordedVideo.cover_image; return ( @@ -276,8 +307,18 @@ class FanVideoDetails extends Component { {this.state.linkError } Set Price for replies - - + + + + + ${this.state.usdVal} + + {this.state.amountError } diff --git a/src/components/FanVideoDetails/styles.js b/src/components/FanVideoDetails/styles.js index 6a81263e..246194d2 100644 --- a/src/components/FanVideoDetails/styles.js +++ b/src/components/FanVideoDetails/styles.js @@ -76,7 +76,12 @@ let stylesMap = { shadowOpacity: 0.2, elevation: 1 }, - linkText: { color: Colors.softBlue, flex: 3} + linkText: { color: Colors.softBlue, flex: 3}, + replyAmtWrapper : { + flex:1, + flexDirection:"row", + justifyContent:'space-between', + alignItems:'center'} }; export default styles = DefaultStyleGenerator.generate(stylesMap); diff --git a/src/components/Home/AuthDeviceDrawer.js b/src/components/Home/AuthDeviceDrawer.js index cee77513..b0122d27 100644 --- a/src/components/Home/AuthDeviceDrawer.js +++ b/src/components/Home/AuthDeviceDrawer.js @@ -10,6 +10,7 @@ import infoIcon from '../../assets/toast_error.png'; import Theme from "../../theme/styles"; import modalCross from '../../assets/modal-cross-icon.png'; import LinearGradient from 'react-native-linear-gradient'; +import CommonStyle from '../../theme/styles/Common'; @@ -128,7 +129,7 @@ export default class AuthDeviceDrawer extends PureComponent { let config = this._getViewConfig(); return( - + diff --git a/src/components/InviteCode/index.js b/src/components/InviteCode/index.js index 05cc1c56..4758879e 100644 --- a/src/components/InviteCode/index.js +++ b/src/components/InviteCode/index.js @@ -18,6 +18,7 @@ import Utilities from '../../services/Utilities'; import AppConfig from '../../constants/AppConfig'; import { upsertInviteCode } from '../../actions'; import Store from '../../store'; +import CommonStyle from '../../theme/styles/Common'; const mapStateToProps = ({ invite_code }) => ({ invite_code }); @@ -183,7 +184,7 @@ class InviteCodeScreen extends React.Component { render() { return ( - + diff --git a/src/components/Redemption/index.js b/src/components/Redemption/index.js index 1bc9e6f4..8c9bb259 100644 --- a/src/components/Redemption/index.js +++ b/src/components/Redemption/index.js @@ -50,6 +50,7 @@ import clone from 'lodash/clone'; import { ostSdkErrors, WORKFLOW_CANCELLED_MSG } from '../../services/OstSdkErrors'; import Colors from '../../theme/styles/Colors'; import InAppBrowser from '../../services/InAppBrowser'; +import CommonStyle from '../../theme/styles/Common'; const bottomSpace = getBottomSpace([true]), extraPadding = 10, @@ -658,7 +659,7 @@ class Redemption extends PureComponent{ render(){ return ( - + diff --git a/src/components/SayThanks/index.js b/src/components/SayThanks/index.js index fa63803a..1906e718 100644 --- a/src/components/SayThanks/index.js +++ b/src/components/SayThanks/index.js @@ -20,6 +20,7 @@ import Theme from '../../theme/styles'; import Colors from '../../theme/styles/Colors'; import TwitterAuth from '../../services/ExternalLogin/TwitterAuth'; import Toast from '../../theme/components/NotificationToast'; +import CommonStyle from '../../theme/styles/Common'; const bottomSpace = getBottomSpace([true]), extraPadding = 10, @@ -197,7 +198,7 @@ class SayThanks extends Component { } }} > - + {this.state.gettingTweetInfo && ( diff --git a/src/components/Search/styles.js b/src/components/Search/styles.js index 05146466..8b3670ee 100644 --- a/src/components/Search/styles.js +++ b/src/components/Search/styles.js @@ -6,8 +6,7 @@ let stylesMap = { container: { paddingBottom: 0, paddingTop: Platform.OS === 'ios' ? 30 : 20, - flex: 1, - backgroundColor: Colors.white + flex: 1 }, textInputUi: { marginTop: 0, diff --git a/src/components/StoreProducts/index.js b/src/components/StoreProducts/index.js index 536a60e4..e1e3bdb1 100644 --- a/src/components/StoreProducts/index.js +++ b/src/components/StoreProducts/index.js @@ -26,6 +26,7 @@ import toastError from '../../assets/toast_error.png'; import pepoIcon from '../../assets/self-amount-pepo-icon.png'; import mailIcon from '../../assets/mail-filled.png'; import { ostErrors } from '../../services/OstErrors'; +import CommonStyle from '../../theme/styles/Common'; class StoreProductsScreen extends PureComponent{ @@ -279,7 +280,7 @@ class StoreProductsScreen extends PureComponent{ render(){ return ( - + {/**/} diff --git a/src/components/Transaction/TransactionScreen.js b/src/components/Transaction/TransactionScreen.js index a24605bb..9991b93e 100644 --- a/src/components/Transaction/TransactionScreen.js +++ b/src/components/Transaction/TransactionScreen.js @@ -37,6 +37,7 @@ import LinearGradient from 'react-native-linear-gradient'; import { ON_USER_CANCLLED_ERROR_MSG, ensureDeivceAndSession } from '../../helpers/TransactionHelper'; import ReduxGetters from '../../services/ReduxGetters'; import PepoNativeHelper from '../../helpers/PepoNativeHelper'; +import CommonStyle from '../../theme/styles/Common'; const bottomSpace = getBottomSpace([true]), extraPadding = 10, @@ -544,7 +545,7 @@ class TransactionScreen extends Component { } }} > - + diff --git a/src/services/NavigationStateHandler.js b/src/services/NavigationStateHandler.js index cd9076b8..16ba055b 100644 --- a/src/services/NavigationStateHandler.js +++ b/src/services/NavigationStateHandler.js @@ -5,7 +5,7 @@ import Colors from "../theme/styles/Colors"; import NavigationService from './NavigationService'; import AppConfig from '../constants/AppConfig'; -const routesWithoutStatusBar = ['Home', 'HomeScreen', 'VideoPlayer', 'CaptureVideo', 'CaptureImageScreen', 'ImageGalleryScreen', 'UserVideoHistory', 'FullScreenVideoCollection']; +const routesWithoutStatusBar = ['Home', 'HomeScreen', 'VideoPlayer', 'CaptureVideo', 'CaptureImageScreen', 'ImageGalleryScreen', 'UserVideoHistory', "VideoReplies", 'FullScreenVideoCollection']; const typesToIgnore = ['Navigation/COMPLETE_TRANSITION', 'Navigation/MARK_DRAWER_SETTLING', 'Navigation/MARK_DRAWER_IDLE', 'Navigation/DRAWER_CLOSED']; const routesAnalyticsMap = AppConfig.routesAnalyticsMap; diff --git a/src/theme/styles/Common.js b/src/theme/styles/Common.js index 7887a9c8..505737a9 100644 --- a/src/theme/styles/Common.js +++ b/src/theme/styles/Common.js @@ -4,6 +4,10 @@ import Colors from './Colors'; const styles = { viewContainer: { flex:1, backgroundColor: Colors.white + }, + modalViewContainer: { + flex:1, + backgroundColor: 'rgba(0,0,0,0.5)' } }; From f1c8a46d296193cf4291c9ba72fc3b96e6e46daf Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Wed, 13 Nov 2019 21:30:57 +0530 Subject: [PATCH 052/302] sliding up panel UI --- src/components/ReplyCollection/index.js | 1 + src/components/VideoReplies/index.js | 93 ++++++++++++++----------- 2 files changed, 53 insertions(+), 41 deletions(-) diff --git a/src/components/ReplyCollection/index.js b/src/components/ReplyCollection/index.js index 1ebe7ea7..4a831106 100644 --- a/src/components/ReplyCollection/index.js +++ b/src/components/ReplyCollection/index.js @@ -246,6 +246,7 @@ class VideoReplyList extends PureComponent { render(){ return ( height; const topPadding = getInset('top', landScape); const bottomPadding = getInset('bottom', landScape); +const finalPadding = topPadding - bottomPadding; +const listBottomPadding = height - (height/1.5); class VideoRepliesScreen extends PureComponent { @@ -50,10 +52,12 @@ class VideoRepliesScreen extends PureComponent { this.listener = null; this.panelAnimateTimeOut = 0 ; + this.state = { showBackdrop : false, videoUploaderVisible: false, - videoUploaderText: 'Posting reply' + videoUploaderText: 'Posting reply', + currentHeight : this.initialHeight } } @@ -65,7 +69,7 @@ class VideoRepliesScreen extends PureComponent { videoUploaderVisible: true//find from redux @mayur }); - }, 500) + }, 300) videoUploaderComponent.on('show', this.showVideoUploader); videoUploaderComponent.on('hide', this.hideVideoUploader); } @@ -146,48 +150,55 @@ class VideoRepliesScreen extends PureComponent { id={3} /> )} - (this._panel = c)} - containerStyle={{zIndex: 99}} - animatedValue={this.animatedValue} - ref={c => (this._panel = c)} - draggableRange={{ - top: height - topPadding - bottomPadding, //TODO check is top expand - bottom: 0 - }} - showBackdrop={this.state.showBackdrop} - snappingPoints={[0, this.initialHeight, height]}> - {dragHandler => ( - - - - - - - - - - Replies to {this.userName} - - {/* {TODO integration pending} */} - Send a reply with{' '} - - {this.amount} - + (this._panel = c)} + containerStyle={{zIndex: 99}} + animatedValue={this.animatedValue} + onMomentumDragEnd={(value) => { + this.setState({ + currentHeight : value + }) - - - + }} + ref={c => (this._panel = c)} + draggableRange={{ + top: height - finalPadding, //TODO check is top expand + bottom: 0 + }} + showBackdrop={this.state.showBackdrop} + snappingPoints={[0, this.initialHeight, height]}> + {dragHandler => ( + + + + + + + + + + Replies to {this.userName} + + {/* {TODO integration pending} */} + Send a reply with{' '} + + {this.amount} + + + + + + + this.initialHeight? 0 : listBottomPadding} + /> - - - - )} - + + )} + ); } From b3d4f9d0388285070f6a6c40ee01692b1bdc0bc0 Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Wed, 13 Nov 2019 21:31:34 +0530 Subject: [PATCH 053/302] removing a wrong committ --- src/components/CommonComponents/ReplyIcon/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/CommonComponents/ReplyIcon/index.js b/src/components/CommonComponents/ReplyIcon/index.js index af09d1db..8de27d70 100644 --- a/src/components/CommonComponents/ReplyIcon/index.js +++ b/src/components/CommonComponents/ReplyIcon/index.js @@ -53,7 +53,7 @@ class ReplyIcon extends PureComponent { return; } - if (this.props.videoReplyCount > 0 || true){ + if (this.props.videoReplyCount > 0){ this.props.navigation.push('VideoReplies', {'videoId': this.props.videoId , 'userId': this.props.userId, From c210f95e7033eebb9dbe008eeefe9b8ec75277dd Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Wed, 13 Nov 2019 21:55:55 +0530 Subject: [PATCH 054/302] video reply --- src/components/Home/HomeScreen.js | 13 ++++++++++++- src/components/VideoReplies/index.js | 3 ++- src/services/CameraWorker.js | 14 ++++++-------- src/services/ReduxGetters.js | 7 +++++++ src/services/Utilities.js | 1 - 5 files changed, 27 insertions(+), 11 deletions(-) diff --git a/src/components/Home/HomeScreen.js b/src/components/Home/HomeScreen.js index fde383cd..cb02c59c 100644 --- a/src/components/Home/HomeScreen.js +++ b/src/components/Home/HomeScreen.js @@ -16,6 +16,7 @@ import {navigateTo} from "../../helpers/navigateTo"; import { LoadingModal } from '../../theme/components/LoadingModalCover'; import Colors from "../../theme/styles/Colors"; import utilities from "../../services/Utilities"; +import reduxGetter from '../../services/ReduxGetters'; const mapStateToProps = (state) => { return { @@ -165,6 +166,16 @@ class HomeScreen extends Component { updateFlatList && updateFlatList([]); } + + getUploadingText = () => { + let videoType = reduxGetter.getRecordedVideoType(); + if (videoType === 'post'){ + return "Uploading Video"; + } else if (videoType === 'reply'){ + return "Posting reply"; + } + }; + beforeRefresh = () => { Pricer.getBalance(); }; @@ -190,7 +201,7 @@ class HomeScreen extends Component { ), left: 10 }} - displayText="Uploading Video" + displayText={this.getUploadingText()} extendDirection="right" extend={true} id={2} diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index bdf57705..c36e777d 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -23,6 +23,7 @@ import videoUploaderComponent from '../../services/CameraWorkerEventEmitter'; import { getInset } from 'react-native-safe-area-view'; import DataContract from '../../constants/DataContract'; +import reduxGetters from "../../services/ReduxGetters"; const { width, height } = Dimensions.get('window'); const landScape = width > height; const topPadding = getInset('top', landScape); @@ -66,7 +67,7 @@ class VideoRepliesScreen extends PureComponent { setTimeout(()=> { this.setState({ showBackdrop: true, - videoUploaderVisible: true//find from redux @mayur + videoUploaderVisible: reduxGetters.getVideoProcessingStatus() // find from redux @mayur }); }, 300) diff --git a/src/services/CameraWorker.js b/src/services/CameraWorker.js index 689891d7..e3efb90b 100644 --- a/src/services/CameraWorker.js +++ b/src/services/CameraWorker.js @@ -283,6 +283,12 @@ class CameraWorker extends PureComponent { new PepoApi(`/replies`) .post(payload) .then((responseData) => { + Store.dispatch( + upsertRecordedVideo({ + pepo_api_posting: false + }) + ); + if (responseData.success && responseData.data) { console.log('reply sent Successfully to Pepo Api'); let resultType = deepGet(responseData, DataContract.common.resultType), @@ -293,23 +299,15 @@ class CameraWorker extends PureComponent { replyObj['replyDetailId'] = reply[0].payload.reply_detail_id; Store.dispatch( upsertRecordedVideo({ - pepo_api_posting: false, reply_obj: replyObj, go_for_tx: true }) ); - } else { - Store.dispatch( - upsertRecordedVideo({ - pepo_api_posting: false - }) - ) } } else { Toast.show({ text: responseData.err.msg, icon: 'error' - }); videoUploaderComponent.emit('hide'); Store.dispatch(videoInProcessing(false)); diff --git a/src/services/ReduxGetters.js b/src/services/ReduxGetters.js index 2a64c59e..0dfc82ec 100644 --- a/src/services/ReduxGetters.js +++ b/src/services/ReduxGetters.js @@ -180,6 +180,12 @@ class ReduxGetters { return deepGet(Store.getState(), `recorded_video`); } + getRecordedVideoType() { + return deepGet(Store.getState(), `recorded_video.video_type`); + } + + + getRecordedVideoCurrentProcess() { let processing = []; if (deepGet(Store.getState(), `recorded_video.cover_capture_processing`)) { @@ -197,6 +203,7 @@ class ReduxGetters { return processing.join(', '); } + getUserCoverVideoId(id, state) { state = state || Store.getState(); if (deepGet(state, `user_profile_entities.id_${id}.cover_video_id`)) { diff --git a/src/services/Utilities.js b/src/services/Utilities.js index 1a8ef925..6c8335fc 100644 --- a/src/services/Utilities.js +++ b/src/services/Utilities.js @@ -144,7 +144,6 @@ export default { handleVideoUploadModal(previousTabIndex, navigation, params = {}) { if (reduxGetters.getVideoProcessingStatus() == true && previousTabIndex == 0) { - // TODO: check if video or reply and accordingly emit corresponding event. FlyerEventEmitter.emit('onShowProfileFlyer', { id: 2 }); } else if (reduxGetters.getVideoProcessingStatus() == true) { Toast.show({ From 15ffdf5df7b817a644054634136559558abab76f Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Wed, 13 Nov 2019 22:07:10 +0530 Subject: [PATCH 055/302] code changes --- .../CommonComponents/ReplyIcon/index.js | 19 ++---- .../VideoReplyRow.js | 26 +++++--- .../FullScreenReplyCollection/index.js | 20 ++++-- src/components/ReplyCollection/index.js | 65 +++++++++---------- src/components/VideoReplies/index.js | 10 +-- src/constants/DataContract.js | 4 +- src/services/Pricer.js | 4 ++ src/services/Utilities.js | 10 +++ 8 files changed, 88 insertions(+), 70 deletions(-) diff --git a/src/components/CommonComponents/ReplyIcon/index.js b/src/components/CommonComponents/ReplyIcon/index.js index 8de27d70..b1fcb21c 100644 --- a/src/components/CommonComponents/ReplyIcon/index.js +++ b/src/components/CommonComponents/ReplyIcon/index.js @@ -13,16 +13,16 @@ import CurrentUser from '../../../models/CurrentUser'; import NavigationService from "../../../services/NavigationService"; import utilities from "../../../services/Utilities"; import { LoginPopoverActions } from '../../LoginPopover'; +import Pricer from '../../../services/Pricer'; const mapStateToProps = (state , ownProps) => { return { - isCreatorApproved : reduxGetter.isCreatorApproved(ownProps.userId), isVideoUserActivated : Utilities.isUserActivated(reduxGetter.getUserActivationStatus(ownProps.userId)), isCurrentUserActivated : CurrentUser.isUserActivated(), balance : state.balance, requiredPepo : reduxGetter.getVideoReplyAmount(ownProps.videoId, state), - videoReplyCount : reduxGetter.getVideoReplyCount(ownProps.videoId, state), - isReplyAllowed : reduxGetter.getVideoReplyAllowed(ownProps.videoId, state), + videoReplyCount : reduxGetter.getVideoReplyCount(ownProps.videoId, state), //@Preshita TODO verify data + isReplyAllowed : reduxGetter.getVideoReplyAllowed(ownProps.videoId, state), //@Preshita TODO verify data userName : reduxGetter.getUserName(ownProps.userId) } }; @@ -38,11 +38,7 @@ class ReplyIcon extends PureComponent { }; hasSufficientBalance = () => { - return this.getWeiToNumber(this.props.balance) >= this.getWeiToNumber(this.props.requiredPepo); - }; - - getWeiToNumber = ( val ) => { //Move this to utilities - return val && Math.floor(Number(pricer.getFromDecimal(val))) || 0; + return Pricer.getWeiToNumber(this.props.balance) >= Pricer.getWeiToNumber(this.props.requiredPepo); }; replyVideo = ()=> { @@ -53,13 +49,10 @@ class ReplyIcon extends PureComponent { return; } - if (this.props.videoReplyCount > 0){ + if (this.props.videoReplyCount > 0 || true){ this.props.navigation.push('VideoReplies', {'videoId': this.props.videoId , - 'userId': this.props.userId, - 'userName': this.props.userName, - 'amount': this.props.requiredPepo, - 'videoReplyCount': this.props.videoReplyCount + 'userId': this.props.userId }); } else { let activeTab = NavigationService.getActiveTab(); diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index 4570da16..e063ef24 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -13,16 +13,19 @@ import PepoTxBtn from '../PepoTransactionButton/PepoTxBtn'; import VideoReplySupporterStat from '../CommonComponents/VideoSupporterStat/VideoReplySupporterStat'; import VideoBottomStatus from '../BottomStatus /VideoBottomStatus'; +import DataContract from '../../constants/DataContract'; +import ReduxGetters from '../../services/ReduxGetters'; class VideoReplyRow extends PureComponent { constructor(props) { super(props); - this.userId = deepGet(this.props.payload, 'user_id'); - this.replyId = deepGet(this.props.payload, 'video_id'); + this.userId = deepGet(this.props.item, 'payload.user_id'); + this.replyId = deepGet(this.props.item,`payload.${DataContract.replies.replyDetailIdKey}`); + this.videoId = ReduxGetters.getVideoReplyId(this.replyId); } refetchVideoReply = () => { - new PepoApi(`/replies/${this.replyId}`) + new PepoApi(`/replies/${this.videoId}`) .get() .then((res) => {}) .catch((error) => {}); @@ -36,12 +39,12 @@ class VideoReplyRow extends PureComponent { - {!!this.replyId && !!this.userId && ( + {!!this.videoId && !!this.userId && ( @@ -49,21 +52,24 @@ class VideoReplyRow extends PureComponent { - - + + )} diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index 846204c5..f445fcbe 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -4,7 +4,6 @@ import deepGet from "lodash/get"; import Pagination from "../../services/Pagination"; import inlineStyles from "./styles"; -import backIcon from '../../assets/back-arrow.png'; import pepoIcon from '../../assets/pepo-tx-icon.png'; import plusIcon from '../../assets/user-video-capture-icon-selected.png'; import VideoReplyRow from "./VideoReplyRow"; @@ -12,6 +11,8 @@ import NavigationService from "../../services/NavigationService"; import utilities from '../../services/Utilities'; import crossIcon from '../../assets/cross_icon.png'; import ReduxGetters from "../../services/ReduxGetters"; +import Utilities from "../../services/Utilities"; +import DataContract from "../../constants/DataContract"; @@ -189,14 +190,19 @@ class FullScreenReplyCollection extends PureComponent{ } _renderItem = ({ item, index }) => { - const payload = { user_id : deepGet(item, "payload.user_id") , video_id: deepGet(item, "payload.reply_detail_id")} - return ; + if(Utilities.getVideoReplyKind( item ) == DataContract.replies.videoReplyKind.video){ + return this._renderVideoReplyRow( item, index ); + } }; + _renderVideoReplyRow(item, index){ + return ; + } + onViewableItemsChanged = (data) => { this.currentIndex = deepGet(data, 'viewableItems[0].index') || 0; } diff --git a/src/components/ReplyCollection/index.js b/src/components/ReplyCollection/index.js index 4a831106..237c591f 100644 --- a/src/components/ReplyCollection/index.js +++ b/src/components/ReplyCollection/index.js @@ -18,20 +18,19 @@ import { VideoReplyEmitter } from '../../helpers/Emitters'; import PepoApi from '../../services/PepoApi'; import ReplyThumbnail from '../CommonComponents/VideoThumbnail/ReplyThumbnail'; import ReduxGetters from '../../services/ReduxGetters'; +import Utilities from '../../services/Utilities'; class VideoReplyList extends PureComponent { constructor(props){ super(props); - this.state = { list : [], refreshing : true, loadingNext: false }; this.listRef = null; - this.numColumns = 2; } @@ -56,6 +55,13 @@ class VideoReplyList extends PureComponent { }) } + addVideo = ( item ) => { + this.videoPagination.addItems( item ); + let array = [...this.state.list]; // make a separate copy of the array + array.unshift( item ); + this.setState({list: array}); + } + componentWillUnmount() { this.removePaginationListeners(); } @@ -64,7 +70,6 @@ class VideoReplyList extends PureComponent { return this.videoPagination; }; - // region - Pagination and Event Handlers initPagination() { // First, take care of existing Pagination if exists. @@ -165,30 +170,29 @@ class VideoReplyList extends PureComponent { }; renderThumbnailItem ( item , index ){ - const kind = deepGet( item , "kind"); - if( kind == DataContract.videos.videoKind.reply){ - const userId = deepGet(item, "payload.user_id"); - const reply_detail_id = deepGet(item,'payload.reply_detail_id'); - const videoId = ReduxGetters.getVideoReplyId(reply_detail_id); - const replyKind = ReduxGetters.getVideoReplyKind(reply_detail_id); - if(replyKind == DataContract.replies.videoReplyKind.video) { - return ( - {this.isCurrentUser( userId ) && - - {this.removeVideo(videoId , index )}} /> - - } - {this.onVideoClick(index)}}/> - ); - } - } + if(Utilities.getVideoReplyKind( item ) == DataContract.replies.videoReplyKind.video){ + return this._renderVideoReplyThumbnail( item, index ); + } + } + + _renderVideoReplyThumbnail( item, index ) { + const userId = deepGet(item, "payload.user_id"); + const reply_detail_id = deepGet(item,`payload.${DataContract.replies.replyDetailIdKey}`); + const videoId = ReduxGetters.getVideoReplyId(reply_detail_id); + return ( + {this.isCurrentUser( userId ) && + + {this.removeVideo(videoId , index )}} /> + + } + {this.onVideoClick(index)}}/> + ); } isCurrentUser = ( userId ) => { @@ -204,13 +208,6 @@ class VideoReplyList extends PureComponent { } } - addVideo = ( item ) => { - this.videoPagination.addItems( item ); - let array = [...this.state.list]; // make a separate copy of the array - array.unshift( item ); - this.setState({list: array}); - } - onVideoClick = ( index ) => { const clonedInstance = this.videoPagination.fetchServices.cloneInstance(); //TODO @ashutosh to understand diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index c36e777d..3423ea6f 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -23,7 +23,7 @@ import videoUploaderComponent from '../../services/CameraWorkerEventEmitter'; import { getInset } from 'react-native-safe-area-view'; import DataContract from '../../constants/DataContract'; -import reduxGetters from "../../services/ReduxGetters"; +import ReduxGetters from '../../services/ReduxGetters'; const { width, height } = Dimensions.get('window'); const landScape = width > height; const topPadding = getInset('top', landScape); @@ -43,10 +43,10 @@ class VideoRepliesScreen extends PureComponent { constructor(props){ super(props); this.userId = props.navigation.getParam('userId'); - this.userName = props.navigation.getParam('userName'); this.videoId = props.navigation.getParam('videoId'); - this.amount = props.navigation.getParam('amount'); - this.videoReplyCount = props.navigation.getParam('videoReplyCount'); + this.amount = ReduxGetters.getVideoReplyAmount(this.videoId ); + this.videoReplyCount = ReduxGetters.getVideoReplyCount(this.videoId); + this.fetchUrl = DataContract.replies.getReplyListApi(this.videoId); this.initialHeight = height/1.5; this.animatedValue = new Animated.Value(this.initialHeight) ; @@ -67,7 +67,7 @@ class VideoRepliesScreen extends PureComponent { setTimeout(()=> { this.setState({ showBackdrop: true, - videoUploaderVisible: reduxGetters.getVideoProcessingStatus() // find from redux @mayur + videoUploaderVisible: ReduxGetters.getVideoProcessingStatus() // find from redux @mayur }); }, 300) diff --git a/src/constants/DataContract.js b/src/constants/DataContract.js index 85f0565a..4defd7b9 100644 --- a/src/constants/DataContract.js +++ b/src/constants/DataContract.js @@ -51,7 +51,8 @@ export default { }, videoReplyKind: { video: "VIDEO" - } + }, + replyDetailIdKey: 'reply_detail_id' }, common: { @@ -73,6 +74,7 @@ export default { videoKind: { reply : "VIDEO_REPLY" }, + kindKey: "kind" } } diff --git a/src/services/Pricer.js b/src/services/Pricer.js index dfbcfd0d..16aa87ca 100644 --- a/src/services/Pricer.js +++ b/src/services/Pricer.js @@ -106,6 +106,10 @@ class Pricer { } } + getWeiToNumber = ( val ) => { + return val && Math.floor(Number(this.getFromDecimal(val))) || 0; + } ; + getBtFromPepoCornsInWei( pepoCorns , step , pepoInWeiPerStep){ if(!pepoCorns || !step || !pepoInWeiPerStep ) return "0"; let pepoInEthPerStep = this.getFromDecimal(pepoInWeiPerStep); //Normalize to ETH diff --git a/src/services/Utilities.js b/src/services/Utilities.js index 6c8335fc..768f62bc 100644 --- a/src/services/Utilities.js +++ b/src/services/Utilities.js @@ -14,6 +14,7 @@ import { allowAcessModalEventEmitter } from '../components/AllowAccessModalScree import AppConfig from '../constants/AppConfig'; import PepoApi from './PepoApi'; import DataContract from '../constants/DataContract'; +import ReduxGetters from './ReduxGetters'; let CurrentUser; import('../models/CurrentUser').then((imports) => { @@ -213,6 +214,15 @@ export default { return pepocornsName.substring(0, length - 1); } return pepocornsName; + }, + + getVideoReplyKind( item ) { + const kind = deepGet( item , DataContract.videos.kindKey); + if( kind == DataContract.videos.videoKind.reply){ + const reply_detail_id = deepGet(item,`payload.${DataContract.replies.replyDetailIdKey}`); + const replyKind = ReduxGetters.getVideoReplyKind(reply_detail_id); + return replyKind; + } } }; From d93528a1caa9bee11aeb488a796f510202922f0e Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Thu, 14 Nov 2019 13:10:49 +0530 Subject: [PATCH 056/302] temp --- src/actions/index.js | 1 + .../CommonComponents/ReplyIcon/index.js | 6 +- .../CommonComponents/ReplyVideo/index.js | 6 +- .../VideoReplySupporterStat.js | 2 +- .../VideoThumbnail/ReplyThumbnail.js | 4 +- .../VideoReplyRow.js | 7 +- .../FullScreeVideoRow.js | 2 +- src/components/Home/HomeFeedRow.js | 2 +- src/components/PepoTransactionButton/Base.js | 47 +++--------- .../PepoTransactionButton/PepoTxBtn.js | 72 ++++++++++++++++--- .../PepoTransactionButton/ReplyPepoTxBtn.js | 65 ++++++++--------- src/components/ReplyCollection/index.js | 4 +- .../UserVideoHistory/UserVideoHistoryRow.js | 2 +- src/services/ReduxGetters.js | 42 +++++++---- 14 files changed, 151 insertions(+), 111 deletions(-) diff --git a/src/actions/index.js b/src/actions/index.js index e5fff24a..d30cdf0c 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -107,6 +107,7 @@ export const upsertVideoStatEntities = (data) => ({ payload: { video_stat_entities: data } }); +//@Preshita Dont put this in redux export const upsertVideoReplyEntities = (data) => ({ type: types.UPSERT_VIDEO_REPLY_ENTITIES, payload: { video_reply_entities: data } diff --git a/src/components/CommonComponents/ReplyIcon/index.js b/src/components/CommonComponents/ReplyIcon/index.js index af09d1db..b264fdb5 100644 --- a/src/components/CommonComponents/ReplyIcon/index.js +++ b/src/components/CommonComponents/ReplyIcon/index.js @@ -20,9 +20,9 @@ const mapStateToProps = (state , ownProps) => { isVideoUserActivated : Utilities.isUserActivated(reduxGetter.getUserActivationStatus(ownProps.userId)), isCurrentUserActivated : CurrentUser.isUserActivated(), balance : state.balance, - requiredPepo : reduxGetter.getVideoReplyAmount(ownProps.videoId, state), - videoReplyCount : reduxGetter.getVideoReplyCount(ownProps.videoId, state), - isReplyAllowed : reduxGetter.getVideoReplyAllowed(ownProps.videoId, state), + requiredPepo : reduxGetter.getReplyAmount(ownProps.videoId, state), + videoReplyCount : reduxGetter.getReplyCount(ownProps.videoId, state), + isReplyAllowed : reduxGetter.getReplyAllowed(ownProps.videoId, state), userName : reduxGetter.getUserName(ownProps.userId) } }; diff --git a/src/components/CommonComponents/ReplyVideo/index.js b/src/components/CommonComponents/ReplyVideo/index.js index bd8e3cfb..dfdc3431 100644 --- a/src/components/CommonComponents/ReplyVideo/index.js +++ b/src/components/CommonComponents/ReplyVideo/index.js @@ -19,9 +19,9 @@ const mapStateToProps = (state , ownProps) => { isVideoUserActivated : Utilities.isUserActivated(reduxGetter.getUserActivationStatus(ownProps.userId)), isCurrentUserActivated : CurrentUser.isUserActivated(), balance : state.balance, - requiredPepo : reduxGetter.getVideoReplyAmount(ownProps.videoId, state), - videoReplyCount : reduxGetter.getVideoReplyCount(ownProps.videoId, state), - isReplyAllowed : reduxGetter.getVideoReplyAllowed(ownProps.videoId, state) + requiredPepo : reduxGetter.getReplyAmount(ownProps.videoId, state), + videoReplyCount : reduxGetter.getReplyCount(ownProps.videoId, state), + isReplyAllowed : reduxGetter.getReplyAllowed(ownProps.videoId, state) } }; diff --git a/src/components/CommonComponents/VideoSupporterStat/VideoReplySupporterStat.js b/src/components/CommonComponents/VideoSupporterStat/VideoReplySupporterStat.js index be818ca9..134355c7 100644 --- a/src/components/CommonComponents/VideoSupporterStat/VideoReplySupporterStat.js +++ b/src/components/CommonComponents/VideoSupporterStat/VideoReplySupporterStat.js @@ -7,7 +7,7 @@ import Base from './Base'; const mapStateToProps = (state, ownProps) => { return { supporters: reduxGetter.getUserSupporters(ownProps.userId, state), - totalBt: reduxGetter.getVideoReplyBt(ownProps.videoId, state) + totalBt: reduxGetter.getReplyBt(ownProps.videoId, state) }; }; diff --git a/src/components/CommonComponents/VideoThumbnail/ReplyThumbnail.js b/src/components/CommonComponents/VideoThumbnail/ReplyThumbnail.js index 3b5a1430..c935c2a9 100644 --- a/src/components/CommonComponents/VideoThumbnail/ReplyThumbnail.js +++ b/src/components/CommonComponents/VideoThumbnail/ReplyThumbnail.js @@ -12,10 +12,10 @@ class ReplyThumbnail extends PureComponent { render(){ const replyId = deepGet(this.props , "payload.reply_detail_id"), userId = deepGet(this.props , "payload.user_id") , - videoId = reduxGetters.getVideoReplyId( replyId ), + videoId = reduxGetters.getReplyEntityId( replyId ), userName = reduxGetters.getUserName(userId), imageUrl = reduxGetters.getVideoImgUrl(videoId, null, AppConfig.userVideos.userScreenCoverImageWidth) , - videoDesc = reduxGetters.getVideoDescription(reduxGetters.getVideoReplyDescriptionId(videoId)) + videoDesc = reduxGetters.getVideoDescription(reduxGetters.getReplyDescriptionId(videoId)) ; return ; } diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index 4570da16..071f715e 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -9,11 +9,12 @@ import deepGet from 'lodash/get'; import inlineStyles from './styles'; -import PepoTxBtn from '../PepoTransactionButton/PepoTxBtn'; +import ReplyPepoTxBtn from '../PepoTransactionButton/ReplyPepoTxBtn'; import VideoReplySupporterStat from '../CommonComponents/VideoSupporterStat/VideoReplySupporterStat'; import VideoBottomStatus from '../BottomStatus /VideoBottomStatus'; + class VideoReplyRow extends PureComponent { constructor(props) { super(props); @@ -46,10 +47,10 @@ class VideoReplyRow extends PureComponent { - diff --git a/src/components/FullScreenVideoCollection/FullScreeVideoRow.js b/src/components/FullScreenVideoCollection/FullScreeVideoRow.js index 69d4ca89..184d6714 100644 --- a/src/components/FullScreenVideoCollection/FullScreeVideoRow.js +++ b/src/components/FullScreenVideoCollection/FullScreeVideoRow.js @@ -48,7 +48,7 @@ class FullScreeVideoRow extends PureComponent { diff --git a/src/components/Home/HomeFeedRow.js b/src/components/Home/HomeFeedRow.js index c31ac02a..6d1d6cb2 100644 --- a/src/components/Home/HomeFeedRow.js +++ b/src/components/Home/HomeFeedRow.js @@ -64,7 +64,7 @@ class HomeFeedRow extends PureComponent { - + diff --git a/src/components/PepoTransactionButton/Base.js b/src/components/PepoTransactionButton/Base.js index ebddc05d..878349fe 100644 --- a/src/components/PepoTransactionButton/Base.js +++ b/src/components/PepoTransactionButton/Base.js @@ -3,9 +3,6 @@ import { TouchableWithoutFeedback, View } from 'react-native'; import { OstWalletSdk } from '@ostdotcom/ost-wallet-sdk-react-native'; import Toast from '../../theme/components/NotificationToast'; import deepGet from 'lodash/get'; -import clone from 'lodash/clone'; - -import { withNavigation } from 'react-navigation'; import CurrentUser from '../../models/CurrentUser'; import PepoButton from './PepoButton'; @@ -13,7 +10,7 @@ import appConfig from '../../constants/AppConfig'; import PepoApi from '../../services/PepoApi'; import pricer from '../../services/Pricer'; import Store from '../../store'; -import { updateExecuteTransactionStatus, updateBalance, upsertVideoStatEntities } from '../../actions'; +import { updateExecuteTransactionStatus, updateBalance } from '../../actions'; import ExecuteTransactionWorkflow from '../../services/OstWalletCallbacks/ExecuteTransactionWorkFlow'; import reduxGetter from '../../services/ReduxGetters'; import { ostErrors } from '../../services/OstErrors'; @@ -33,7 +30,7 @@ class Base extends PureComponent { isDisabled = () => { return ( - this.props.userId == CurrentUser.getUserId() || !this.isBalance() || !this.props.isCurrentUserActivated || this.props.disabled || !this.props.isVideoUserActivated + this.props.userId == CurrentUser.getUserId() || !this.isBalance() || !this.props.isCurrentUserActivated || this.props.disabled || !this.props.isEntityUserActivated ); }; @@ -110,12 +107,7 @@ class Base extends PureComponent { } getSdkMetaProperties() { - const metaProperties = clone(appConfig.metaProperties); - if (this.props.videoId) { - metaProperties['name'] = 'video'; - metaProperties['details'] = `vi_${this.props.videoId}`; - } - return metaProperties; + throw "Overwrite"; } onRequestAcknowledge(ostWorkflowContext, ostWorkflowEntity) { @@ -124,16 +116,7 @@ class Base extends PureComponent { } getDropPixel(){ - return { - e_entity: 'video', - e_action: 'contribution', - e_data_json: { - video_id: this.props.videoId, - profile_user_id: this.props.userId, - amount: this.btAmount - }, - p_type: 'feed' - } + throw "Overwrite"; } dropPixel() { @@ -190,21 +173,11 @@ class Base extends PureComponent { Store.dispatch(updateBalance(balance)); } - let videoStats = reduxGetter.getVideoStats(this.props.videoId), - updateVideoStats = false; - if (totalBt && totalBt > 0) { - videoStats['total_amount_raised_in_wei'] = Pricer.getToDecimal(totalBt); - updateVideoStats = true; - } - - if (supporters && !this.props.isSupporting) { - videoStats['total_contributed_by'] = supporters; - updateVideoStats = true; - } + this.reduxEntityUpdate( totalBt, supporters ); + } - if (updateVideoStats) { - Store.dispatch(upsertVideoStatEntities(utilities._getEntityFromObj(videoStats))); - } + reduxEntityUpdate( totalBt, supporters ){ + throw "OverWrite"; } onPressOut = (btAmount, totalBt) => { @@ -256,7 +229,7 @@ class Base extends PureComponent { ({ balance: state.balance, disabled: state.executeTransactionDisabledStatus, - isVideoUserActivated: utilities.isUserActivated(reduxGetter.getUserActivationStatus(ownProps.userId)), - supporters: reduxGetter.getVideoSupporters(ownProps.videoId), - isSupporting: reduxGetter.isVideoSupported(ownProps.videoId), - totalBt: reduxGetter.getVideoBt(ownProps.videoId, state), + isEntityUserActivated: utilities.isUserActivated(reduxGetter.getUserActivationStatus(ownProps.userId)), + supporters: reduxGetter.getVideoSupporters(ownProps.entityId), + isSupporting: reduxGetter.isVideoSupported(ownProps.entityId), + totalBt: reduxGetter.getVideoBt(ownProps.entityId, state), isCurrentUserActivated: CurrentUser.isUserActivated() }); - const PepoTxBtn = connect(mapStateToProps)(Base); - export default PepoTxBtn; \ No newline at end of file + class PepoTxBtn extends Base { + + constructor(props){ + super(props); + } + + getSdkMetaProperties() { + const metaProperties = clone(appConfig.metaProperties); + metaProperties['name'] = 'video'; + metaProperties['details'] = `vi_${this.props.entityId}`; + return metaProperties; + } + + getDropPixel(){ + //TODO confrim with @JUNISHA @Ashutosh + return { + e_entity: 'video', + e_action: 'contribution', + e_data_json: { + video_id: this.props.entityId, + profile_user_id: this.props.userId, + amount: this.btAmount + }, + p_type: 'feed' + } + } + + reduxEntityUpdate( totalBt, supporters ){ + let videoStats = reduxGetter.getVideoStats(this.props.entityId), + updateVideoStats = false; + if (totalBt && totalBt > 0) { + videoStats['total_amount_raised_in_wei'] = Pricer.getToDecimal(totalBt); + updateVideoStats = true; + } + + if (supporters && !this.props.isSupporting) { + videoStats['total_contributed_by'] = supporters; + updateVideoStats = true; + } + + if (updateVideoStats) { + Store.dispatch(upsertVideoStatEntities(utilities._getEntityFromObj(videoStats))); + } + } + + } + + export default connect(mapStateToProps)(withNavigation(PepoTxBtn)); \ No newline at end of file diff --git a/src/components/PepoTransactionButton/ReplyPepoTxBtn.js b/src/components/PepoTransactionButton/ReplyPepoTxBtn.js index 4a242173..1eaebc03 100644 --- a/src/components/PepoTransactionButton/ReplyPepoTxBtn.js +++ b/src/components/PepoTransactionButton/ReplyPepoTxBtn.js @@ -1,20 +1,24 @@ -import { updateExecuteTransactionStatus, updateBalance, upsertVideoStatEntities } from '../../actions'; -import reduxGetter from "../../services/ReduxGetters"; -import CurrentUser from "../../models/CurrentUser"; -import utilities from "../../services/Utilities"; import { connect } from 'react-redux'; +import clone from 'lodash/clone'; +import CurrentUser from '../../models/CurrentUser'; +import appConfig from '../../constants/AppConfig'; import Store from '../../store'; +import { upsertVideoReplyStatEntities } from '../../actions'; +import reduxGetter from '../../services/ReduxGetters'; +import Pricer from '../../services/Pricer'; +import utilities from '../../services/Utilities'; +import { withNavigation } from 'react-navigation'; + import Base from "./Base"; const mapStateToProps = (state, ownProps) => ({ balance: state.balance, disabled: state.executeTransactionDisabledStatus, - isVideoUserActivated: utilities.isUserActivated(reduxGetter.getUserActivationStatus(ownProps.userId)), + isEntityUserActivated: utilities.isUserActivated(reduxGetter.getUserActivationStatus(ownProps.userId)), isCurrentUserActivated: CurrentUser.isUserActivated() , - supporters: "", //TODO - isSupporting:"", //TODO - totalBt: "", //TODO - videoId : "", //TODO + supporters: reduxGetter.getReplySupporters(ownProps.entityId), + isSupporting: reduxGetter.isReplySupported(ownProps.entityId) , + totalBt: reduxGetter.getReplyBt(ownProps.entityId), }); class ReplyPepoTxBtn extends Base { @@ -25,20 +29,18 @@ class ReplyPepoTxBtn extends Base { getSdkMetaProperties() { const metaProperties = clone(appConfig.metaProperties); - if (this.props.videoId) { - metaProperties['name'] = 'pepo_on_reply'; - metaProperties['details'] = `rdi_${this.props.replyId}`; - } + metaProperties['name'] = 'pepo_on_reply'; + metaProperties['details'] = `rdi_${this.props.entityId}`; return metaProperties; } getDropPixel(){ - //TODO + //TODO confrim with @JUNISHA return { e_entity: 'video', e_action: 'contribution', e_data_json: { - video_id: this.props.videoId, + reply_id: this.props.entityId, profile_user_id: this.props.userId, amount: this.btAmount }, @@ -46,34 +48,25 @@ class ReplyPepoTxBtn extends Base { } } - reduxUpdate(isTXBtnDisabled, balance, totalBt, supporters) { - //TODO - if (isTXBtnDisabled !== undefined) { - Store.dispatch(updateExecuteTransactionStatus(isTXBtnDisabled)); - } - - if (balance) { - balance = pricer.getToDecimal(balance); - Store.dispatch(updateBalance(balance)); - } - - let videoStats = reduxGetter.getVideoStats(this.props.videoId), - updateVideoStats = false; + reduxEntityUpdate( totalBt, supporters ){ + let replyDetails = reduxGetter.getReplyEntity(this.props.entityId), + updateEntity = false + ; if (totalBt && totalBt > 0) { videoStats['total_amount_raised_in_wei'] = Pricer.getToDecimal(totalBt); - updateVideoStats = true; + updateEntity = true; } - + if (supporters && !this.props.isSupporting) { - videoStats['total_contributed_by'] = supporters; - updateVideoStats = true; + replyDetails['total_contributed_by'] = supporters; + updateEntity = true; } - - if (updateVideoStats) { - Store.dispatch(upsertVideoStatEntities(utilities._getEntityFromObj(videoStats))); + + if (updateEntity) { + Store.dispatch(upsertVideoReplyStatEntities(utilities._getEntityFromObj(replyDetails))); } } } -export default connect(mapStateToProps)(ReplyPepoTxBtn); \ No newline at end of file +export default connect(mapStateToProps)( withNavigation( ReplyPepoTxBtn )); \ No newline at end of file diff --git a/src/components/ReplyCollection/index.js b/src/components/ReplyCollection/index.js index 1ebe7ea7..c1d4a2dc 100644 --- a/src/components/ReplyCollection/index.js +++ b/src/components/ReplyCollection/index.js @@ -169,8 +169,8 @@ class VideoReplyList extends PureComponent { if( kind == DataContract.videos.videoKind.reply){ const userId = deepGet(item, "payload.user_id"); const reply_detail_id = deepGet(item,'payload.reply_detail_id'); - const videoId = ReduxGetters.getVideoReplyId(reply_detail_id); - const replyKind = ReduxGetters.getVideoReplyKind(reply_detail_id); + const videoId = ReduxGetters.getReplyEntityId(reply_detail_id); + const replyKind = ReduxGetters.getReplyKind(reply_detail_id); if(replyKind == DataContract.replies.videoReplyKind.video) { return ( {this.isCurrentUser( userId ) && diff --git a/src/services/ReduxGetters.js b/src/services/ReduxGetters.js index 2a64c59e..c311f59d 100644 --- a/src/services/ReduxGetters.js +++ b/src/services/ReduxGetters.js @@ -113,11 +113,6 @@ class ReduxGetters { return deepGet(state, `video_stat_entities.id_${id}.total_amount_raised_in_wei`); } - getVideoReplyBt(id, state) { - state = state || Store.getState(); - return deepGet(state, `video_reply_stat_entities.id_${id}.total_amount_raised_in_wei`); - } - getVideoStats(id, state) { state = state || Store.getState(); return deepGet(state, `video_stat_entities.id_${id}`); @@ -432,41 +427,64 @@ class ReduxGetters { return deepGet(state, `tag_entities.id_${id}`); } - getVideoReplyCount(id, state){ + + getReplyEntity(id, state) { + state = state || Store.getState(); + return deepGet(state, `video_reply_stat_entities.id_${id}`); + } + + getReplyBt(id, state) { + state = state || Store.getState(); + return deepGet(state, `video_reply_stat_entities.id_${id}.total_amount_raised_in_wei`); + } + + getReplyCount(id, state){ state = state || Store.getState(); return deepGet(state, `video_reply_stat_entities.id_${id}.total_replies`, 0); } - getVideoReplyAmount(id, state){ + getReplyAmount(id, state){ state = state || Store.getState(); return deepGet(state, `video_reply_stat_entities.id_${id}.per_reply_amount_in_wei`, 0); } - getVideoReplyAllowed(id, state){ + getReplyAllowed(id, state){ state = state || Store.getState(); return deepGet(state, `video_reply_stat_entities.id_${id}.is_reply_allowed`, true); } - getVideoReplyKind(id, state){ + getReplyKind(id, state){ state = state || Store.getState(); return deepGet(state, `video_reply_stat_entities.id_${id}.entity_kind`); } - getVideoReplyId(id, state){ + getReplyEntityId(id, state){ state = state || Store.getState(); return deepGet(state, `video_reply_stat_entities.id_${id}.entity_id`); } - getVideoReplyDescriptionId(id, state) { + getReplyDescriptionId(id, state) { state = state || Store.getState(); return deepGet(state, `video_reply_stat_entities.id_${id}.description_id`); } - getVideoReplyBt(id, state) { + getReplyBt(id, state) { state = state || Store.getState(); return deepGet(state, `video_reply_stat_entities.id_${id}.total_amount_raised_in_wei`); } + getReplySupporters(){ + state = state || Store.getState(); + return deepGet(state, `video_reply_stat_entities.id_${id}.total_contributed_by`); + } + + isReplySupported(id, state) { + state = state || Store.getState(); + let val = deepGet(state, `video_reply_stat_entities.id_${id}`); + val = val && Number(val); + return !!val; + } + } export default new ReduxGetters(); From b76c024436b7ee1c5969fc7cbcd7fd274418b08d Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Thu, 14 Nov 2019 13:43:21 +0530 Subject: [PATCH 057/302] fix --- src/components/FullScreenReplyCollection/VideoReplyRow.js | 2 +- src/components/VideoReplies/index.js | 4 ++-- src/services/Utilities.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index 37d1d134..ef3e53dc 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -22,7 +22,7 @@ class VideoReplyRow extends PureComponent { super(props); this.userId = deepGet(this.props.item, 'payload.user_id'); this.replyId = deepGet(this.props.item,`payload.${DataContract.replies.replyDetailIdKey}`); - this.videoId = ReduxGetters.getVideoReplyId(this.replyId); + this.videoId = ReduxGetters.getReplyEntityId(this.replyId); } refetchVideoReply = () => { diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index 3423ea6f..ca064d4e 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -44,8 +44,8 @@ class VideoRepliesScreen extends PureComponent { super(props); this.userId = props.navigation.getParam('userId'); this.videoId = props.navigation.getParam('videoId'); - this.amount = ReduxGetters.getVideoReplyAmount(this.videoId ); - this.videoReplyCount = ReduxGetters.getVideoReplyCount(this.videoId); + this.amount = ReduxGetters.getReplyAmount(this.videoId ); + this.videoReplyCount = ReduxGetters.getReplyCount(this.videoId); this.fetchUrl = DataContract.replies.getReplyListApi(this.videoId); this.initialHeight = height/1.5; diff --git a/src/services/Utilities.js b/src/services/Utilities.js index 768f62bc..c200bb3c 100644 --- a/src/services/Utilities.js +++ b/src/services/Utilities.js @@ -220,7 +220,7 @@ export default { const kind = deepGet( item , DataContract.videos.kindKey); if( kind == DataContract.videos.videoKind.reply){ const reply_detail_id = deepGet(item,`payload.${DataContract.replies.replyDetailIdKey}`); - const replyKind = ReduxGetters.getVideoReplyKind(reply_detail_id); + const replyKind = ReduxGetters.getReplyKind(reply_detail_id); return replyKind; } } From 760f94fe153d87504c6dce7e6136afe1ea15af73 Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Thu, 14 Nov 2019 13:46:37 +0530 Subject: [PATCH 058/302] Minor fix --- src/services/ReduxGetters.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/ReduxGetters.js b/src/services/ReduxGetters.js index 9c012920..35e35136 100644 --- a/src/services/ReduxGetters.js +++ b/src/services/ReduxGetters.js @@ -480,7 +480,7 @@ class ReduxGetters { return deepGet(state, `video_reply_stat_entities.id_${id}.total_amount_raised_in_wei`); } - getReplySupporters(){ + getReplySupporters(id , state){ state = state || Store.getState(); return deepGet(state, `video_reply_stat_entities.id_${id}.total_contributed_by`); } From 5728c4c42208db830654149c7b11c02eabbb1a5a Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Thu, 14 Nov 2019 13:58:00 +0530 Subject: [PATCH 059/302] Merge branch 'team/video-replies' of https://github.com/ostdotcom/pepo-react into team/video-replies --- .../FullScreenReplyCollection/index.js | 11 ++--- ...ScreeVideoRow.js => FullScreenVideoRow.js} | 0 .../FullScreenVideoCollection/index.js | 38 ++++++++++++---- src/components/ReplyCollection/index.js | 14 +++--- src/components/VideoCollections/index.js | 43 ++++++++++++++++--- src/constants/DataContract.js | 3 +- src/helpers/EntityHelper.js | 35 +++++++++++++++ src/services/Utilities.js | 9 ---- 8 files changed, 117 insertions(+), 36 deletions(-) rename src/components/FullScreenVideoCollection/{FullScreeVideoRow.js => FullScreenVideoRow.js} (100%) create mode 100644 src/helpers/EntityHelper.js diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index f445fcbe..ed6640aa 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -11,8 +11,7 @@ import NavigationService from "../../services/NavigationService"; import utilities from '../../services/Utilities'; import crossIcon from '../../assets/cross_icon.png'; import ReduxGetters from "../../services/ReduxGetters"; -import Utilities from "../../services/Utilities"; -import DataContract from "../../constants/DataContract"; +import entityHelper from "../../helpers/EntityHelper"; @@ -190,9 +189,11 @@ class FullScreenReplyCollection extends PureComponent{ } _renderItem = ({ item, index }) => { - if(Utilities.getVideoReplyKind( item ) == DataContract.replies.videoReplyKind.video){ - return this._renderVideoReplyRow( item, index ); - } + if(entityHelper.isVideoReplyEntity( item )){ + if(entityHelper.isReplyVideoTypeEntity(item)){ + return this._renderVideoReplyRow( item, index ); + } + } }; _renderVideoReplyRow(item, index){ diff --git a/src/components/FullScreenVideoCollection/FullScreeVideoRow.js b/src/components/FullScreenVideoCollection/FullScreenVideoRow.js similarity index 100% rename from src/components/FullScreenVideoCollection/FullScreeVideoRow.js rename to src/components/FullScreenVideoCollection/FullScreenVideoRow.js diff --git a/src/components/FullScreenVideoCollection/index.js b/src/components/FullScreenVideoCollection/index.js index 67e5ffdd..af90a3f4 100644 --- a/src/components/FullScreenVideoCollection/index.js +++ b/src/components/FullScreenVideoCollection/index.js @@ -3,11 +3,12 @@ import {FlatList , View , TouchableOpacity, Image} from "react-native"; import deepGet from "lodash/get"; import reduxGetters from "../../services/ReduxGetters"; import Pagination from "../../services/Pagination"; -import FullScreeVideoRow from "./FullScreeVideoRow"; +import FullScreenVideoRow from "./FullScreenVideoRow"; import inlineStyles from "./styles"; import historyBack from '../../assets/user-video-history-back-icon.png'; import TopStatus from "../Home/TopStatus"; import CommonStyle from "../../theme/styles/Common"; +import entityHelper from '../../helpers/EntityHelper'; const maxVideosThreshold = 3; @@ -30,7 +31,7 @@ class FullScreenVideoCollection extends PureComponent{ this.flatlistRef = null; this.state = { - list : this.getVideoPagination().getList(), + list : this.getVideoPagination().getResults(), activeIndex: this.currentIndex, refreshing : false, loadingNext: false @@ -94,7 +95,7 @@ class FullScreenVideoCollection extends PureComponent{ } onRefresh = ( res ) => { - this.setState({ refreshing : false , list : this.getVideoPagination().getList() }); + this.setState({ refreshing : false , list : this.getVideoPagination().getResults() }); } onRefreshError = ( error ) => { @@ -107,7 +108,7 @@ class FullScreenVideoCollection extends PureComponent{ } onNext = ( res ) => { - this.setState({ loadingNext : false , list : this.getVideoPagination().getList() }); + this.setState({ loadingNext : false , list : this.getVideoPagination().getResults() }); } onNextError = ( error ) => { @@ -131,13 +132,32 @@ class FullScreenVideoCollection extends PureComponent{ _renderItem = ({ item, index }) => { const payload = reduxGetters.getTagsVideoPayload(item); console.log("payload", payload); - return ; + if(entityHelper.isVideoReplyEntity( item )){ + if(entityHelper.isReplyVideoTypeEntity(item)){ + return this._renderVideoReplyRow( item, index ); + } + } else if( entityHelper.isVideoEntity( item )) { + return this._renderVideoRow( item, index); + } + }; + _renderVideoReplyRow(item, index){ + return ; + } + + _renderVideoRow( item, index ){ + return ; + } + onViewableItemsChanged = (data) => { this.currentIndex = deepGet(data, 'viewableItems[0].index') || 0; } diff --git a/src/components/ReplyCollection/index.js b/src/components/ReplyCollection/index.js index 65ca0466..2c1ba6e8 100644 --- a/src/components/ReplyCollection/index.js +++ b/src/components/ReplyCollection/index.js @@ -18,10 +18,10 @@ import { VideoReplyEmitter } from '../../helpers/Emitters'; import PepoApi from '../../services/PepoApi'; import ReplyThumbnail from '../CommonComponents/VideoThumbnail/ReplyThumbnail'; import ReduxGetters from '../../services/ReduxGetters'; -import Utilities from '../../services/Utilities'; +import entityHelper from '../../helpers/EntityHelper'; -class VideoReplyList extends PureComponent { +class ReplyCollection extends PureComponent { constructor(props){ super(props); @@ -170,9 +170,11 @@ class VideoReplyList extends PureComponent { }; renderThumbnailItem ( item , index ){ - if(Utilities.getVideoReplyKind( item ) == DataContract.replies.videoReplyKind.video){ - return this._renderVideoReplyThumbnail( item, index ); - } + if(entityHelper.isVideoReplyEntity( item )){ + if(entityHelper.isReplyVideoTypeEntity(item)){ + return this._renderVideoReplyThumbnail( item, index ); + } + } } _renderVideoReplyThumbnail( item, index ) { @@ -261,4 +263,4 @@ class VideoReplyList extends PureComponent { } -export default withNavigation( VideoReplyList ); +export default withNavigation( ReplyCollection ); diff --git a/src/components/VideoCollections/index.js b/src/components/VideoCollections/index.js index bd5a6ca5..e888c9a6 100644 --- a/src/components/VideoCollections/index.js +++ b/src/components/VideoCollections/index.js @@ -5,6 +5,7 @@ import Pagination from "../../services/Pagination"; import CommonStyle from "../../theme/styles/Common"; import VideoThumbnail from '../CommonComponents/VideoThumbnail/VideoThumbnail'; +import entityHelper from '../../helpers/EntityHelper'; class VideoCollections extends PureComponent { constructor(props){ @@ -151,14 +152,44 @@ class VideoCollections extends PureComponent { }; _renderVideoCell = ({ item, index }) => { - return ( {this.onVideoClick(item.payload, index)}} - isEmpty={item.isEmpty} - emptyRenderFunction={this.props.getNoResultsCell}/>); + if(entityHelper.isVideoReplyEntity( item )){ + if(entityHelper.isReplyVideoTypeEntity(item)){ + return this._renderVideoReplyThumbnail( item, index ); + } + } else if( entityHelper.isVideoEntity( item )) { + return this._renderVideoThumbnail( item, index); + } }; + _renderVideoReplyThumbnail( item, index ) { + const userId = deepGet(item, "payload.user_id"); + const reply_detail_id = deepGet(item,`payload.${DataContract.replies.replyDetailIdKey}`); + const videoId = ReduxGetters.getReplyId(reply_detail_id); + return ( + {this.isCurrentUser( userId ) && + + {this.removeVideo(videoId , index )}} /> + + } + {this.onVideoClick(index)}}/> + ); + } + + _renderVideoThumbnail( item, index){ + return ( {this.onVideoClick(item.payload, index)}} + isEmpty={item.isEmpty} + emptyRenderFunction={this.props.getNoResultsCell}/>); + } + onVideoClick = (payload, index) => { const clonedInstance = this.videoPagination.fetchServices.cloneInstance(); diff --git a/src/constants/DataContract.js b/src/constants/DataContract.js index 4defd7b9..e148681c 100644 --- a/src/constants/DataContract.js +++ b/src/constants/DataContract.js @@ -72,7 +72,8 @@ export default { return `/videos/${id}/delete`; }, videoKind: { - reply : "VIDEO_REPLY" + reply : "VIDEO_REPLY", + video:"FAN_UPDATE" }, kindKey: "kind" } diff --git a/src/helpers/EntityHelper.js b/src/helpers/EntityHelper.js new file mode 100644 index 00000000..b8ff4ca8 --- /dev/null +++ b/src/helpers/EntityHelper.js @@ -0,0 +1,35 @@ +import deepGet from 'lodash/get'; +import DataContract from '../constants/DataContract'; +import ReduxGetters from '../services/ReduxGetters'; + +class EntityHelper { + + getEntityType( entity ){ + const type = deepGet(entity,`${DataContract.videos.kindKey}`); + return type; + } + + getReplyKind( entity ){ + const replyDetailId = deepGet(entity,`payload.${DataContract.replies.replyDetailIdKey}`); + const replyKind = ReduxGetters.getReplyKind(replyDetailId); + return replyKind; + } + + isVideoEntity( entity ){ + const type = this.getEntityType(entity); + return type == DataContract.videos.videoKind.video; + } + + isVideoReplyEntity( entity ){ + const type = this.getEntityType(entity); + return type == DataContract.videos.videoKind.reply; + } + + isReplyVideoTypeEntity( entity ){ + const replyKind = this.getReplyKind( entity ); + return replyKind == DataContract.replies.videoReplyKind.video; + } + +} + +export default new EntityHelper(); \ No newline at end of file diff --git a/src/services/Utilities.js b/src/services/Utilities.js index c200bb3c..5a712dc4 100644 --- a/src/services/Utilities.js +++ b/src/services/Utilities.js @@ -214,15 +214,6 @@ export default { return pepocornsName.substring(0, length - 1); } return pepocornsName; - }, - - getVideoReplyKind( item ) { - const kind = deepGet( item , DataContract.videos.kindKey); - if( kind == DataContract.videos.videoKind.reply){ - const reply_detail_id = deepGet(item,`payload.${DataContract.replies.replyDetailIdKey}`); - const replyKind = ReduxGetters.getReplyKind(reply_detail_id); - return replyKind; - } } }; From 677f9db94da789e758c70b003922e488b1dd5385 Mon Sep 17 00:00:00 2001 From: Shraddha Date: Thu, 14 Nov 2019 13:59:08 +0530 Subject: [PATCH 060/302] safearea view fix --- src/components/VideoReplies/index.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index ca064d4e..84badb7d 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -5,8 +5,10 @@ import { Image, TouchableOpacity, Dimensions, - Animated -} from "react-native"; + Animated, Platform , + StatusBar +} from 'react-native'; + import { ifIphoneX } from 'react-native-iphone-x-helper'; import plusIcon from '../../assets/user-video-capture-icon-selected.png'; @@ -162,7 +164,7 @@ class VideoRepliesScreen extends PureComponent { }} ref={c => (this._panel = c)} draggableRange={{ - top: height - finalPadding, //TODO check is top expand + top: height - topPadding, //TODO check is top expand bottom: 0 }} showBackdrop={this.state.showBackdrop} @@ -194,7 +196,8 @@ class VideoRepliesScreen extends PureComponent { onData={this.onData} videoReplyCount={this.videoReplyCount} amount={this.amount} - listBottomPadding={this.state.currentHeight > this.initialHeight? 0 : listBottomPadding} + listBottomPadding={this.state.currentHeight > this.initialHeight? topPadding+bottomPadding : listBottomPadding} + /> From 43a73422814e7c642d3ee840235b607765174774 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Thu, 14 Nov 2019 14:26:10 +0530 Subject: [PATCH 061/302] Entity Binding --- src/components/BottomStatus /Base.js | 12 +++++------- .../BottomStatus /ReplyVideoBottomStatus.js | 15 +++++++++------ .../BottomStatus /VideoBottomStatus.js | 15 +++++++++------ .../CommonComponents/VideoSupporterStat/Base.js | 17 ++--------------- .../VideoReplySupporterStat.js | 10 +++------- .../VideoSupporterStat/VideoSupporterStat.js | 12 +++--------- .../FullScreenReplyCollection/VideoReplyRow.js | 11 +++++------ .../FullScreenVideoRow.js | 4 ++-- src/components/Home/HomeFeedRow.js | 4 ++-- src/components/PepoTransactionButton/Base.js | 1 + .../UserVideoHistory/UserVideoHistoryRow.js | 4 ++-- src/services/ReduxGetters.js | 5 +++++ 12 files changed, 48 insertions(+), 62 deletions(-) diff --git a/src/components/BottomStatus /Base.js b/src/components/BottomStatus /Base.js index c789cbd7..22d8f2db 100644 --- a/src/components/BottomStatus /Base.js +++ b/src/components/BottomStatus /Base.js @@ -1,6 +1,5 @@ import React, { PureComponent } from 'react'; import { View, Text } from 'react-native'; -import { withNavigation } from 'react-navigation'; import inlineStyles from './styles'; import { TouchableWithoutFeedback } from 'react-native-gesture-handler'; @@ -14,7 +13,6 @@ import CurrentUser from '../../models/CurrentUser'; class BottomStatus extends PureComponent { constructor(props) { super(props); - this.videoDescriptionId = reduxGetter.getVideoDescriptionId(this.props.videoId); } onLinkClick = () => { @@ -22,12 +20,12 @@ class BottomStatus extends PureComponent { }; onTagPressed = (tag) => { - let entity = reduxGetter.getTappedIncludesEntity(this.videoDescriptionId, tag); + let entity = reduxGetter.getTappedIncludesEntity(this.props.entityDescriptionId, tag); this.onDescriptionClick(entity, tag); }; - isValidTag(videoId, tappedText) { - let entity = reduxGetter.getTappedIncludesEntity(videoId, tappedText); + isValidTag(descriptionId, tappedText) { + let entity = reduxGetter.getTappedIncludesEntity(descriptionId, tappedText); return !!entity } @@ -71,7 +69,7 @@ class BottomStatus extends PureComponent { numberOfLines={3} > {this.props.description.split(' ').map((item) => { - if (item.startsWith('#') && this.isValidTag(this.videoDescriptionId, item)) { + if (item.startsWith('#') && this.isValidTag(this.props.entityDescriptionId, item)) { let tagText = item.replace("#", ""); return( { return { userName: reduxGetter.getUserName(ownProps.userId, state), name: reduxGetter.getName(ownProps.userId, state), - description: reduxGetter.getVideoDescription(reduxGetter.getVideoDescriptionId(ownProps.videoId, state), state), - link: reduxGetter.getVideoLink(reduxGetter.getVideoLinkId(ownProps.videoId, state), state), - supporters: reduxGetter.getVideoSupporters(ownProps.videoId), - totalBt: reduxGetter.getVideoBt(ownProps.videoId, state) + entityDescriptionId : reduxGetter.getReplyDescriptionId(ownProps.entityId), + description: reduxGetter.getVideoDescription(reduxGetter.getReplyDescriptionId(ownProps.entityId, state), state), + link: reduxGetter.getVideoLink(reduxGetter.getVideoLinkId(ownProps.entityId, state), state), + supporters: reduxGetter.getReplySupporters(ownProps.entityId), + totalBt: reduxGetter.getReplyBt(ownProps.entityId, state) }; }; - const ReplyVideoBottomStatus = connect(mapStateToProps)(Base); - export default ReplyVideoBottomStatus; \ No newline at end of file +const ReplyVideoBottomStatus = connect(mapStateToProps)( withNavigation( Base )); + +export default ReplyVideoBottomStatus; \ No newline at end of file diff --git a/src/components/BottomStatus /VideoBottomStatus.js b/src/components/BottomStatus /VideoBottomStatus.js index 7024d288..4bfe8736 100644 --- a/src/components/BottomStatus /VideoBottomStatus.js +++ b/src/components/BottomStatus /VideoBottomStatus.js @@ -1,17 +1,20 @@ import reduxGetter from "../../services/ReduxGetters"; import { connect } from 'react-redux'; import Base from "./Base" +import { withNavigation } from "react-navigation"; const mapStateToProps = (state, ownProps) => { return { userName: reduxGetter.getUserName(ownProps.userId, state), name: reduxGetter.getName(ownProps.userId, state), - description: reduxGetter.getVideoDescription(reduxGetter.getVideoDescriptionId(ownProps.videoId, state), state), - link: reduxGetter.getVideoLink(reduxGetter.getVideoLinkId(ownProps.videoId, state), state), - supporters: reduxGetter.getVideoSupporters(ownProps.videoId), - totalBt: reduxGetter.getVideoBt(ownProps.videoId, state) + entityDescriptionId : reduxGetter.getVideoDescriptionId(ownProps.entityId), + description: reduxGetter.getVideoDescription(reduxGetter.getVideoDescriptionId(ownProps.entityId, state), state), + link: reduxGetter.getVideoLink(reduxGetter.getReplyLinkId(ownProps.entityId, state), state), + supporters: reduxGetter.getVideoSupporters(ownProps.entityId), + totalBt: reduxGetter.getVideoBt(ownProps.entityId, state) }; }; - const VideoBottomStatus = connect(mapStateToProps)(Base); - export default VideoBottomStatus; \ No newline at end of file +const VideoBottomStatus = connect(mapStateToProps)( withNavigation( Base )); + +export default VideoBottomStatus ; \ No newline at end of file diff --git a/src/components/CommonComponents/VideoSupporterStat/Base.js b/src/components/CommonComponents/VideoSupporterStat/Base.js index 8ba9446a..c4a566d5 100644 --- a/src/components/CommonComponents/VideoSupporterStat/Base.js +++ b/src/components/CommonComponents/VideoSupporterStat/Base.js @@ -1,6 +1,5 @@ import React, { PureComponent } from 'react'; import { View, Text } from 'react-native'; -import { withNavigation } from 'react-navigation'; import pricer from '../../../services/Pricer'; import inlineStyles from '../../Home/styles'; @@ -9,7 +8,7 @@ import multipleClickHandler from '../../../services/MultipleClickHandler'; import Utilities from "../../../services/Utilities"; import CurrentUser from '../../../models/CurrentUser'; -class VideoSupporterStat extends PureComponent { +class Base extends PureComponent { constructor(props) { super(props); } @@ -34,18 +33,6 @@ class VideoSupporterStat extends PureComponent { return ( this.navigateToUserProfile())} pointerEvents={'auto'}> - {/*{*/} - {/**/} - {/*${`${ pricer.toDisplayAmount(this.btToFiat(this.props.totalBt))}`}{' '}RAISED*/} - {/**/} - {/*}*/} { @@ -61,4 +48,4 @@ class VideoSupporterStat extends PureComponent { } } -export default withNavigation(VideoSupporterStat); +export default Base; diff --git a/src/components/CommonComponents/VideoSupporterStat/VideoReplySupporterStat.js b/src/components/CommonComponents/VideoSupporterStat/VideoReplySupporterStat.js index 134355c7..4a4c6f50 100644 --- a/src/components/CommonComponents/VideoSupporterStat/VideoReplySupporterStat.js +++ b/src/components/CommonComponents/VideoSupporterStat/VideoReplySupporterStat.js @@ -2,19 +2,15 @@ import { connect } from 'react-redux'; import reduxGetter from '../../../services/ReduxGetters'; import Base from './Base'; +import { withNavigation } from 'react-navigation'; const mapStateToProps = (state, ownProps) => { return { supporters: reduxGetter.getUserSupporters(ownProps.userId, state), - totalBt: reduxGetter.getReplyBt(ownProps.videoId, state) + totalBt: reduxGetter.getReplyBt(ownProps.entityId, state) }; }; -class VideoReplyAmountStat extends Base { - constructor(props) { - super(props); - } -} -export default connect(mapStateToProps)(Base); +export default connect(mapStateToProps)( withNavigation( Base )); diff --git a/src/components/CommonComponents/VideoSupporterStat/VideoSupporterStat.js b/src/components/CommonComponents/VideoSupporterStat/VideoSupporterStat.js index d6006546..33817844 100644 --- a/src/components/CommonComponents/VideoSupporterStat/VideoSupporterStat.js +++ b/src/components/CommonComponents/VideoSupporterStat/VideoSupporterStat.js @@ -2,21 +2,15 @@ import { connect } from 'react-redux'; import reduxGetter from '../../../services/ReduxGetters'; import Base from './Base'; +import { withNavigation } from 'react-navigation'; const mapStateToProps = (state, ownProps) => { return { supporters: reduxGetter.getUserSupporters(ownProps.userId, state), - totalBt: reduxGetter.getVideoBt(ownProps.videoId, state) + totalBt: reduxGetter.getVideoBt(ownProps.entityId, state) }; }; -class VideoAmountStat extends Base { - constructor(props) { - super(props); - } -} - - -export default connect(mapStateToProps)(Base); +export default connect(mapStateToProps)( withNavigation ( Base) ); diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index ef3e53dc..e4ce5274 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -12,11 +12,12 @@ import inlineStyles from './styles'; import ReplyPepoTxBtn from '../PepoTransactionButton/ReplyPepoTxBtn'; import VideoReplySupporterStat from '../CommonComponents/VideoSupporterStat/VideoReplySupporterStat'; -import VideoBottomStatus from '../BottomStatus /VideoBottomStatus'; +import ReplyVideoBottomStatus from '../BottomStatus /ReplyVideoBottomStatus'; import DataContract from '../../constants/DataContract'; import ReduxGetters from '../../services/ReduxGetters'; + class VideoReplyRow extends PureComponent { constructor(props) { super(props); @@ -61,15 +62,13 @@ class VideoReplyRow extends PureComponent { - )} diff --git a/src/components/FullScreenVideoCollection/FullScreenVideoRow.js b/src/components/FullScreenVideoCollection/FullScreenVideoRow.js index 184d6714..87ea3c98 100644 --- a/src/components/FullScreenVideoCollection/FullScreenVideoRow.js +++ b/src/components/FullScreenVideoCollection/FullScreenVideoRow.js @@ -56,14 +56,14 @@ class FullScreeVideoRow extends PureComponent { )} diff --git a/src/components/Home/HomeFeedRow.js b/src/components/Home/HomeFeedRow.js index 6d1d6cb2..6daf3d48 100644 --- a/src/components/Home/HomeFeedRow.js +++ b/src/components/Home/HomeFeedRow.js @@ -71,13 +71,13 @@ class HomeFeedRow extends PureComponent { - + ); diff --git a/src/components/PepoTransactionButton/Base.js b/src/components/PepoTransactionButton/Base.js index 878349fe..986153cf 100644 --- a/src/components/PepoTransactionButton/Base.js +++ b/src/components/PepoTransactionButton/Base.js @@ -120,6 +120,7 @@ class Base extends PureComponent { } dropPixel() { + //TODO @Ashutosh , confrim from @Akshay PixelCall(this.getDropPixel()); } diff --git a/src/components/UserVideoHistory/UserVideoHistoryRow.js b/src/components/UserVideoHistory/UserVideoHistoryRow.js index bc51b504..df0a56f6 100644 --- a/src/components/UserVideoHistory/UserVideoHistoryRow.js +++ b/src/components/UserVideoHistory/UserVideoHistoryRow.js @@ -70,14 +70,14 @@ class UserVideoHistoryRow extends PureComponent { )} diff --git a/src/services/ReduxGetters.js b/src/services/ReduxGetters.js index 35e35136..f249ccaa 100644 --- a/src/services/ReduxGetters.js +++ b/src/services/ReduxGetters.js @@ -485,6 +485,11 @@ class ReduxGetters { return deepGet(state, `video_reply_stat_entities.id_${id}.total_contributed_by`); } + getReplyLinkId(id, state) { + state = state || Store.getState(); + return deepGet(state, `video_reply_stat_entities.id_${id}.link_ids[0]`); + } + isReplySupported(id, state) { state = state || Store.getState(); let val = deepGet(state, `video_reply_stat_entities.id_${id}`); From 849c8cd8d01ecb2b2f2661fc88516fd1beee92da Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Thu, 14 Nov 2019 16:58:56 +0530 Subject: [PATCH 062/302] share icon changes --- .../CommonComponents/ShareIcon/index.js | 3 +-- .../FullScreenReplyCollection/VideoReplyRow.js | 17 ++++++++--------- .../FullScreenVideoRow.js | 3 ++- src/components/Home/HomeFeedRow.js | 3 ++- .../UserVideoHistory/UserVideoHistoryRow.js | 3 ++- src/constants/DataContract.js | 9 +++++++++ src/services/shareVideo.js | 8 +++++--- 7 files changed, 29 insertions(+), 17 deletions(-) diff --git a/src/components/CommonComponents/ShareIcon/index.js b/src/components/CommonComponents/ShareIcon/index.js index fea0a3d1..54d885eb 100644 --- a/src/components/CommonComponents/ShareIcon/index.js +++ b/src/components/CommonComponents/ShareIcon/index.js @@ -2,7 +2,6 @@ import React, { PureComponent } from 'react'; import {TouchableOpacity , Image} from "react-native"; import { connect } from 'react-redux'; import reduxGetter from '../../../services/ReduxGetters'; -import inlineStyles from './styles'; import multipleClickHandler from "../../../services/MultipleClickHandler"; import ShareVideo from "../../../services/shareVideo"; @@ -22,7 +21,7 @@ class ShareIcon extends PureComponent { }; shareVideo = () => { - let shareVideo = new ShareVideo(this.props.videoId); + let shareVideo = new ShareVideo(this.props.entityId, this.props.url); shareVideo.perform(); }; diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index e4ce5274..60240917 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -22,12 +22,12 @@ class VideoReplyRow extends PureComponent { constructor(props) { super(props); this.userId = deepGet(this.props.item, 'payload.user_id'); - this.replyId = deepGet(this.props.item,`payload.${DataContract.replies.replyDetailIdKey}`); - this.videoId = ReduxGetters.getReplyEntityId(this.replyId); + this.replyDetailId = deepGet(this.props.item,`payload.${DataContract.replies.replyDetailIdKey}`); + this.videoId = ReduxGetters.getReplyEntityId(this.replyDetailId); } refetchVideoReply = () => { - new PepoApi(`/replies/${this.videoId}`) + new PepoApi(`/replies/${this.replyDetailId}`) .get() .then((res) => {}) .catch((error) => {}); @@ -54,21 +54,20 @@ class VideoReplyRow extends PureComponent { - - + + )} diff --git a/src/components/FullScreenVideoCollection/FullScreenVideoRow.js b/src/components/FullScreenVideoCollection/FullScreenVideoRow.js index 87ea3c98..7415efab 100644 --- a/src/components/FullScreenVideoCollection/FullScreenVideoRow.js +++ b/src/components/FullScreenVideoCollection/FullScreenVideoRow.js @@ -13,6 +13,7 @@ import inlineStyles from './styles'; import ReplyIcon from '../CommonComponents/ReplyIcon'; import PepoTxBtn from '../PepoTransactionButton/PepoTxBtn'; import VideoSupporterStat from '../CommonComponents/VideoSupporterStat/VideoSupporterStat'; +import DataContract from '../../constants/DataContract'; class FullScreeVideoRow extends PureComponent { @@ -51,7 +52,7 @@ class FullScreeVideoRow extends PureComponent { entityId={this.videoId} /> - + diff --git a/src/components/Home/HomeFeedRow.js b/src/components/Home/HomeFeedRow.js index 6daf3d48..7cf9bdd2 100644 --- a/src/components/Home/HomeFeedRow.js +++ b/src/components/Home/HomeFeedRow.js @@ -16,6 +16,7 @@ import ReportVideo from "../CommonComponents/ReportVideo"; import ReplyIcon from '../CommonComponents/ReplyIcon'; import PepoTxBtn from '../PepoTransactionButton/PepoTxBtn'; import VideoSupporterStat from '../CommonComponents/VideoSupporterStat/VideoSupporterStat'; +import DataContract from '../../constants/DataContract'; class HomeFeedRow extends PureComponent { @@ -66,7 +67,7 @@ class HomeFeedRow extends PureComponent { - + diff --git a/src/components/UserVideoHistory/UserVideoHistoryRow.js b/src/components/UserVideoHistory/UserVideoHistoryRow.js index df0a56f6..676b4382 100644 --- a/src/components/UserVideoHistory/UserVideoHistoryRow.js +++ b/src/components/UserVideoHistory/UserVideoHistoryRow.js @@ -15,6 +15,7 @@ import utilities from '../../services/Utilities'; import ReplyIcon from '../CommonComponents/ReplyIcon'; import PepoTxBtn from '../PepoTransactionButton/PepoTxBtn'; import VideoSupporterStat from '../CommonComponents/VideoSupporterStat/VideoSupporterStat'; +import DataContract from '../../constants/DataContract'; class UserVideoHistoryRow extends PureComponent { constructor(props) { @@ -65,7 +66,7 @@ class UserVideoHistoryRow extends PureComponent { entityId={this.props.videoId} /> - + diff --git a/src/constants/DataContract.js b/src/constants/DataContract.js index e148681c..53f920fa 100644 --- a/src/constants/DataContract.js +++ b/src/constants/DataContract.js @@ -76,6 +76,15 @@ export default { video:"FAN_UPDATE" }, kindKey: "kind" + }, + + share: { + getVideoShareApi: ( id ) => { + return `/videos/${id}/share`; + }, + getVideoReplyShareApi: ( id ) => { + return `/replies/${id}/share`; + } } } diff --git a/src/services/shareVideo.js b/src/services/shareVideo.js index 8c3dc8c3..4a1b69e3 100644 --- a/src/services/shareVideo.js +++ b/src/services/shareVideo.js @@ -1,15 +1,17 @@ import PepoApi from './PepoApi'; import { Share, Platform } from 'react-native'; +import DataContract from '../constants/DataContract'; class ShareVideo { - constructor(videoId) { - this.videoId = videoId; + constructor(entityId, url) { + this.entityId = entityId; + this.url = url; } perform() { return new Promise((resolve, reject) => { - new PepoApi(`/videos/${this.videoId}/share`).get().then((res) => { + new PepoApi(this.url).get().then((res) => { console.log(res, 'videos/:video_id/share in then'); this.shareTray(res); }); From d53739a07a628331ba58daa296638832a0a9143f Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Thu, 14 Nov 2019 17:13:24 +0530 Subject: [PATCH 063/302] rename reply stat to reply detail in redux --- src/actions/constants.js | 6 ++--- src/actions/index.js | 12 +++------- .../PepoTransactionButton/ReplyPepoTxBtn.js | 4 ++-- src/reducers/index.js | 17 ++++--------- src/services/ReduxGetters.js | 24 +++++++++---------- src/services/ReduxSetters.js | 2 +- 6 files changed, 25 insertions(+), 40 deletions(-) diff --git a/src/actions/constants.js b/src/actions/constants.js index c0a3174d..1dde20fd 100644 --- a/src/actions/constants.js +++ b/src/actions/constants.js @@ -16,8 +16,7 @@ const UPSERT_USER_STAT_ENTITIES = 'UPSERT_USER_STAT_ENTITIES'; const UPSERT_LINK_ENTITIES = 'UPSERT_LINK_ENTITIES'; const UPSERT_VIDEO_ENTITIES = 'UPSERT_VIDEO_ENTITIES'; const UPSERT_VIDEO_STAT_ENTITIES = 'UPSERT_VIDEO_STAT_ENTITIES'; -const UPSERT_VIDEO_REPLY_ENTITIES = 'UPSERT_VIDEO_REPLY_ENTITIES'; -const UPSERT_VIDEO_REPLY_STAT_ENTITIES = 'UPSERT_VIDEO_REPLY_STAT_ENTITIES'; +const UPSERT_REPLY_DETAIL_ENTITIES = 'UPSERT_REPLY_DETAIL_ENTITIES'; const UPSERT_HOME_FEED_ENTITIES = 'UPSERT_HOME_FEED_ENTITIES'; const UPSERT_IMAGE_ENTITIES = 'UPSERT_IMAGE_ENTITIES'; const UPDATE_BALANCE = 'UPDATE_BALANCE'; @@ -61,8 +60,7 @@ export { UPSERT_TAG_ENTITIES, UPSERT_USER_PROFILE_ENTITIES, UPSERT_USER_STAT_ENTITIES, - UPSERT_VIDEO_REPLY_ENTITIES, - UPSERT_VIDEO_REPLY_STAT_ENTITIES, + UPSERT_REPLY_DETAIL_ENTITIES, UPSERT_LINK_ENTITIES, UPSERT_VIDEO_ENTITIES, UPSERT_VIDEO_STAT_ENTITIES, diff --git a/src/actions/index.js b/src/actions/index.js index d30cdf0c..7ac35289 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -107,15 +107,9 @@ export const upsertVideoStatEntities = (data) => ({ payload: { video_stat_entities: data } }); -//@Preshita Dont put this in redux -export const upsertVideoReplyEntities = (data) => ({ - type: types.UPSERT_VIDEO_REPLY_ENTITIES, - payload: { video_reply_entities: data } -}); - -export const upsertVideoReplyStatEntities = (data) => ({ - type: types.UPSERT_VIDEO_REPLY_STAT_ENTITIES, - payload: { video_reply_stat_entities: data } +export const upsertReplyDetailEntities = (data) => ({ + type: types.UPSERT_REPLY_DETAIL_ENTITIES, + payload: { reply_detail_entities: data } }); export const upsertHomeFeedEntities = (data) => ({ diff --git a/src/components/PepoTransactionButton/ReplyPepoTxBtn.js b/src/components/PepoTransactionButton/ReplyPepoTxBtn.js index 1eaebc03..1e38e025 100644 --- a/src/components/PepoTransactionButton/ReplyPepoTxBtn.js +++ b/src/components/PepoTransactionButton/ReplyPepoTxBtn.js @@ -3,7 +3,7 @@ import clone from 'lodash/clone'; import CurrentUser from '../../models/CurrentUser'; import appConfig from '../../constants/AppConfig'; import Store from '../../store'; -import { upsertVideoReplyStatEntities } from '../../actions'; +import { upsertReplyDetailEntities } from '../../actions'; import reduxGetter from '../../services/ReduxGetters'; import Pricer from '../../services/Pricer'; import utilities from '../../services/Utilities'; @@ -63,7 +63,7 @@ class ReplyPepoTxBtn extends Base { } if (updateEntity) { - Store.dispatch(upsertVideoReplyStatEntities(utilities._getEntityFromObj(replyDetails))); + Store.dispatch(upsertReplyDetailEntities(utilities._getEntityFromObj(replyDetails))); } } diff --git a/src/reducers/index.js b/src/reducers/index.js index 5eef25e4..3cff51b0 100644 --- a/src/reducers/index.js +++ b/src/reducers/index.js @@ -25,8 +25,7 @@ export const { upsertUserStatEntities, upsertVideoEntities, upsertVideoStatEntities, - upsertVideoReplyEntities, - upsertVideoReplyStatEntities, + upsertReplyDetailEntities, upsertImageEntities, upsertHomeFeedEntities, updateBalance, @@ -70,8 +69,7 @@ const defaultState = { link_entities: {}, video_entities: {}, video_stat_entities: {}, - video_reply_entities: {}, - video_reply_stat_entities: {}, + reply_detail_entities: {}, video_description_entities: {}, image_entities: {}, home_feed_entities: {}, @@ -103,8 +101,7 @@ const logoutDefault = { link_entities: {}, video_entities: {}, video_stat_entities: {}, - video_reply_entities: {}, - video_reply_stat_entities: {}, + reply_detail_entities: {}, video_description_entities: {}, image_entities: {}, home_feed_entities: {}, @@ -179,13 +176,9 @@ export const reducer = handleActions( ...state, video_stat_entities: assignIn({}, state.video_stat_entities, action.payload.video_stat_entities) }), - [upsertVideoReplyEntities]: (state, action) => ({ + [upsertReplyDetailEntities]: (state, action) => ({ ...state, - video_reply_entities: assignIn({}, state.video_reply_entities, action.payload.video_reply_entities) - }), - [upsertVideoReplyStatEntities]: (state, action) => ({ - ...state, - video_reply_stat_entities: assignIn({}, state.video_reply_stat_entities, action.payload.video_reply_stat_entities) + reply_detail_entities: assignIn({}, state.reply_detail_entities, action.payload.reply_detail_entities) }), [upsertVideoDescriptionEntities]: (state, action) => ({ ...state, diff --git a/src/services/ReduxGetters.js b/src/services/ReduxGetters.js index f249ccaa..32477bbe 100644 --- a/src/services/ReduxGetters.js +++ b/src/services/ReduxGetters.js @@ -437,62 +437,62 @@ class ReduxGetters { getReplyEntity(id, state) { state = state || Store.getState(); - return deepGet(state, `video_reply_stat_entities.id_${id}`); + return deepGet(state, `reply_detail_entities.id_${id}`); } getReplyBt(id, state) { state = state || Store.getState(); - return deepGet(state, `video_reply_stat_entities.id_${id}.total_amount_raised_in_wei`); + return deepGet(state, `reply_detail_entities.id_${id}.total_amount_raised_in_wei`); } getReplyCount(id, state){ state = state || Store.getState(); - return deepGet(state, `video_reply_stat_entities.id_${id}.total_replies`, 0); + return deepGet(state, `reply_detail_entities.id_${id}.total_replies`, 0); } getReplyAmount(id, state){ state = state || Store.getState(); - return deepGet(state, `video_reply_stat_entities.id_${id}.per_reply_amount_in_wei`, 0); + return deepGet(state, `reply_detail_entities.id_${id}.per_reply_amount_in_wei`, 0); } getReplyAllowed(id, state){ state = state || Store.getState(); - return deepGet(state, `video_reply_stat_entities.id_${id}.is_reply_allowed`, true); + return deepGet(state, `reply_detail_entities.id_${id}.is_reply_allowed`, true); } getReplyKind(id, state){ state = state || Store.getState(); - return deepGet(state, `video_reply_stat_entities.id_${id}.entity_kind`); + return deepGet(state, `reply_detail_entities.id_${id}.entity_kind`); } getReplyEntityId(id, state){ state = state || Store.getState(); - return deepGet(state, `video_reply_stat_entities.id_${id}.entity_id`); + return deepGet(state, `reply_detail_entities.id_${id}.entity_id`); } getReplyDescriptionId(id, state) { state = state || Store.getState(); - return deepGet(state, `video_reply_stat_entities.id_${id}.description_id`); + return deepGet(state, `reply_detail_entities.id_${id}.description_id`); } getReplyBt(id, state) { state = state || Store.getState(); - return deepGet(state, `video_reply_stat_entities.id_${id}.total_amount_raised_in_wei`); + return deepGet(state, `reply_detail_entities.id_${id}.total_amount_raised_in_wei`); } getReplySupporters(id , state){ state = state || Store.getState(); - return deepGet(state, `video_reply_stat_entities.id_${id}.total_contributed_by`); + return deepGet(state, `reply_detail_entities.id_${id}.total_contributed_by`); } getReplyLinkId(id, state) { state = state || Store.getState(); - return deepGet(state, `video_reply_stat_entities.id_${id}.link_ids[0]`); + return deepGet(state, `reply_detail_entities.id_${id}.link_ids[0]`); } isReplySupported(id, state) { state = state || Store.getState(); - let val = deepGet(state, `video_reply_stat_entities.id_${id}`); + let val = deepGet(state, `reply_detail_entities.id_${id}`); val = val && Number(val); return !!val; } diff --git a/src/services/ReduxSetters.js b/src/services/ReduxSetters.js index 7ec85a94..86d14d8f 100644 --- a/src/services/ReduxSetters.js +++ b/src/services/ReduxSetters.js @@ -15,7 +15,7 @@ const knownEntitiesDispatcherMap = { videos: 'upsertVideoEntities', video_details: 'upsertVideoStatEntities', video_replies: 'upsertVideoReplyEntities', - reply_details: 'upsertVideoReplyStatEntities', + reply_details: 'upsertReplyDetailEntities', images: 'upsertImageEntities', current_user_video_contributions: 'upsertVideoContributionEntities', current_user_user_contributions: 'upsertUserContributionEntities', From f26601677b8de0fb363f6bbe866a106a24c7da83 Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Thu, 14 Nov 2019 18:15:42 +0530 Subject: [PATCH 064/302] pepo transaction on video reply --- .../{BottomStatus => BottomStatus}/Base.js | 0 .../ReplyVideoBottomStatus.js | 0 .../VideoBottomStatus.js | 0 .../{BottomStatus => BottomStatus}/styles.js | 0 src/components/CaptureVideo/index.js | 8 +- .../CommonComponents/ReplyIcon/index.js | 6 +- .../CommonComponents/ReplyVideo/index.js | 84 ------------------- src/components/FanVideoDetails/index.js | 26 +++--- src/components/FanVideoReplyDetails/index.js | 35 ++++---- .../VideoReplyRow.js | 2 +- .../FullScreenVideoRow.js | 2 +- src/components/Home/HomeFeedRow.js | 2 +- .../UserVideoHistory/UserVideoHistoryRow.js | 2 +- src/components/VideoRecorder/index.js | 7 +- src/components/VideoReplies/index.js | 13 +-- src/constants/AppConfig.js | 5 ++ src/services/CameraWorker.js | 46 +++++++--- src/services/ReduxGetters.js | 35 ++++---- src/services/TransactionExecutor.js | 4 +- 19 files changed, 116 insertions(+), 161 deletions(-) rename src/components/{BottomStatus => BottomStatus}/Base.js (100%) rename src/components/{BottomStatus => BottomStatus}/ReplyVideoBottomStatus.js (100%) rename src/components/{BottomStatus => BottomStatus}/VideoBottomStatus.js (100%) rename src/components/{BottomStatus => BottomStatus}/styles.js (100%) delete mode 100644 src/components/CommonComponents/ReplyVideo/index.js diff --git a/src/components/BottomStatus /Base.js b/src/components/BottomStatus/Base.js similarity index 100% rename from src/components/BottomStatus /Base.js rename to src/components/BottomStatus/Base.js diff --git a/src/components/BottomStatus /ReplyVideoBottomStatus.js b/src/components/BottomStatus/ReplyVideoBottomStatus.js similarity index 100% rename from src/components/BottomStatus /ReplyVideoBottomStatus.js rename to src/components/BottomStatus/ReplyVideoBottomStatus.js diff --git a/src/components/BottomStatus /VideoBottomStatus.js b/src/components/BottomStatus/VideoBottomStatus.js similarity index 100% rename from src/components/BottomStatus /VideoBottomStatus.js rename to src/components/BottomStatus/VideoBottomStatus.js diff --git a/src/components/BottomStatus /styles.js b/src/components/BottomStatus/styles.js similarity index 100% rename from src/components/BottomStatus /styles.js rename to src/components/BottomStatus/styles.js diff --git a/src/components/CaptureVideo/index.js b/src/components/CaptureVideo/index.js index 92328453..2db5ec99 100644 --- a/src/components/CaptureVideo/index.js +++ b/src/components/CaptureVideo/index.js @@ -41,19 +41,14 @@ class CaptureVideo extends Component { } - componentDidMount () { - - - } + componentDidMount () {} showCoachForVideoRecord() { const oThis = this; if (! this.isVideoTypeReply) { utilities.getItem(`${CurrentUser.getUserId()}-accepted-camera-t-n-c`).then((terms) => { - console.log(terms, 'acceptedCameraTnCacceptedCameraTnCacceptedCameraTnCacceptedCameraTnC'); oThis.setState({ acceptedCameraTnC: terms }); - console.log('acceptedCameraTnC:::acceptedCameraTnC', oThis.state.acceptedCameraTnC); }); } } @@ -167,6 +162,7 @@ class CaptureVideo extends Component { navigation={this.props.navigation} isVideoTypeReply={this.isVideoTypeReply} hasVideoReplies={this.state.hasVideoReplies} + videoId={this.replyReceiverVideoId} /> ); diff --git a/src/components/CommonComponents/ReplyIcon/index.js b/src/components/CommonComponents/ReplyIcon/index.js index 49ae205d..3200a449 100644 --- a/src/components/CommonComponents/ReplyIcon/index.js +++ b/src/components/CommonComponents/ReplyIcon/index.js @@ -20,9 +20,9 @@ const mapStateToProps = (state , ownProps) => { isVideoUserActivated : Utilities.isUserActivated(reduxGetter.getUserActivationStatus(ownProps.userId)), isCurrentUserActivated : CurrentUser.isUserActivated(), balance : state.balance, - requiredPepo : reduxGetter.getReplyAmount(ownProps.videoId, state), - videoReplyCount : reduxGetter.getReplyCount(ownProps.videoId, state), - isReplyAllowed : reduxGetter.getReplyAllowed(ownProps.videoId, state), + requiredPepo : reduxGetter.getBtAmountForReply(ownProps.videoId, state), + videoReplyCount : reduxGetter.getVideoReplyCount(ownProps.videoId, state), + isReplyAllowed : reduxGetter.isReplyAllowed(ownProps.videoId, state), userName : reduxGetter.getUserName(ownProps.userId) } }; diff --git a/src/components/CommonComponents/ReplyVideo/index.js b/src/components/CommonComponents/ReplyVideo/index.js deleted file mode 100644 index dfdc3431..00000000 --- a/src/components/CommonComponents/ReplyVideo/index.js +++ /dev/null @@ -1,84 +0,0 @@ -import React, { PureComponent } from 'react'; -import {TouchableOpacity , Image, View, Text} from "react-native"; -import { connect } from 'react-redux'; -import {withNavigation} from "react-navigation"; - -import reduxGetter from '../../../services/ReduxGetters'; -import inlineStyles from './styles'; -import multipleClickHandler from "../../../services/MultipleClickHandler"; -import pricer from '../../../services/Pricer'; -import reply_video from '../../../assets/reply_video.png'; -import Utilities from '../../../services/Utilities'; -import CurrentUser from '../../../models/CurrentUser'; -import NavigationService from "../../../services/NavigationService"; -import utilities from "../../../services/Utilities"; - -const mapStateToProps = (state , ownProps) => { - return { - isCreatorApproved : reduxGetter.isCreatorApproved(ownProps.userId), - isVideoUserActivated : Utilities.isUserActivated(reduxGetter.getUserActivationStatus(ownProps.userId)), - isCurrentUserActivated : CurrentUser.isUserActivated(), - balance : state.balance, - requiredPepo : reduxGetter.getReplyAmount(ownProps.videoId, state), - videoReplyCount : reduxGetter.getReplyCount(ownProps.videoId, state), - isReplyAllowed : reduxGetter.getReplyAllowed(ownProps.videoId, state) - } -}; - -class ReplyVideo extends PureComponent { - - constructor(props){ - super(props); - }; - - isDisabled = () => { - return !this.props.isReplyAllowed || !this.props.isVideoUserActivated || !this.props.isCurrentUserActivated || !this.hasSufficientBalance(); - }; - - hasSufficientBalance = () => { - return this.getBalanceToNumber() >= this.props.requiredPepo ? true : false; - }; - - getBalanceToNumber = () => { - return (this.props.balance && Math.floor(Number(pricer.getFromDecimal(this.props.balance)))) || 0; - }; - - replyVideo = ()=> { - if (this.props.videoReplyCount > 0){ - this.props.navigation.push('VideoReplies', - {'videoId': this.props.videoId , - 'userId': this.props.userId, - 'amount': this.props.requiredPepo, - 'videoReplyCount': this.props.videoReplyCount, - 'fetchUrl': `/videos/${this.props.videoId}/replies` - }); - } else { - let activeTab = NavigationService.getActiveTab(); - let params = { - videoTypeReply: true, - videoId: this.props.videoId, - userId: this.props.userId, - amount: this.props.requiredPepo, - videoReplyCount: this.props.videoReplyCount - }; - utilities.handleVideoUploadModal(activeTab, this.props.navigation, params); - } - - }; - - render(){ - return ( - - {this.props.videoReplyCount} - this.replyVideo())} > - - - ); - } - -}; - -export default connect(mapStateToProps)(withNavigation(ReplyVideo)); diff --git a/src/components/FanVideoDetails/index.js b/src/components/FanVideoDetails/index.js index 5b95e428..bd4e9221 100644 --- a/src/components/FanVideoDetails/index.js +++ b/src/components/FanVideoDetails/index.js @@ -78,7 +78,7 @@ class FanVideoDetails extends Component { static saveToRedux = (navigation) => { let desc = navigation.state.params.videoDesc, link = navigation.state.params.videoLink, - amount = navigation.state.params.replyAmount; + amount = pricer.getToDecimal(navigation.state.params.replyAmount); Store.dispatch(upsertRecordedVideo({ video_desc: desc, video_link: link, reply_amount:amount })); }; @@ -149,7 +149,10 @@ class FanVideoDetails extends Component { this.validateData().then((res) => { utilities.saveItem(`${CurrentUser.getUserId()}-accepted-camera-t-n-c`, true); Store.dispatch( - upsertRecordedVideo({ video_desc: this.videoDesc, video_link: this.videoLink, reply_amount: this.replyAmount, do_upload: true }) + upsertRecordedVideo({ video_desc: this.videoDesc, + video_link: this.videoLink, + reply_amount: pricer.getToDecimal(this.replyAmount), + do_upload: true }) ); this.props.navigation.dispatch(StackActions.popToTop()); this.props.navigation.dispatch(StackActions.popToTop()); @@ -248,27 +251,24 @@ class FanVideoDetails extends Component { }; - replyAmountChange = (amount) => { - this.replyAmount = amount; - //Done for the value to be accessible in static navigationOptions - this.props.navigation.setParams({ - replyAmount: amount - }); - }; - onErrorCallBack = ( errMsg ) =>{ this.setState({ amountError : errMsg }) } - onChangeText = ( value )=>{ + replyAmountChange = ( value )=>{ + this.replyAmount = value; let formattedUsdVal = this.getUSDValue( value ); + //Done for the value to be accessible in static navigationOptions + this.props.navigation.setParams({ + replyAmount: value + }); this.setState({ usdVal : formattedUsdVal, amountError : "" }); - } + }; getUSDValue = (value ) =>{ let usdVal = this.priceOracle.btToFiat(value), formattedUsdVal = this.numberFormatter.getFormattedValue( usdVal ); @@ -313,7 +313,7 @@ class FanVideoDetails extends Component { value = {DEFAUT_BT_VALUE} max = {this.props.balance} onErrorCallBack = {this.onErrorCallBack} - onChangeText = {this.onChangeText} + onChangeText = {this.replyAmountChange} /> ${this.state.usdVal} diff --git a/src/components/FanVideoReplyDetails/index.js b/src/components/FanVideoReplyDetails/index.js index fbd42018..6c251329 100644 --- a/src/components/FanVideoReplyDetails/index.js +++ b/src/components/FanVideoReplyDetails/index.js @@ -168,24 +168,30 @@ class FanVideoReplyDetails extends Component { }; + giveUploadConsent = () => { + Store.dispatch( + upsertRecordedVideo({ video_desc: this.videoDesc, video_link: this.videoLink, do_upload: true }) + ); + this.props.navigation.dispatch(StackActions.popToTop()); + this.props.navigation.dispatch(StackActions.popToTop()); + this.props.navigation.navigate('HomeScreen'); + }; + + enableStartUploadFlag = () => { this.clearErrors(); this.validateData().then((res) => { - - this.ensureSession().then(() => { - - Store.dispatch( - upsertRecordedVideo({ video_desc: this.videoDesc, video_link: this.videoLink, do_upload: true }) - ); - this.props.navigation.dispatch(StackActions.popToTop()); - this.props.navigation.dispatch(StackActions.popToTop()); - this.props.navigation.navigate('HomeScreen'); - - }).catch(()=> { - - }); + let videoOwnerId = this.replyObject.replyReceiverUserId; + if (videoOwnerId === CurrentUser.getUserId()){ + this.giveUploadConsent(); + return; + } + this.ensureSession().then(() => { + this.giveUploadConsent(); + }).catch(()=> { + }); @@ -287,7 +293,8 @@ class FanVideoReplyDetails extends Component { }; getAmountToSend = () => { - return this.replyObject.amountToSendWithReply || 0; + let amount = this.replyObject.amountToSendWithReply ; + return pricer.getToBT(pricer.getFromDecimal(amount), 2); }; render() { diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index 60240917..d5663790 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -12,7 +12,7 @@ import inlineStyles from './styles'; import ReplyPepoTxBtn from '../PepoTransactionButton/ReplyPepoTxBtn'; import VideoReplySupporterStat from '../CommonComponents/VideoSupporterStat/VideoReplySupporterStat'; -import ReplyVideoBottomStatus from '../BottomStatus /ReplyVideoBottomStatus'; +import ReplyVideoBottomStatus from '../BottomStatus/ReplyVideoBottomStatus'; import DataContract from '../../constants/DataContract'; import ReduxGetters from '../../services/ReduxGetters'; diff --git a/src/components/FullScreenVideoCollection/FullScreenVideoRow.js b/src/components/FullScreenVideoCollection/FullScreenVideoRow.js index 7415efab..51c00134 100644 --- a/src/components/FullScreenVideoCollection/FullScreenVideoRow.js +++ b/src/components/FullScreenVideoCollection/FullScreenVideoRow.js @@ -7,7 +7,7 @@ import ReportVideo from "../CommonComponents/ReportVideo"; import PepoApi from '../../services/PepoApi'; import deepGet from 'lodash/get'; -import VideoBottomStatus from '../BottomStatus /VideoBottomStatus'; +import VideoBottomStatus from '../BottomStatus/VideoBottomStatus'; import inlineStyles from './styles'; import ReplyIcon from '../CommonComponents/ReplyIcon'; diff --git a/src/components/Home/HomeFeedRow.js b/src/components/Home/HomeFeedRow.js index 7cf9bdd2..cea2a4a9 100644 --- a/src/components/Home/HomeFeedRow.js +++ b/src/components/Home/HomeFeedRow.js @@ -8,7 +8,7 @@ import PepoApi from '../../services/PepoApi'; import reduxGetter from '../../services/ReduxGetters'; import CurrentUser from '../../models/CurrentUser'; -import VideoBottomStatus from '../BottomStatus /VideoBottomStatus'; +import VideoBottomStatus from '../BottomStatus/VideoBottomStatus'; import inlineStyles from './styles'; import utilities from '../../services/Utilities'; diff --git a/src/components/UserVideoHistory/UserVideoHistoryRow.js b/src/components/UserVideoHistory/UserVideoHistoryRow.js index 676b4382..94769352 100644 --- a/src/components/UserVideoHistory/UserVideoHistoryRow.js +++ b/src/components/UserVideoHistory/UserVideoHistoryRow.js @@ -8,7 +8,7 @@ import PepoApi from '../../services/PepoApi'; import CurrentUser from '../../models/CurrentUser'; -import VideoBottomStatus from '../BottomStatus /VideoBottomStatus'; +import VideoBottomStatus from '../BottomStatus/VideoBottomStatus'; import inlineStyles from './styles'; import utilities from '../../services/Utilities'; diff --git a/src/components/VideoRecorder/index.js b/src/components/VideoRecorder/index.js index 12437880..c64fdbd0 100644 --- a/src/components/VideoRecorder/index.js +++ b/src/components/VideoRecorder/index.js @@ -27,6 +27,7 @@ import LinearGradient from "react-native-linear-gradient"; import Theme from "../../theme/styles"; import multipleClickHandler from "../../services/MultipleClickHandler"; import TouchableButton from "../FanVideoReplyDetails/TouchableButton"; +import Pricer from "../../services/Pricer"; const ACTION_SHEET_BUTTONS = ['Reshoot', 'Continue with already recorded']; const ACTION_SHEET_CONTINUE_INDEX = 1; const ACTION_SHEET_RESHOOT_INDEX = 0; @@ -165,11 +166,12 @@ class VideoRecorder extends Component { }; getPepoAmount = () => { - return deepGet(this.recordedVideoObj, 'reply_obj.amountToSendWithReply'); + let amount = reduxGetters.getBtAmountForReply(this.props.videoId); + return Pricer.getToBT(Pricer.getFromDecimal(amount), 2); }; getUserName = () => { - let userId = deepGet(this.recordedVideoObj, 'reply_obj.replyReceiverUserId'); + let userId = reduxGetters.getVideoCreatorUserId(this.props.videoId); return reduxGetters.getUserName(userId) }; @@ -218,7 +220,6 @@ class VideoRecorder extends Component { } // if (no video reply present) { return Coach } } else { - console.log(this.state.acceptedCameraTnC, 'this.state.acceptedCameraTnC-----------'); if (this.state.acceptedCameraTnC !== 'true'){ console.log('=========----============-----------'); diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index 84badb7d..039f4a4a 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -26,6 +26,7 @@ import videoUploaderComponent from '../../services/CameraWorkerEventEmitter'; import { getInset } from 'react-native-safe-area-view'; import DataContract from '../../constants/DataContract'; import ReduxGetters from '../../services/ReduxGetters'; +import Pricer from "../../services/Pricer"; const { width, height } = Dimensions.get('window'); const landScape = width > height; const topPadding = getInset('top', landScape); @@ -46,8 +47,8 @@ class VideoRepliesScreen extends PureComponent { super(props); this.userId = props.navigation.getParam('userId'); this.videoId = props.navigation.getParam('videoId'); - this.amount = ReduxGetters.getReplyAmount(this.videoId ); - this.videoReplyCount = ReduxGetters.getReplyCount(this.videoId); + this.amount = ReduxGetters.getBtAmountForReply(this.videoId ); + this.videoReplyCount = ReduxGetters.getVideoReplyCount(this.videoId); this.fetchUrl = DataContract.replies.getReplyListApi(this.videoId); this.initialHeight = height/1.5; @@ -69,7 +70,7 @@ class VideoRepliesScreen extends PureComponent { setTimeout(()=> { this.setState({ showBackdrop: true, - videoUploaderVisible: ReduxGetters.getVideoProcessingStatus() // find from redux @mayur + videoUploaderVisible: ReduxGetters.getVideoProcessingStatus() }); }, 300) @@ -80,8 +81,8 @@ class VideoRepliesScreen extends PureComponent { componentWillUnmount() { this.onAnimatedValueChange= () => {}; this.animatedValue.removeListener(this.listener); - videoUploaderComponent.removeListener('show'); - videoUploaderComponent.removeListener('hide'); + //videoUploaderComponent.removeListener('show'); + //videoUploaderComponent.removeListener('hide'); } showVideoUploader = () => { @@ -184,7 +185,7 @@ class VideoRepliesScreen extends PureComponent { {/* {TODO integration pending} */} Send a reply with{' '} - {this.amount} + { Pricer.getToBT(Pricer.getFromDecimal(this.amount), 2)} diff --git a/src/constants/AppConfig.js b/src/constants/AppConfig.js index 430e6147..29621876 100644 --- a/src/constants/AppConfig.js +++ b/src/constants/AppConfig.js @@ -54,6 +54,11 @@ export default { name: 'profile' }, + replyMetaProperties: { + type: 'user_to_user', + name: 'reply_on_video' + }, + redemptionMetaProperties : { type: 'user_to_company', name: 'redemption' diff --git a/src/services/CameraWorker.js b/src/services/CameraWorker.js index e3efb90b..b9810531 100644 --- a/src/services/CameraWorker.js +++ b/src/services/CameraWorker.js @@ -3,6 +3,7 @@ import { connect } from 'react-redux'; import RNFS from 'react-native-fs'; import Store from '../store'; import deepGet from 'lodash/get'; +import clone from 'lodash/clone'; import { @@ -28,7 +29,7 @@ import {VideoPlayPauseEmitter} from "../helpers/Emitters"; import DataContract from "../constants/DataContract"; import {TransactionExecutor} from './TransactionExecutor'; import { ostSdkErrors } from '../services/OstSdkErrors'; - +import AppConfig from '../constants/AppConfig'; const recordedVideoStates = [ 'raw_video', 'compressed_video', @@ -167,8 +168,8 @@ class CameraWorker extends PureComponent { }; - onRequestAcknowledge = ( ostWorkflowContext, ostWorkflowEntity ) => { - console.log('CameraWorker.onRequestAcknowledge'); + videoUploadedSuccessCallback = ( ostWorkflowContext, ostWorkflowEntity ) => { + console.log('CameraWorker.videoUploadedSuccessCallback'); Toast.show({ text: 'Your video uploaded successfully.', icon: 'success', @@ -192,21 +193,46 @@ class CameraWorker extends PureComponent { }); }; + + getSdkMetaProperties = () => { + const metaProperties = clone(AppConfig.replyMetaProperties); + let parentVideoId = deepGet(this.props.recorded_video , 'reply_obj.replyReceiverVideoId'), + replyDetailId = deepGet(this.props.recorded_video , 'reply_obj.replyDetailId') + ; + + if (! parentVideoId || ! replyDetailId ){ + return ; + } + + let details = `vi_${parentVideoId}`; + details += `rdi_${replyDetailId}`; + metaProperties['details'] = details; + return metaProperties; + }; + + executeTransaction = () => { - let goForTx = this.props.recorded_video.go_for_tx; - let receiverUserId = deepGet (this.props.recorded_video, 'reply_obj.replyReceiverUserId'); - let amountToSendWithReply = deepGet(this.props.recorded_video, 'reply_obj.amountToSendWithReply'); - if (! goForTx || ! receiverUserId || ! amountToSendWithReply ){ + let goForTx = this.props.recorded_video.go_for_tx, + doDiscard = this.props.recorded_video.do_discard, + receiverUserId = deepGet (this.props.recorded_video, 'reply_obj.replyReceiverUserId'), + amountToSendWithReply = deepGet(this.props.recorded_video, 'reply_obj.amountToSendWithReply'); + if (! goForTx || ! receiverUserId || doDiscard ){ return; } + if ( receiverUserId === this.props.currentUserId || ! amountToSendWithReply) { + this.videoUploadedSuccessCallback(); + return; + }; + videoUploaderComponent.emit('show'); console.log('CameraWorker.executeTransaction'); - let callbacks = {onRequestAcknowledge: this.onRequestAcknowledge, onFlowInterrupt: this.onFlowInterrupt}; + let callbacks = {onRequestAcknowledge: this.videoUploadedSuccessCallback, onFlowInterrupt: this.onFlowInterrupt}; + let config = {metaProperties: this.getSdkMetaProperties()}; let txExecutor = new TransactionExecutor({}, callbacks); - txExecutor.sendTransactionToSdk( '10', receiverUserId, false); + txExecutor.sendTransactionToSdk( amountToSendWithReply, receiverUserId, false); // todo : Execute transaction code. call clean up after that. }; @@ -226,11 +252,9 @@ class CameraWorker extends PureComponent { parentVideoId = deepGet(this.props.recorded_video , 'reply_obj.replyReceiverVideoId'); if ( readyForTx || !parentVideoId ) { - // we have reply OR we dont have video Id return true } - console.log('I ammmmmmmhereeeee', this.props.recorded_video.s3_video, this.props.recorded_video.pepo_api_posting, this.postToPepoApi ); if ( this.props.recorded_video.s3_video && diff --git a/src/services/ReduxGetters.js b/src/services/ReduxGetters.js index 32477bbe..0e3da064 100644 --- a/src/services/ReduxGetters.js +++ b/src/services/ReduxGetters.js @@ -128,6 +128,26 @@ class ReduxGetters { return deepGet(state, `video_stat_entities.id_${id}.description_id`); } + getVideoReplyCount(id, state){ + state = state || Store.getState(); + return deepGet(state, `video_stat_entities.id_${id}.total_replies`, 0); + } + + getBtAmountForReply(id, state){ + state = state || Store.getState(); + return deepGet(state, `video_stat_entities.id_${id}.per_reply_amount_in_wei`, 0); + } + + isReplyAllowed(id, state){ + state = state || Store.getState(); + return deepGet(state, `video_stat_entities.id_${id}.is_reply_allowed`, true); + } + + getVideoCreatorUserId(id, state){ + state = state || Store.getState(); + return deepGet(state, `video_stat_entities.id_${id}.creator_user_id`, true); + } + getTappedIncludesEntity(videoId, tappedText) { let lowercasedText = tappedText.toLowerCase(); let state = Store.getState(); @@ -445,21 +465,6 @@ class ReduxGetters { return deepGet(state, `reply_detail_entities.id_${id}.total_amount_raised_in_wei`); } - getReplyCount(id, state){ - state = state || Store.getState(); - return deepGet(state, `reply_detail_entities.id_${id}.total_replies`, 0); - } - - getReplyAmount(id, state){ - state = state || Store.getState(); - return deepGet(state, `reply_detail_entities.id_${id}.per_reply_amount_in_wei`, 0); - } - - getReplyAllowed(id, state){ - state = state || Store.getState(); - return deepGet(state, `reply_detail_entities.id_${id}.is_reply_allowed`, true); - } - getReplyKind(id, state){ state = state || Store.getState(); return deepGet(state, `reply_detail_entities.id_${id}.entity_kind`); diff --git a/src/services/TransactionExecutor.js b/src/services/TransactionExecutor.js index e4f51d6e..861635b8 100644 --- a/src/services/TransactionExecutor.js +++ b/src/services/TransactionExecutor.js @@ -35,8 +35,8 @@ class TransactionExecutor { this.callbacks = callbacks || {}; } - sendTransactionToSdk(btAmount=0 , toUserId , validateSession=true ) { - const btInDecimal = Pricer.getToDecimal(btAmount); + sendTransactionToSdk(btInDecimal, toUserId , validateSession=true ) { + if(!btInDecimal) return ; this.setToUser( toUserId ); if( !validateSession ){ From 3ca5c4c29ae93970c5b8c62b450b272636cdb85f Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Thu, 14 Nov 2019 18:37:11 +0530 Subject: [PATCH 065/302] minor changes --- .../CommonComponents/ReplyVideo/index.js | 3 ++- .../CommonComponents/VideoPlayer/index.js | 16 +++------------- .../FullScreenReplyCollection/VideoReplyRow.js | 1 + src/services/shareVideo.js | 1 - 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/components/CommonComponents/ReplyVideo/index.js b/src/components/CommonComponents/ReplyVideo/index.js index dfdc3431..50284ed2 100644 --- a/src/components/CommonComponents/ReplyVideo/index.js +++ b/src/components/CommonComponents/ReplyVideo/index.js @@ -12,6 +12,7 @@ import Utilities from '../../../services/Utilities'; import CurrentUser from '../../../models/CurrentUser'; import NavigationService from "../../../services/NavigationService"; import utilities from "../../../services/Utilities"; +import DataContract from '../../../constants/DataContract'; const mapStateToProps = (state , ownProps) => { return { @@ -50,7 +51,7 @@ class ReplyVideo extends PureComponent { 'userId': this.props.userId, 'amount': this.props.requiredPepo, 'videoReplyCount': this.props.videoReplyCount, - 'fetchUrl': `/videos/${this.props.videoId}/replies` + 'fetchUrl': DataContract.replies.getReplyListApi(this.videoId) }); } else { let activeTab = NavigationService.getActiveTab(); diff --git a/src/components/CommonComponents/VideoPlayer/index.js b/src/components/CommonComponents/VideoPlayer/index.js index 6d1e4ff6..54f45261 100644 --- a/src/components/CommonComponents/VideoPlayer/index.js +++ b/src/components/CommonComponents/VideoPlayer/index.js @@ -72,19 +72,9 @@ class VideoPlayer extends Component { } }; - navigateToUserProfile = (e) => { - if (Utilities.checkActiveUser()) { - if (this.state.userId == CurrentUser.getUserId()) { - this.props.navigation.navigate('ProfileScreen'); - } else { - this.isActiveScreen = false; - this.props.navigation.push('UsersProfileScreen', { userId: this.state.userId }); - } - } - }; - render() { if(this.state.isDeleted){ + // {TODO @Preshita move to common component } return this.props.navigation.goBack()} style={inlineStyles.historyBackSkipFont}> @@ -97,8 +87,8 @@ class VideoPlayer extends Component { + videoId={this.videoId} userId={this.state.userId}/> + {/* // {TODO @Preshita move to common component } */} this.props.navigation.goBack()} style={inlineStyles.historyBackSkipFont}> diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index 60240917..a1440252 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -62,6 +62,7 @@ class VideoReplyRow extends PureComponent { diff --git a/src/services/shareVideo.js b/src/services/shareVideo.js index 4a1b69e3..43bf494f 100644 --- a/src/services/shareVideo.js +++ b/src/services/shareVideo.js @@ -12,7 +12,6 @@ class ShareVideo { perform() { return new Promise((resolve, reject) => { new PepoApi(this.url).get().then((res) => { - console.log(res, 'videos/:video_id/share in then'); this.shareTray(res); }); }); From 716def813ccb335caf6e0c472b4e5f3dc4326502 Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Thu, 14 Nov 2019 19:41:04 +0530 Subject: [PATCH 066/302] remove condition --- src/components/CommonComponents/ReplyIcon/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/CommonComponents/ReplyIcon/index.js b/src/components/CommonComponents/ReplyIcon/index.js index 3200a449..175182b2 100644 --- a/src/components/CommonComponents/ReplyIcon/index.js +++ b/src/components/CommonComponents/ReplyIcon/index.js @@ -49,7 +49,7 @@ class ReplyIcon extends PureComponent { return; } - if (this.props.videoReplyCount > 0 || true){ + if ( this.props.videoReplyCount > 0 ) { this.props.navigation.push('VideoReplies', {'videoId': this.props.videoId , 'userId': this.props.userId From 7f13b40ccf067784d1d32b221fa2043143dc9c53 Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Thu, 14 Nov 2019 20:08:02 +0530 Subject: [PATCH 067/302] transaction fix --- src/services/CameraWorker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/CameraWorker.js b/src/services/CameraWorker.js index b9810531..1d610542 100644 --- a/src/services/CameraWorker.js +++ b/src/services/CameraWorker.js @@ -220,7 +220,7 @@ class CameraWorker extends PureComponent { if (! goForTx || ! receiverUserId || doDiscard ){ return; } - if ( receiverUserId === this.props.currentUserId || ! amountToSendWithReply) { + if ( receiverUserId === this.props.currentUserId || ! Number(amountToSendWithReply)) { this.videoUploadedSuccessCallback(); return; }; From 250725e599b94960685524a526d6741520af285f Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Fri, 15 Nov 2019 12:31:00 +0530 Subject: [PATCH 068/302] default amount --- src/components/FanVideoDetails/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/FanVideoDetails/index.js b/src/components/FanVideoDetails/index.js index bd4e9221..e24fedfd 100644 --- a/src/components/FanVideoDetails/index.js +++ b/src/components/FanVideoDetails/index.js @@ -86,7 +86,7 @@ class FanVideoDetails extends Component { super(props); this.videoDesc = this.props.recordedVideo.video_desc; this.videoLink = this.props.recordedVideo.video_link; - this.replyAmount = this.props.recordedVideo.reply_amount; + this.replyAmount = this.props.recordedVideo.reply_amount || DEFAUT_BT_VALUE; this.priceOracle = pricer.getPriceOracle(); this.numberFormatter = new NumberFormatter(); this.state = { @@ -192,7 +192,7 @@ class FanVideoDetails extends Component { let params = {}; params['video_description'] = this.videoDesc; params['link'] = this.videoLink; - params['per_reply_amount_in_wei'] = this.replyAmount; + params['per_reply_amount_in_wei'] = pricer.getToDecimal(this.replyAmount); return new Promise((resolve, reject) => { new PepoApi(DataContract.replies.validatePost) .post(params) From 7a90a14df071178c661aec16488aefa2aa1af2c2 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Fri, 15 Nov 2019 12:50:27 +0530 Subject: [PATCH 069/302] Minor code fix --- src/components/FullScreenReplyCollection/VideoReplyRow.js | 4 ++-- src/components/FullScreenReplyCollection/index.js | 2 +- src/components/FullScreenVideoCollection/index.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index 9a5d2573..1f9bb4e7 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -21,8 +21,8 @@ import ReduxGetters from '../../services/ReduxGetters'; class VideoReplyRow extends PureComponent { constructor(props) { super(props); - this.userId = deepGet(this.props.item, 'payload.user_id'); - this.replyDetailId = deepGet(this.props.item,`payload.${DataContract.replies.replyDetailIdKey}`); + this.userId = deepGet(this.props.payload, 'user_id'); + this.replyDetailId = deepGet(this.props.payload,`${DataContract.replies.replyDetailIdKey}`); this.videoId = ReduxGetters.getReplyEntityId(this.replyDetailId); } diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index ed6640aa..a2f2ab68 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -200,7 +200,7 @@ class FullScreenReplyCollection extends PureComponent{ return ; } diff --git a/src/components/FullScreenVideoCollection/index.js b/src/components/FullScreenVideoCollection/index.js index af90a3f4..ab899f93 100644 --- a/src/components/FullScreenVideoCollection/index.js +++ b/src/components/FullScreenVideoCollection/index.js @@ -146,7 +146,7 @@ class FullScreenVideoCollection extends PureComponent{ return ; } From c4d0d2b2e6d11658bb801da7a6baaa3b26c58d35 Mon Sep 17 00:00:00 2001 From: Shraddha Date: Fri, 15 Nov 2019 13:04:21 +0530 Subject: [PATCH 070/302] report + numberInput validation --- .../CommonComponents/NumberInput/index.js | 98 ++++++++----------- .../CommonComponents/ReportVideo/index.js | 2 +- src/components/FanVideoDetails/index.js | 52 ++++++---- .../VideoReplyRow.js | 4 +- .../FullScreenVideoRow.js | 2 +- src/components/Home/HomeFeedRow.js | 2 +- .../UserVideoHistory/UserVideoHistoryRow.js | 2 +- src/constants/AppConfig.js | 3 +- 8 files changed, 82 insertions(+), 83 deletions(-) diff --git a/src/components/CommonComponents/NumberInput/index.js b/src/components/CommonComponents/NumberInput/index.js index 427d4fcf..01308e82 100644 --- a/src/components/CommonComponents/NumberInput/index.js +++ b/src/components/CommonComponents/NumberInput/index.js @@ -3,83 +3,65 @@ import {View,Text,TextInput} from 'react-native'; import NumberFormatter from '../../../helpers/NumberFormatter'; import { ostErrors } from '../../../services/OstErrors'; +import Theme from '../../../theme/styles'; export default class NumberInput extends PureComponent{ constructor( props ){ super( props ); - - this.min = 1; - this.max = 500; - if(props.min){ - this.min = props.min; - } - if(props.max){ - this.max = props.max - } this.state={ value : props.value, - errorMsg : "" - } + errorMsg : null + }; this.numberFormatter = new NumberFormatter(); - - } - isValidInput(val){ - let errorMsg = this.getErrorMessage(val); - if(errorMsg){ - this.props.onErrorCallBack(errorMsg); - this.setState({ - value: val, - valueError: errorMsg - }); - return false; - }else{ - this.setState({ - value: val, - valueError: "" - }); - return true; - } - - } - onChangeText(value) { - console.log("value",value) - let formattedVal = this.numberFormatter.convertToValidFormat(value) - , val = this.numberFormatter.getFullStopValue(formattedVal); - this.props.onChangeText(val); - if(this.isValidInput(value)){ - this.setState({value : val}); + validateAndSet(val){ + let errMsg = null; + if (!this.numberFormatter.isValidInputProvided(val)) { + errMsg = this.getErrorMessage( val ); } + this.setState({ + value: val, + valueError: errMsg + }); } getErrorMessage( val ){ - if (val && String(val).indexOf(',') > -1) { - return ostErrors.getUIErrorMessage('bt_amount_decimal_error'); - } - if (val && String(val).split('.')[1] && String(val).split('.')[1].length > 2) { - return ostErrors.getUIErrorMessage('bt_amount_decimal_allowed_error'); - } - val = val && Number(val); - if (!val || val < this.min) { - return ostErrors.getUIErrorMessage('bt_amount_error'); - } - if( val && val > this.max ){ - return ostErrors.getUIErrorMessage('bt_exceeds_bal_amount_error'); - } - - return undefined; + if (val && String(val).indexOf(',') > -1) { + return ostErrors.getUIErrorMessage('bt_amount_decimal_error'); + } + else if (val && String(val).split('.')[1] && String(val).split('.')[1].length > 2) { + return ostErrors.getUIErrorMessage('bt_amount_decimal_allowed_error'); + } else { + return "invalid input"; + } + } + + onChangeText(value) { + let formattedVal = this.numberFormatter.convertToValidFormat(value) + , val = this.numberFormatter.getFullStopValue(formattedVal) + ; + this.validateAndSet(value); + this.props.onChangeText && this.props.onChangeText(val); } render(){ return( - + + {this.onChangeText(value)}} - keyboardType = 'decimal-pad' - >{this.state.value} - + onChangeText={(value) => {this.onChangeText(value)}} + value = {this.props.value} + keyboardType = 'decimal-pad' + + /> + + { this.props.errorMsg || this.state.valueError } + + ) } } + + diff --git a/src/components/CommonComponents/ReportVideo/index.js b/src/components/CommonComponents/ReportVideo/index.js index 7560c9f8..5ea347ed 100644 --- a/src/components/CommonComponents/ReportVideo/index.js +++ b/src/components/CommonComponents/ReportVideo/index.js @@ -32,7 +32,7 @@ class ReportVideo extends PureComponent { reportVideo = () => { new PepoApi('/report') - .post({report_entity_kind: 'video', report_entity_id: this.props.videoId }) + .post({report_entity_kind: this.props.reportKind, report_entity_id: this.props.reportEntityId }) .then((response) => { if (response && response.success){ Toast.show({text:'Video reported successfully!', icon: 'success' }); diff --git a/src/components/FanVideoDetails/index.js b/src/components/FanVideoDetails/index.js index e24fedfd..0a6c9cb3 100644 --- a/src/components/FanVideoDetails/index.js +++ b/src/components/FanVideoDetails/index.js @@ -34,6 +34,8 @@ import NumberInput from "../CommonComponents/NumberInput"; import NumberFormatter from "../../helpers/NumberFormatter"; import pricer from '../../services/Pricer'; import PepoPinkIcon from '../../assets/pepo-tx-icon.png'; +import { ostErrors } from '../../services/OstErrors'; +import AppConfig from '../../constants/AppConfig' const mapStateToProps = (state, ownProps) => { return { @@ -42,7 +44,7 @@ const mapStateToProps = (state, ownProps) => { }; }; -const DEFAUT_BT_VALUE = 10; +const DEFAUT_BT_VALUE = AppConfig.default_bt_amt; class FanVideoDetails extends Component { static navigationOptions = ({ navigation }) => { @@ -89,6 +91,8 @@ class FanVideoDetails extends Component { this.replyAmount = this.props.recordedVideo.reply_amount || DEFAUT_BT_VALUE; this.priceOracle = pricer.getPriceOracle(); this.numberFormatter = new NumberFormatter(); + this.max = props.balance; + this.min = 0; this.state = { viewStyle: { paddingBottom: 10 @@ -97,7 +101,8 @@ class FanVideoDetails extends Component { amountError: null, linkError: null, descError : null, - usdVal : this.getUSDValue(DEFAUT_BT_VALUE) + usdVal : this.getUSDValue(DEFAUT_BT_VALUE), + replyAmt : null }; @@ -145,22 +150,35 @@ class FanVideoDetails extends Component { enableStartUploadFlag = () => { // if (!this.validLink()) return; - this.clearErrors(); - this.validateData().then((res) => { - utilities.saveItem(`${CurrentUser.getUserId()}-accepted-camera-t-n-c`, true); - Store.dispatch( - upsertRecordedVideo({ video_desc: this.videoDesc, + if(this.state.replyAmt > this.max){ + this.setState({ + amountError : `Maximum value is ${this.props.max}` + }) + }else if( this.state.replyAmt < this.min ){ + this.setState({ + amountError : `Minimum value is ${this.props.min}` + }) + }else{ + this.setState({ + amountError : "" + }) + this.clearErrors(); + this.validateData().then((res) => { + utilities.saveItem(`${CurrentUser.getUserId()}-accepted-camera-t-n-c`, true); + Store.dispatch( + upsertRecordedVideo({ video_desc: this.videoDesc, video_link: this.videoLink, reply_amount: pricer.getToDecimal(this.replyAmount), do_upload: true }) - ); - this.props.navigation.dispatch(StackActions.popToTop()); - this.props.navigation.dispatch(StackActions.popToTop()); - this.props.navigation.navigate('HomeScreen'); - }).catch((err)=>{ - // show error on UI. - this.showError(err); - }); + ); + this.props.navigation.dispatch(StackActions.popToTop()); + this.props.navigation.dispatch(StackActions.popToTop()); + this.props.navigation.navigate('HomeScreen'); + }).catch((err)=>{ + // show error on UI. + this.showError(err); + }); + } }; clearErrors = () => { @@ -266,7 +284,7 @@ class FanVideoDetails extends Component { }); this.setState({ usdVal : formattedUsdVal, - amountError : "" + replyAmt : value }); }; getUSDValue = (value ) =>{ @@ -311,8 +329,6 @@ class FanVideoDetails extends Component { diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index 1f9bb4e7..e191f143 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -56,8 +56,8 @@ class VideoReplyRow extends PureComponent { userId={this.userId} entityId={this.replyDetailId} /> - - + + - + - + - + Date: Fri, 15 Nov 2019 13:29:11 +0530 Subject: [PATCH 071/302] upload video fix --- src/components/FanVideoDetails/index.js | 7 +++++-- src/components/VideoReplies/index.js | 15 ++++++++++++--- src/services/CameraWorker.js | 2 +- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/components/FanVideoDetails/index.js b/src/components/FanVideoDetails/index.js index 0a6c9cb3..c0b1f2d0 100644 --- a/src/components/FanVideoDetails/index.js +++ b/src/components/FanVideoDetails/index.js @@ -106,7 +106,10 @@ class FanVideoDetails extends Component { }; - + if (! props.recordedVideo.video_type ) { + let videoType = this.props.navigation.getParam('video_type'); + Store.dispatch(upsertRecordedVideo({ video_type: videoType })); + } } _keyboardShown = (e) => { let keyboardHeight = deepGet(e, 'endCoordinates.height') || 350; @@ -168,7 +171,7 @@ class FanVideoDetails extends Component { Store.dispatch( upsertRecordedVideo({ video_desc: this.videoDesc, video_link: this.videoLink, - reply_amount: pricer.getToDecimal(this.replyAmount), + reply_amount: this.replyAmount, do_upload: true }) ); this.props.navigation.dispatch(StackActions.popToTop()); diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index 039f4a4a..13b96914 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -60,7 +60,6 @@ class VideoRepliesScreen extends PureComponent { this.state = { showBackdrop : false, videoUploaderVisible: false, - videoUploaderText: 'Posting reply', currentHeight : this.initialHeight } } @@ -105,11 +104,21 @@ class VideoRepliesScreen extends PureComponent { this.props.navigation.goBack(); } } , 10) - } + }; onCrossIconClick = () => { this._panel.hide(); + }; + + getUploadingText = () => { + let videoType = ReduxGetters.getRecordedVideoType(); + if (videoType === 'post'){ + return "Uploading Video"; + } else if (videoType === 'reply'){ + return "Posting reply"; } + } + ; openCamera = () => { let activeTab = NavigationService.getActiveTab(); @@ -148,7 +157,7 @@ class VideoRepliesScreen extends PureComponent { left: 10, zIndex: 9 }} - displayText={this.state.videoUploaderText} + displayText={this.getUploadingText()} extendDirection="right" extend={true} id={3} diff --git a/src/services/CameraWorker.js b/src/services/CameraWorker.js index 1d610542..dbe51a12 100644 --- a/src/services/CameraWorker.js +++ b/src/services/CameraWorker.js @@ -587,7 +587,7 @@ class CameraWorker extends PureComponent { image_width: appConfig.cameraConstants.VIDEO_WIDTH, image_height: appConfig.cameraConstants.VIDEO_HEIGHT, video_size: videoSize, - per_reply_amount_in_wei: String(this.props.recorded_video.reply_amount) + per_reply_amount_in_wei: pricer.getToDecimal(this.props.recorded_video.reply_amount) }; let payload = payloadWithoutImage; From ef071e64ee3e26928c34b775fd294474490f2dba Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Fri, 15 Nov 2019 13:31:30 +0530 Subject: [PATCH 072/302] remove log --- src/components/CaptureVideo/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/CaptureVideo/index.js b/src/components/CaptureVideo/index.js index 2db5ec99..077ec527 100644 --- a/src/components/CaptureVideo/index.js +++ b/src/components/CaptureVideo/index.js @@ -55,7 +55,6 @@ class CaptureVideo extends Component { setReplyVideoParams(){ this.isVideoTypeReply = this.props.navigation.getParam("videoTypeReply"); - console.log('setReplyVideoParams', this.isVideoTypeReply ); if (this.isVideoTypeReply){ this.replyReceiverUserId = this.props.navigation.getParam("userId"); this.replyReceiverVideoId = this.props.navigation.getParam("videoId"); From 5890a6beba4ea056af069e15969efa36a49c1620 Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Fri, 15 Nov 2019 15:39:38 +0530 Subject: [PATCH 073/302] Fan Video details price setup UI --- src/components/FanVideoDetails/index.js | 10 ++++++---- src/components/FanVideoDetails/styles.js | 8 +++++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/components/FanVideoDetails/index.js b/src/components/FanVideoDetails/index.js index c0b1f2d0..d71a5b32 100644 --- a/src/components/FanVideoDetails/index.js +++ b/src/components/FanVideoDetails/index.js @@ -322,25 +322,27 @@ class FanVideoDetails extends Component { {this.state.descError } - Link + Link {this.state.linkError } Set Price for replies - + - + ${this.state.usdVal} {this.state.amountError } - {this.state.error} diff --git a/src/components/FanVideoDetails/styles.js b/src/components/FanVideoDetails/styles.js index 246194d2..00ca04fd 100644 --- a/src/components/FanVideoDetails/styles.js +++ b/src/components/FanVideoDetails/styles.js @@ -81,7 +81,13 @@ let stylesMap = { flex:1, flexDirection:"row", justifyContent:'space-between', - alignItems:'center'} + alignItems:'center' + }, + errorStyle: { + width: 0, + flex: 0, + height: 0 + } }; export default styles = DefaultStyleGenerator.generate(stylesMap); From da98b24666afdd1acdae6f91469df9a3fab0036e Mon Sep 17 00:00:00 2001 From: Shraddha Date: Fri, 15 Nov 2019 16:08:21 +0530 Subject: [PATCH 074/302] bug fix --- src/components/CommonComponents/ReplyIcon/index.js | 3 ++- src/components/VideoReplies/index.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/CommonComponents/ReplyIcon/index.js b/src/components/CommonComponents/ReplyIcon/index.js index 175182b2..2ef8fe60 100644 --- a/src/components/CommonComponents/ReplyIcon/index.js +++ b/src/components/CommonComponents/ReplyIcon/index.js @@ -52,7 +52,8 @@ class ReplyIcon extends PureComponent { if ( this.props.videoReplyCount > 0 ) { this.props.navigation.push('VideoReplies', {'videoId': this.props.videoId , - 'userId': this.props.userId + 'userId': this.props.userId , + 'userName' : this.props.userName }); } else { let activeTab = NavigationService.getActiveTab(); diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index 13b96914..a6c441be 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -47,9 +47,9 @@ class VideoRepliesScreen extends PureComponent { super(props); this.userId = props.navigation.getParam('userId'); this.videoId = props.navigation.getParam('videoId'); + this.userName = props.navigation.getParam('userName'); this.amount = ReduxGetters.getBtAmountForReply(this.videoId ); this.videoReplyCount = ReduxGetters.getVideoReplyCount(this.videoId); - this.fetchUrl = DataContract.replies.getReplyListApi(this.videoId); this.initialHeight = height/1.5; this.animatedValue = new Animated.Value(this.initialHeight) ; From a192f77acbb712af318685e07e02da32c5e5f6c2 Mon Sep 17 00:00:00 2001 From: Shraddha Date: Fri, 15 Nov 2019 16:35:21 +0530 Subject: [PATCH 075/302] max min value fix --- src/components/FanVideoDetails/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/FanVideoDetails/index.js b/src/components/FanVideoDetails/index.js index d71a5b32..3ebf00e3 100644 --- a/src/components/FanVideoDetails/index.js +++ b/src/components/FanVideoDetails/index.js @@ -155,11 +155,11 @@ class FanVideoDetails extends Component { // if (!this.validLink()) return; if(this.state.replyAmt > this.max){ this.setState({ - amountError : `Maximum value is ${this.props.max}` + amountError : `Maximum value is ${this.max}` }) }else if( this.state.replyAmt < this.min ){ this.setState({ - amountError : `Minimum value is ${this.props.min}` + amountError : `Minimum value is ${this.min}` }) }else{ this.setState({ From a7644b255df21e52074d1d21a6e60b02e929fa8e Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Fri, 15 Nov 2019 16:44:04 +0530 Subject: [PATCH 076/302] fix --- src/components/FullScreenReplyCollection/index.js | 6 ++++-- src/components/VideoReplies/index.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index a2f2ab68..3f1ba3a8 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -12,6 +12,7 @@ import utilities from '../../services/Utilities'; import crossIcon from '../../assets/cross_icon.png'; import ReduxGetters from "../../services/ReduxGetters"; import entityHelper from "../../helpers/EntityHelper"; +import Pricer from "../../services/Pricer"; @@ -52,7 +53,8 @@ const HeaderLeft = (props) => { const HeaderTitle = (props) => { let userId = props.navigation.getParam('parentUserId'), - userName = ReduxGetters.getUserName(userId); + userName = ReduxGetters.getUserName(userId), + amount = props.navigation.getParam('amount') ; return ( @@ -60,7 +62,7 @@ const HeaderLeft = (props) => { Send a reply with{' '} - {props.navigation.getParam('amount')} + { Pricer.getToBT(Pricer.getFromDecimal(amount), 2)} ); }; diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index 13b96914..d1c9ba64 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -189,7 +189,7 @@ class VideoRepliesScreen extends PureComponent { - Replies to {this.userName} + Replies to {ReduxGetters.getUserName(this.userId)} {/* {TODO integration pending} */} Send a reply with{' '} From 311062dcdcaa3de61d5bb7edeac78d8fffa02168 Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Fri, 15 Nov 2019 16:45:12 +0530 Subject: [PATCH 077/302] fixes --- src/components/CaptureVideo/index.js | 56 ++++++++++--------- .../CommonComponents/ReplyIcon/index.js | 9 +-- src/components/CustomTab/index.js | 2 +- src/components/FanVideoReplyDetails/index.js | 2 - .../FullScreenReplyCollection/index.js | 15 ++--- src/components/ReplyCollection/index.js | 1 - src/components/VideoReplies/index.js | 11 ++-- src/constants/AppConfig.js | 7 ++- src/helpers/cameraHelper.js | 15 +++++ src/services/CameraWorker.js | 32 +++++++---- 10 files changed, 81 insertions(+), 69 deletions(-) create mode 100644 src/helpers/cameraHelper.js diff --git a/src/components/CaptureVideo/index.js b/src/components/CaptureVideo/index.js index 077ec527..f1c9ff3d 100644 --- a/src/components/CaptureVideo/index.js +++ b/src/components/CaptureVideo/index.js @@ -5,32 +5,24 @@ import Store from "../../store"; import {upsertRecordedVideo} from "../../actions"; import utilities from '../../services/Utilities'; import CurrentUser from '../../models/CurrentUser'; +import AppConfig from '../../constants/AppConfig'; -const VideoTypesConfig = { - 'post' : { - 'type': 'post' - }, - 'reply': { - 'type': 'reply' - } -}; - class CaptureVideo extends Component { static navigationOptions = { header: null }; constructor(props) { super(props); + let videoReplyCount = props.navigation.getParam("videoReplyCount"); this.state = { recordingScreen: true, videoUri: '', actionSheetOnRecordVideo: true, modalVisible: true, acceptedCameraTnC: null, - hasVideoReplies: false + hasVideoReplies: videoReplyCount && videoReplyCount > 0 }; - this.isVideoTypeReply = null; this.replyReceiverUserId = null; this.replyReceiverVideoId = null; this.amountToSendWithReply = null; @@ -46,7 +38,7 @@ class CaptureVideo extends Component { showCoachForVideoRecord() { const oThis = this; - if (! this.isVideoTypeReply) { + if (this.isVideoTypePost()) { utilities.getItem(`${CurrentUser.getUserId()}-accepted-camera-t-n-c`).then((terms) => { oThis.setState({ acceptedCameraTnC: terms }); }); @@ -54,17 +46,25 @@ class CaptureVideo extends Component { } setReplyVideoParams(){ - this.isVideoTypeReply = this.props.navigation.getParam("videoTypeReply"); - if (this.isVideoTypeReply){ + this.videoType = this.props.navigation.getParam("videoType"); + if (this.isVideoTypeReply()){ this.replyReceiverUserId = this.props.navigation.getParam("userId"); this.replyReceiverVideoId = this.props.navigation.getParam("videoId"); this.amountToSendWithReply = this.props.navigation.getParam("amount"); - this.setState({hasVideoReplies: this.props.navigation.getParam("videoReplyCount") > 0 }); + } else { // Do nothing. } } + isVideoTypePost(){ + return this.videoType === AppConfig.videoTypes.post; + } + + isVideoTypeReply = () => { + return this.videoType === AppConfig.videoTypes.reply; + } + goToRecordScreen() { this.setState({ recordingScreen: true, @@ -77,8 +77,7 @@ class CaptureVideo extends Component { proceedWithExistingVideo = (recordedVideoObj) => { this.proceedWithExisting = true; - this.videoType = recordedVideoObj.video_type || VideoTypesConfig.post.type; - this.isVideoTypeReply = this.videoType === VideoTypesConfig.reply.type; + this.videoType = recordedVideoObj.video_type || AppConfig.videoTypes.post ; this.setState ({ recordingScreen: false, videoUri: recordedVideoObj.raw_video @@ -88,7 +87,7 @@ class CaptureVideo extends Component { saveVideoPrimaryInfo = () => { this.proceedWithExisting = false; - this.videoType = this.isVideoTypeReply ? VideoTypesConfig.reply.type : VideoTypesConfig.post.type; + Store.dispatch(upsertRecordedVideo(this.getPrimaryVideoInfo())); }; @@ -96,16 +95,19 @@ class CaptureVideo extends Component { getPrimaryVideoInfo = () => { if (this.proceedWithExisting) return {}; - return this.videoType === VideoTypesConfig.reply.type ? - { video_type: VideoTypesConfig.reply.type, reply_obj: this.getReplyOptions()} : - { video_type: VideoTypesConfig.post.type }; + if (this.isVideoTypeReply()){ + return { video_type: AppConfig.videoTypes.reply , reply_obj: this.getReplyOptions()}; + } else if (this.isVideoTypePost()) { + return { video_type: AppConfig.videoTypes.post }; + } + }; goToDetailsScreen () { - if (this.videoType === VideoTypesConfig.post.type){ + if (this.videoType === AppConfig.videoTypes.post ){ this.props.navigation.push('FanVideoDetails', this.getPrimaryVideoInfo()); - } else if (this.videoType === VideoTypesConfig.reply.type){ + } else if (this.videoType === AppConfig.videoTypes.reply ){ this.props.navigation.push('FanVideoReplyDetails', this.getPrimaryVideoInfo()); } } @@ -113,7 +115,7 @@ class CaptureVideo extends Component { getReplyOptions(){ // Reply options are received to View when user click on Record video (Plus icon). let replyOptions = {}; - if ( this.isVideoTypeReply ) { + if ( this.isVideoTypeReply()) { replyOptions['replyReceiverUserId'] = this.replyReceiverUserId; replyOptions['replyReceiverVideoId'] = this.replyReceiverVideoId; replyOptions['amountToSendWithReply']= this.amountToSendWithReply; @@ -130,9 +132,9 @@ class CaptureVideo extends Component { }; getActionSheetText = (videoObject) => { - if (videoObject.video_type === VideoTypesConfig.reply.type){ + if (videoObject.video_type ===AppConfig.videoTypes.reply ){ return 'get language from UX'; - } else if (videoObject.video_type === VideoTypesConfig.post.type) { + } else if (videoObject.video_type === AppConfig.videoTypes.post ) { return 'You have already recorded video'; } }; @@ -159,7 +161,7 @@ class CaptureVideo extends Component { actionSheetOnRecordVideo={this.state.actionSheetOnRecordVideo} getActionSheetText={this.getActionSheetText} navigation={this.props.navigation} - isVideoTypeReply={this.isVideoTypeReply} + isVideoTypeReply={this.isVideoTypeReply()} hasVideoReplies={this.state.hasVideoReplies} videoId={this.replyReceiverVideoId} diff --git a/src/components/CommonComponents/ReplyIcon/index.js b/src/components/CommonComponents/ReplyIcon/index.js index 2ef8fe60..9ecdda04 100644 --- a/src/components/CommonComponents/ReplyIcon/index.js +++ b/src/components/CommonComponents/ReplyIcon/index.js @@ -14,6 +14,7 @@ import NavigationService from "../../../services/NavigationService"; import utilities from "../../../services/Utilities"; import { LoginPopoverActions } from '../../LoginPopover'; import Pricer from '../../../services/Pricer'; +import {getVideoReplyObject} from "../../../helpers/cameraHelper"; const mapStateToProps = (state , ownProps) => { return { @@ -57,13 +58,7 @@ class ReplyIcon extends PureComponent { }); } else { let activeTab = NavigationService.getActiveTab(); - let params = { - videoTypeReply: true, - videoId: this.props.videoId, - userId: this.props.userId, - amount: this.props.requiredPepo, - videoReplyCount: this.props.videoReplyCount - }; + let params = getVideoReplyObject(this.props.videoId, this.props.userId); utilities.handleVideoUploadModal(activeTab, this.props.navigation, params); } diff --git a/src/components/CustomTab/index.js b/src/components/CustomTab/index.js index af1acfa1..8e5277b7 100644 --- a/src/components/CustomTab/index.js +++ b/src/components/CustomTab/index.js @@ -42,7 +42,7 @@ let refreshTimeOut = 0; function loginInFlow(navigation, tab) { let currentTabIndex = tab.navigationIndex; if (tab.rootStack === 'CaptureVideo') { - utilities.handleVideoUploadModal(previousTabIndex, navigation); + utilities.handleVideoUploadModal(previousTabIndex, navigation, {videoType: appConfig.videoTypes.post }); return; } if (currentTabIndex == undefined || currentTabIndex == null) return; diff --git a/src/components/FanVideoReplyDetails/index.js b/src/components/FanVideoReplyDetails/index.js index 6c251329..0163b773 100644 --- a/src/components/FanVideoReplyDetails/index.js +++ b/src/components/FanVideoReplyDetails/index.js @@ -89,8 +89,6 @@ class FanVideoReplyDetails extends Component { this.replyObject = props.recordedVideo.reply_obj; } - - console.log(this.replyObject, 'this.replyObject:::this.replyObject:::this.replyObject'); this.state = { viewStyle: { paddingBottom: 10 diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index 3f1ba3a8..e5e76ece 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -12,20 +12,14 @@ import utilities from '../../services/Utilities'; import crossIcon from '../../assets/cross_icon.png'; import ReduxGetters from "../../services/ReduxGetters"; import entityHelper from "../../helpers/EntityHelper"; +import {getVideoReplyObject} from "../../helpers/cameraHelper"; import Pricer from "../../services/Pricer"; const navigateToCamera = (navigation) => { let activeTab = NavigationService.getActiveTab(); - let params = { - videoTypeReply: true, - videoId: navigation.getParam('parentVideoId'), - userId: navigation.getParam('parentUserId'), - amount: navigation.getParam('amount'), - videoReplyCount: navigation.getParam('videoReplyCount') - }; - console.log('params:::VideoRepliesFullScreen', params); + let params = getVideoReplyObject ( navigation.getParam('parentVideoId') , navigation.getParam('parentUserId')); utilities.handleVideoUploadModal(activeTab, navigation, params); }; @@ -53,8 +47,7 @@ const HeaderLeft = (props) => { const HeaderTitle = (props) => { let userId = props.navigation.getParam('parentUserId'), - userName = ReduxGetters.getUserName(userId), - amount = props.navigation.getParam('amount') ; + userName = ReduxGetters.getUserName(userId); return ( @@ -62,7 +55,7 @@ const HeaderLeft = (props) => { Send a reply with{' '} - { Pricer.getToBT(Pricer.getFromDecimal(amount), 2)} + { Pricer.getToBT(Pricer.getFromDecimal(props.navigation.getParam('amount')), 2)} ); }; diff --git a/src/components/ReplyCollection/index.js b/src/components/ReplyCollection/index.js index 2c1ba6e8..8ed17674 100644 --- a/src/components/ReplyCollection/index.js +++ b/src/components/ReplyCollection/index.js @@ -218,7 +218,6 @@ class ReplyCollection extends PureComponent { "currentIndex": index, "baseUrl": this.props.fetchUrl, "amount": this.props.amount, - "videoReplyCount": this.props.videoReplyCount, 'parentUserId': this.props.userId, 'parentVideoId': this.props.videoId }); diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index ff00be95..2f701e51 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -27,6 +27,8 @@ import { getInset } from 'react-native-safe-area-view'; import DataContract from '../../constants/DataContract'; import ReduxGetters from '../../services/ReduxGetters'; import Pricer from "../../services/Pricer"; +import {getVideoReplyObject} from "../../helpers/cameraHelper"; + const { width, height } = Dimensions.get('window'); const landScape = width > height; const topPadding = getInset('top', landScape); @@ -50,6 +52,7 @@ class VideoRepliesScreen extends PureComponent { this.userName = props.navigation.getParam('userName'); this.amount = ReduxGetters.getBtAmountForReply(this.videoId ); this.videoReplyCount = ReduxGetters.getVideoReplyCount(this.videoId); + this.userName = ReduxGetters.getUserName(this.userId); this.fetchUrl = DataContract.replies.getReplyListApi(this.videoId); this.initialHeight = height/1.5; this.animatedValue = new Animated.Value(this.initialHeight) ; @@ -123,13 +126,7 @@ class VideoRepliesScreen extends PureComponent { openCamera = () => { let activeTab = NavigationService.getActiveTab(); //TODO @mayur move it to a function , If possible change this to string - let params = { - videoTypeReply: true, - videoId: this.videoId, - userId: this.userId, - amount: this.amount, - videoReplyCount: this.videoReplyCount - }; + let params = getVideoReplyObject ( this.videoId , this.userId) ; utilities.handleVideoUploadModal(activeTab, this.props.navigation, params); } diff --git a/src/constants/AppConfig.js b/src/constants/AppConfig.js index e74ffa55..f8a1498f 100644 --- a/src/constants/AppConfig.js +++ b/src/constants/AppConfig.js @@ -298,6 +298,11 @@ export default { AuthDeviceDrawer: 'DeviceUnauthorized', TwitterLogin: 'TwitterLogin' }, - default_bt_amt : 10 + default_bt_amt : 10, + + videoTypes: { + post : 'post', + reply: 'reply' + } }; diff --git a/src/helpers/cameraHelper.js b/src/helpers/cameraHelper.js new file mode 100644 index 00000000..daddc05d --- /dev/null +++ b/src/helpers/cameraHelper.js @@ -0,0 +1,15 @@ +import reduxGetter from "../services/ReduxGetters"; +import AppConfig from '../constants/AppConfig' + +let getVideoReplyObject = (videoId, creatorUserId) => { + return { + videoType : AppConfig.videoTypes.reply, + videoId: videoId, + userId: creatorUserId, + amount: reduxGetter.getBtAmountForReply(videoId), + videoReplyCount: reduxGetter.getVideoReplyCount(videoId) + }; +}; + + +export { getVideoReplyObject } diff --git a/src/services/CameraWorker.js b/src/services/CameraWorker.js index dbe51a12..03e105d0 100644 --- a/src/services/CameraWorker.js +++ b/src/services/CameraWorker.js @@ -99,6 +99,16 @@ class CameraWorker extends PureComponent { } } + VideoUploadStatusToProcessing = () => { + Store.dispatch(videoInProcessing(true)); + videoUploaderComponent.emit('show'); + }; + + VideoUploadStatusToNotProcessing = () => { + Store.dispatch(videoInProcessing(false)); + videoUploaderComponent.emit('hide'); + }; + async processVideo() { // Early exit if ( ! this.props.currentUserId || Object.keys(this.props.recorded_video).length === 0) { @@ -125,7 +135,9 @@ class CameraWorker extends PureComponent { } if (this.props.recorded_video.do_upload) { - !ReduxGetters.getVideoProcessingStatus() && Store.dispatch(videoInProcessing(true)); + if (!ReduxGetters.getVideoProcessingStatus()) { + this.VideoUploadStatusToProcessing(); + } console.log( 'processVideo :: Got upload consent. Uploading video and cover image to s3 and attempting post Video with Cover Image...' @@ -185,8 +197,7 @@ class CameraWorker extends PureComponent { onFlowInterrupt = (ostWorkflowContext, error) => { console.log('CameraWorker.onFlowInterrupt', ostWorkflowContext, error); - videoUploaderComponent.emit('hide'); - Store.dispatch(videoInProcessing(false)); + this.VideoUploadStatusToNotProcessing(); Toast.show({ text: ostSdkErrors.getErrorMessage(ostWorkflowContext, error), icon: 'error' @@ -224,7 +235,7 @@ class CameraWorker extends PureComponent { this.videoUploadedSuccessCallback(); return; }; - videoUploaderComponent.emit('show'); + this.VideoUploadStatusToProcessing(); console.log('CameraWorker.executeTransaction'); @@ -333,8 +344,7 @@ class CameraWorker extends PureComponent { text: responseData.err.msg, icon: 'error' }); - videoUploaderComponent.emit('hide'); - Store.dispatch(videoInProcessing(false)); + this.VideoUploadStatusToNotProcessing(); } this.postToPepoApi = false; }) @@ -355,8 +365,7 @@ class CameraWorker extends PureComponent { async cleanUp() { // stop ffmpge processing - videoUploaderComponent.emit('hide'); - Store.dispatch(videoInProcessing(false)); + this.VideoUploadStatusToNotProcessing(); FfmpegProcesser.cancel(); // remove files from cache, await this.removeFile(this.props.recorded_video.raw_video); @@ -431,7 +440,7 @@ class CameraWorker extends PureComponent { compression_processing: true }) ); - videoUploaderComponent.emit('show'); + this.VideoUploadStatusToProcessing(); FfmpegProcesser.init(this.props.recorded_video.raw_video); FfmpegProcesser.compress() @@ -495,7 +504,7 @@ class CameraWorker extends PureComponent { video_s3_upload_processing: true }) ); - videoUploaderComponent.emit('show'); + this.VideoUploadStatusToProcessing(); this.uploadToS3(this.props.recorded_video.compressed_video, 'video') .then((s3Video) => { console.log('uploadVideo success :: s3Video', s3Video); @@ -617,8 +626,7 @@ class CameraWorker extends PureComponent { }) ); } else { - videoUploaderComponent.emit('hide'); - Store.dispatch(videoInProcessing(false)); + this.VideoUploadStatusToNotProcessing(); } this.postToPepoApi = false; }) From dc3571748ba2b0bdaa75b22b0c2ce0437ab4467d Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Fri, 15 Nov 2019 19:17:36 +0530 Subject: [PATCH 078/302] camera fixes --- .../CommonComponents/NumberInput/index.js | 2 +- src/components/FanVideoDetails/index.js | 22 ++++++++++--------- src/services/CameraWorker.js | 8 ++++--- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/components/CommonComponents/NumberInput/index.js b/src/components/CommonComponents/NumberInput/index.js index 01308e82..15fc3b13 100644 --- a/src/components/CommonComponents/NumberInput/index.js +++ b/src/components/CommonComponents/NumberInput/index.js @@ -51,7 +51,7 @@ export default class NumberInput extends PureComponent{ {this.onChangeText(value)}} - value = {this.props.value} + value = {String(this.props.value)} keyboardType = 'decimal-pad' /> diff --git a/src/components/FanVideoDetails/index.js b/src/components/FanVideoDetails/index.js index 3ebf00e3..0f0e4bcd 100644 --- a/src/components/FanVideoDetails/index.js +++ b/src/components/FanVideoDetails/index.js @@ -80,7 +80,7 @@ class FanVideoDetails extends Component { static saveToRedux = (navigation) => { let desc = navigation.state.params.videoDesc, link = navigation.state.params.videoLink, - amount = pricer.getToDecimal(navigation.state.params.replyAmount); + amount = navigation.state.params.replyAmount; Store.dispatch(upsertRecordedVideo({ video_desc: desc, video_link: link, reply_amount:amount })); }; @@ -88,7 +88,7 @@ class FanVideoDetails extends Component { super(props); this.videoDesc = this.props.recordedVideo.video_desc; this.videoLink = this.props.recordedVideo.video_link; - this.replyAmount = this.props.recordedVideo.reply_amount || DEFAUT_BT_VALUE; + this.replyAmount = this.props.recordedVideo.reply_amount || pricer.getToDecimal(DEFAUT_BT_VALUE); this.priceOracle = pricer.getPriceOracle(); this.numberFormatter = new NumberFormatter(); this.max = props.balance; @@ -101,7 +101,7 @@ class FanVideoDetails extends Component { amountError: null, linkError: null, descError : null, - usdVal : this.getUSDValue(DEFAUT_BT_VALUE), + usdVal : this.weiToUSD(this.replyAmount), replyAmt : null }; @@ -213,7 +213,7 @@ class FanVideoDetails extends Component { let params = {}; params['video_description'] = this.videoDesc; params['link'] = this.videoLink; - params['per_reply_amount_in_wei'] = pricer.getToDecimal(this.replyAmount); + params['per_reply_amount_in_wei'] = this.replyAmount; return new Promise((resolve, reject) => { new PepoApi(DataContract.replies.validatePost) .post(params) @@ -279,8 +279,8 @@ class FanVideoDetails extends Component { } replyAmountChange = ( value )=>{ - this.replyAmount = value; - let formattedUsdVal = this.getUSDValue( value ); + this.replyAmount = pricer.getToDecimal(value); + let formattedUsdVal = this.weiToUSD( pricer.getToDecimal(value) ); //Done for the value to be accessible in static navigationOptions this.props.navigation.setParams({ replyAmount: value @@ -290,14 +290,16 @@ class FanVideoDetails extends Component { replyAmt : value }); }; - getUSDValue = (value ) =>{ - let usdVal = this.priceOracle.btToFiat(value), + weiToUSD = (value ) =>{ + let weiToBt = pricer.getFromDecimal(value, 2), + usdVal = this.priceOracle.btToFiat(weiToBt), formattedUsdVal = this.numberFormatter.getFormattedValue( usdVal ); return formattedUsdVal; } render() { - let imageUrl = this.props.recordedVideo.cover_image; + let imageUrl = this.props.recordedVideo.cover_image, + value = pricer.getFromDecimal(this.replyAmount, 2) ; return ( { - Store.dispatch(videoInProcessing(true)); - videoUploaderComponent.emit('show'); + if (this.props.recorded_video.do_upload){ + Store.dispatch(videoInProcessing(true)); + videoUploaderComponent.emit('show'); + }; }; VideoUploadStatusToNotProcessing = () => { @@ -596,7 +598,7 @@ class CameraWorker extends PureComponent { image_width: appConfig.cameraConstants.VIDEO_WIDTH, image_height: appConfig.cameraConstants.VIDEO_HEIGHT, video_size: videoSize, - per_reply_amount_in_wei: pricer.getToDecimal(this.props.recorded_video.reply_amount) + per_reply_amount_in_wei: this.props.recorded_video.reply_amount }; let payload = payloadWithoutImage; From 9caba4adf498d54aaa9a73e6c542e4e9e175e242 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Fri, 15 Nov 2019 19:22:21 +0530 Subject: [PATCH 079/302] add deeplinking of reply videos --- RootNavigationContainer.js | 2 + .../DeletedVideoInfo/index.js | 24 +++++ .../DeletedVideoInfo/styles.js | 43 ++++++++ .../CommonComponents/VideoPlayer/index.js | 11 +- .../VideoReplyPlayer/index.js | 101 ++++++++++++++++++ .../VideoReplyPlayer/styles.js | 43 ++++++++ .../VideoReplyRow.js | 32 +++--- .../FullScreenReplyCollection/index.js | 6 +- .../FullScreenVideoCollection/index.js | 7 +- .../PepoTransactionButton/ReplyPepoTxBtn.js | 2 +- src/constants/AppConfig.js | 4 + src/helpers/navigateTo.js | 17 +++ src/services/ReduxGetters.js | 6 +- 13 files changed, 268 insertions(+), 30 deletions(-) create mode 100644 src/components/CommonComponents/DeletedVideoInfo/index.js create mode 100644 src/components/CommonComponents/DeletedVideoInfo/styles.js create mode 100644 src/components/CommonComponents/VideoReplyPlayer/index.js create mode 100644 src/components/CommonComponents/VideoReplyPlayer/styles.js diff --git a/RootNavigationContainer.js b/RootNavigationContainer.js index 4b6deeb4..5bb45afc 100644 --- a/RootNavigationContainer.js +++ b/RootNavigationContainer.js @@ -61,6 +61,7 @@ import VideoTags from './src/components/VideoTags'; import FullScreenVideoCollection from './src/components/FullScreenVideoCollection'; import VideoReplies from './src/components/VideoReplies'; import FullScreenReplyCollection from './src/components/FullScreenReplyCollection'; +import VideoReplyPlayer from './src/components/CommonComponents/VideoReplyPlayer'; const customTabHiddenRoutes = [ 'CaptureVideo', @@ -187,6 +188,7 @@ const NotificationPushStack = createStackNavigator( UsersProfileScreen: UsersProfileScreen, UserVideoHistory: UserVideoHistory, VideoPlayer: VideoPlayer, + VideoReplyPlayer: VideoReplyPlayer, SupportingListScreen: SupportingListScreen, SupportersListScreen: SupportersListScreen, VideoTags: VideoTags, diff --git a/src/components/CommonComponents/DeletedVideoInfo/index.js b/src/components/CommonComponents/DeletedVideoInfo/index.js new file mode 100644 index 00000000..7e9dc395 --- /dev/null +++ b/src/components/CommonComponents/DeletedVideoInfo/index.js @@ -0,0 +1,24 @@ +import React, {PureComponent} from 'react'; +import {TouchableOpacity, View, Image, Text} from 'react-native'; +import {withNavigation} from 'react-navigation'; + +import video_not_available from '../../../assets/video-not-available.png'; +import historyBack from "../../../assets/user-video-history-back-icon.png"; + +class DeletedVideoInfo extends PureComponent{ + constructor(props){ + super(props); + } + + render(){ + return ( + this.props.navigation.goBack()} style={inlineStyles.historyBackSkipFont}> + + + + Looks like the Video you were looking for isn’t available and might have been deleted by the creator! + ); + } +} + +export default withNavigation(DeletedVideoInfo); \ No newline at end of file diff --git a/src/components/CommonComponents/DeletedVideoInfo/styles.js b/src/components/CommonComponents/DeletedVideoInfo/styles.js new file mode 100644 index 00000000..00b62fe2 --- /dev/null +++ b/src/components/CommonComponents/DeletedVideoInfo/styles.js @@ -0,0 +1,43 @@ +import DefaultStyleGenerator from '../../../theme/styles/DefaultStyleGenerator'; +import {ifIphoneX} from "react-native-iphone-x-helper"; +import Colors from '../../../theme/styles/Colors'; + +let stylesMap = { + + container: { + flex: 1, + alignItems: 'center', + justifyContent: 'center', + backgroundColor: Colors.snow + }, + + imgSizeSkipFont: { + width: 68.5, + height: 68.5 + }, + + desc:{ + fontSize: 22, + marginTop: 10, + textAlign: 'center', + paddingHorizontal: 25, + color: Colors.valhalla, + fontFamily: 'AvenirNext-Regular' + }, + + historyBackSkipFont:{ + ...ifIphoneX({ + top: 55, + }, { + top: 25, + }), + width: 29, + height: 34, + position: 'absolute', + left: 10, + alignItems: 'center', + justifyContent: 'center' + } +}; + +export default styles = DefaultStyleGenerator.generate(stylesMap); diff --git a/src/components/CommonComponents/VideoPlayer/index.js b/src/components/CommonComponents/VideoPlayer/index.js index 54f45261..04192fd9 100644 --- a/src/components/CommonComponents/VideoPlayer/index.js +++ b/src/components/CommonComponents/VideoPlayer/index.js @@ -6,10 +6,9 @@ import deepGet from "lodash/get"; import PepoApi from "../../../services/PepoApi"; import inlineStyles from './styles' import historyBack from "../../../assets/user-video-history-back-icon.png"; -import video_not_available from '../../../assets/video-not-available.png'; import Utilities from '../../../services/Utilities'; -import CurrentUser from '../../../models/CurrentUser'; import reduxGetter from '../../../services/ReduxGetters'; +import DeletedVideoInfo from '../DeletedVideoInfo'; class VideoPlayer extends Component { @@ -75,13 +74,7 @@ class VideoPlayer extends Component { render() { if(this.state.isDeleted){ // {TODO @Preshita move to common component } - return - this.props.navigation.goBack()} style={inlineStyles.historyBackSkipFont}> - - - - Looks like the Video you were looking for isn’t available and might have been deleted by the creator! - + return }else{ return ( diff --git a/src/components/CommonComponents/VideoReplyPlayer/index.js b/src/components/CommonComponents/VideoReplyPlayer/index.js new file mode 100644 index 00000000..800aace8 --- /dev/null +++ b/src/components/CommonComponents/VideoReplyPlayer/index.js @@ -0,0 +1,101 @@ +import React, { PureComponent } from 'react'; +import {View,Image,TouchableOpacity} from 'react-native'; +import VideoRowComponent from "../../UserVideoHistory/UserVideoHistoryRow"; +import TopStatus from "../../Home/TopStatus"; +import deepGet from "lodash/get"; +import PepoApi from "../../../services/PepoApi"; +import inlineStyles from './styles' +import historyBack from "../../../assets/user-video-history-back-icon.png"; +import Utilities from '../../../services/Utilities'; +import reduxGetter from '../../../services/ReduxGetters'; +import ReduxGetters from '../../../services/ReduxGetters'; +import DataContract from '../../../constants/DataContract'; +import DeletedVideoInfo from '../DeletedVideoInfo'; +import VideoReplyRow from '../../FullScreenReplyCollection/VideoReplyRow'; + +class VideoReplyPlayer extends PureComponent { + + static navigationOptions = ({navigation, navigationOptions}) => { + return { + headerBackTitle: null, + header: null + }; + }; + + constructor(props){ + super(props); + this.replyDetailId = this.props.navigation.getParam('replyDetailId'); + this.videoId = ReduxGetters.getReplyEntityId(this.replyDetailId); //Check for entity deleted + this.state = { + userId : this.props.navigation.getParam('userId') || null, + isDeleted : reduxGetter.isVideoEntityDeleted(this.videoId) + }; + this.refetchVideo(); + this.isActiveScreen = true; + } + + componentDidMount(){ + this.willFocusSubscription = this.props.navigation.addListener('willFocus', (payload) => { + this.isActiveScreen = true ; + }); + + this.willBlurSubscription = this.props.navigation.addListener('willBlur', (payload) => { + this.isActiveScreen = false ; + }); + } + + componentWillUnmount(){ + this.onRefetchVideo = () => {}; + this.willFocusSubscription && this.willFocusSubscription.remove(); + this.willBlurSubscription && this.willBlurSubscription.remove(); + } + + shouldPlay = () => { + return this.isActiveScreen; + }; + + refetchVideo = () => { + if (this.state.isDeleted) return; + new PepoApi(DataContract.replies.getSingleVideoReplyApi(this.replyDetailId)) + .get() + .then((res) => { this.onRefetchVideo(res) }) + .catch((error) => {}); + }; + + onRefetchVideo = ( res ) => { + if(Utilities.isEntityDeleted(res)){ + this.setState({isDeleted: true}); + return; + } + const users = deepGet(res , "data.users") || {} , + userKeys = Object.keys(users) || [] , + userId = userKeys[0] || null; + if(userId){ + this.setState({ userId : userId}); + } + }; + + render() { + if(this.state.isDeleted){ + return + }else{ + return ( + + + + {/* // {TODO @Preshita move to common component } */} + this.props.navigation.goBack()} style={inlineStyles.historyBackSkipFont}> + + + + ) + } + } +} + +export default VideoReplyPlayer ; diff --git a/src/components/CommonComponents/VideoReplyPlayer/styles.js b/src/components/CommonComponents/VideoReplyPlayer/styles.js new file mode 100644 index 00000000..00b62fe2 --- /dev/null +++ b/src/components/CommonComponents/VideoReplyPlayer/styles.js @@ -0,0 +1,43 @@ +import DefaultStyleGenerator from '../../../theme/styles/DefaultStyleGenerator'; +import {ifIphoneX} from "react-native-iphone-x-helper"; +import Colors from '../../../theme/styles/Colors'; + +let stylesMap = { + + container: { + flex: 1, + alignItems: 'center', + justifyContent: 'center', + backgroundColor: Colors.snow + }, + + imgSizeSkipFont: { + width: 68.5, + height: 68.5 + }, + + desc:{ + fontSize: 22, + marginTop: 10, + textAlign: 'center', + paddingHorizontal: 25, + color: Colors.valhalla, + fontFamily: 'AvenirNext-Regular' + }, + + historyBackSkipFont:{ + ...ifIphoneX({ + top: 55, + }, { + top: 25, + }), + width: 29, + height: 34, + position: 'absolute', + left: 10, + alignItems: 'center', + justifyContent: 'center' + } +}; + +export default styles = DefaultStyleGenerator.generate(stylesMap); diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index e191f143..59bf9019 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -16,18 +16,13 @@ import ReplyVideoBottomStatus from '../BottomStatus/ReplyVideoBottomStatus'; import DataContract from '../../constants/DataContract'; import ReduxGetters from '../../services/ReduxGetters'; - - class VideoReplyRow extends PureComponent { constructor(props) { super(props); - this.userId = deepGet(this.props.payload, 'user_id'); - this.replyDetailId = deepGet(this.props.payload,`${DataContract.replies.replyDetailIdKey}`); - this.videoId = ReduxGetters.getReplyEntityId(this.replyDetailId); } refetchVideoReply = () => { - new PepoApi(`/replies/${this.replyDetailId}`) + new PepoApi(`/replies/${this.props.replyDetailId}`) .get() .then((res) => {}) .catch((error) => {}); @@ -36,39 +31,42 @@ class VideoReplyRow extends PureComponent { //Required from Backend , we need video stats entity render() { + let userId = this.props.userId, + replyDetailId = this.props.replyDetailId, + videoId = ReduxGetters.getReplyEntityId(replyDetailId); return ( - {!!this.videoId && !!this.userId && ( + {!!videoId && !!userId && ( - - + + )} diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index e5e76ece..2ce52786 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -14,6 +14,7 @@ import ReduxGetters from "../../services/ReduxGetters"; import entityHelper from "../../helpers/EntityHelper"; import {getVideoReplyObject} from "../../helpers/cameraHelper"; import Pricer from "../../services/Pricer"; +import DataContract from "../../constants/DataContract"; @@ -192,10 +193,13 @@ class FullScreenReplyCollection extends PureComponent{ }; _renderVideoReplyRow(item, index){ + let userId = deepGet(item,'payload.user_id'), + replyDetailId = deepGet(item,`payload.${DataContract.replies.replyDetailIdKey}`); return ; } diff --git a/src/components/FullScreenVideoCollection/index.js b/src/components/FullScreenVideoCollection/index.js index ab899f93..e565f113 100644 --- a/src/components/FullScreenVideoCollection/index.js +++ b/src/components/FullScreenVideoCollection/index.js @@ -1,6 +1,7 @@ import React , {PureComponent} from "react"; import {FlatList , View , TouchableOpacity, Image} from "react-native"; import deepGet from "lodash/get"; + import reduxGetters from "../../services/ReduxGetters"; import Pagination from "../../services/Pagination"; import FullScreenVideoRow from "./FullScreenVideoRow"; @@ -9,6 +10,7 @@ import historyBack from '../../assets/user-video-history-back-icon.png'; import TopStatus from "../Home/TopStatus"; import CommonStyle from "../../theme/styles/Common"; import entityHelper from '../../helpers/EntityHelper'; +import DataContract from "../../constants/DataContract"; const maxVideosThreshold = 3; @@ -143,10 +145,13 @@ class FullScreenVideoCollection extends PureComponent{ }; _renderVideoReplyRow(item, index){ + let userId = deepGet(item,'payload.user_id'), + replyDetailId = deepGet(item,`payload.${DataContract.replies.replyDetailIdKey}`); return ; } diff --git a/src/components/PepoTransactionButton/ReplyPepoTxBtn.js b/src/components/PepoTransactionButton/ReplyPepoTxBtn.js index 1e38e025..79e476fc 100644 --- a/src/components/PepoTransactionButton/ReplyPepoTxBtn.js +++ b/src/components/PepoTransactionButton/ReplyPepoTxBtn.js @@ -53,7 +53,7 @@ class ReplyPepoTxBtn extends Base { updateEntity = false ; if (totalBt && totalBt > 0) { - videoStats['total_amount_raised_in_wei'] = Pricer.getToDecimal(totalBt); + replyDetails['total_amount_raised_in_wei'] = Pricer.getToDecimal(totalBt); updateEntity = true; } diff --git a/src/constants/AppConfig.js b/src/constants/AppConfig.js index f8a1498f..45163601 100644 --- a/src/constants/AppConfig.js +++ b/src/constants/AppConfig.js @@ -35,6 +35,10 @@ export default { deleted: 'deleted' }, + replyStatusMap:{ + deleted: 'deleted' + }, + deviceStatusMap: { registered: 'registered', authorizing: 'authorizing', diff --git a/src/helpers/navigateTo.js b/src/helpers/navigateTo.js index 3d6c0206..c2f54e01 100644 --- a/src/helpers/navigateTo.js +++ b/src/helpers/navigateTo.js @@ -41,6 +41,8 @@ class NavigateTo { this.goToSupporters(goToObject.v.puid, payload); } else if (goToObject && goToObject.pn === 'v') { this.goToVideo(goToObject.v.vid, payload); + }else if (goToObject && goToObject.pn === 'rd') { + this.goToVideoReply(goToObject.v.rdi, payload); } else if (goToObject && goToObject.pn === 'f') { this.__navigate('Home', payload); } else if (goToObject && goToObject.pn === 'nc') { @@ -122,6 +124,21 @@ class NavigateTo { }, timeOut) }; + goToVideoReply = (rdId, payload) => { + let timeOut = 0 ; + payload = payload || {}; + payload['replyDetailId'] = rdId; + if(NavigationService.getActiveTab() != "Notification"){ + timeOut = 100; + this.__navigate('NotificationScreen', payload); + } + //Once migrated to react-navigation version 4 remove the settimeout code + //as version 3 dosent provides navigation chaining. + setTimeout(()=> { + this.__push('VideoReplyPlayer', payload); + }, timeOut) + }; + goToSupportings = (profileId, payload) => { payload = payload || {}; payload['userId'] = profileId; diff --git a/src/services/ReduxGetters.js b/src/services/ReduxGetters.js index 0e3da064..cfa865e5 100644 --- a/src/services/ReduxGetters.js +++ b/src/services/ReduxGetters.js @@ -436,7 +436,7 @@ class ReduxGetters { isVideoDeleted(id, state) { state = state || Store.getState(); - return deepGet(state, `video_entities.id_${id}.status`, '').toLowerCase() == appConfig.videoStatusMap.deleted; + return deepGet(state, `video_stat_entities.id_${id}.status`, '').toLowerCase() == appConfig.videoStatusMap.deleted; } getUSDPrice(state){ @@ -502,6 +502,10 @@ class ReduxGetters { return !!val; } + isVideoEntityDeleted(id, state) { + state = state || Store.getState(); + return deepGet(state, `reply_detail_entities.id_${id}.status`, '').toLowerCase() == appConfig.replyStatusMap.deleted; + } } export default new ReduxGetters(); From ac26c09d9d7714e93fed258160d55e3cefe4aa2c Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Tue, 19 Nov 2019 12:42:11 +0530 Subject: [PATCH 080/302] executing tx --- src/services/CameraWorker.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/services/CameraWorker.js b/src/services/CameraWorker.js index 43d74822..b2670a70 100644 --- a/src/services/CameraWorker.js +++ b/src/services/CameraWorker.js @@ -23,9 +23,6 @@ import videoUploaderComponent from './CameraWorkerEventEmitter'; import createObjectForRedux from '../helpers/createObjectForRedux'; import Toast from '../theme/components/NotificationToast'; import CurrentUser from '../models/CurrentUser'; -import {ensureDeivceAndSession, ON_USER_CANCLLED_ERROR_MSG} from "../helpers/TransactionHelper"; -import pricer from "./Pricer"; -import {VideoPlayPauseEmitter} from "../helpers/Emitters"; import DataContract from "../constants/DataContract"; import {TransactionExecutor} from './TransactionExecutor'; import { ostSdkErrors } from '../services/OstSdkErrors'; @@ -192,7 +189,8 @@ class CameraWorker extends PureComponent { Store.dispatch( upsertRecordedVideo({ do_discard: true, - pepo_api_posting: false + pepo_api_posting: false, + executing_tx: false }) ); }; @@ -217,7 +215,7 @@ class CameraWorker extends PureComponent { return ; } - let details = `vi_${parentVideoId}`; + let details = `vi_${parentVideoId} `; details += `rdi_${replyDetailId}`; metaProperties['details'] = details; return metaProperties; @@ -228,15 +226,19 @@ class CameraWorker extends PureComponent { let goForTx = this.props.recorded_video.go_for_tx, doDiscard = this.props.recorded_video.do_discard, + executingTx = this.props.recorded_video.executing_tx, receiverUserId = deepGet (this.props.recorded_video, 'reply_obj.replyReceiverUserId'), amountToSendWithReply = deepGet(this.props.recorded_video, 'reply_obj.amountToSendWithReply'); - if (! goForTx || ! receiverUserId || doDiscard ){ + if (! goForTx || ! receiverUserId || doDiscard || executingTx ){ return; } if ( receiverUserId === this.props.currentUserId || ! Number(amountToSendWithReply)) { this.videoUploadedSuccessCallback(); return; }; + upsertRecordedVideo({ + executing_tx: true + }); this.VideoUploadStatusToProcessing(); console.log('CameraWorker.executeTransaction'); @@ -244,7 +246,7 @@ class CameraWorker extends PureComponent { let callbacks = {onRequestAcknowledge: this.videoUploadedSuccessCallback, onFlowInterrupt: this.onFlowInterrupt}; let config = {metaProperties: this.getSdkMetaProperties()}; - let txExecutor = new TransactionExecutor({}, callbacks); + let txExecutor = new TransactionExecutor(config, callbacks); txExecutor.sendTransactionToSdk( amountToSendWithReply, receiverUserId, false); // todo : Execute transaction code. call clean up after that. @@ -507,7 +509,7 @@ class CameraWorker extends PureComponent { }) ); this.VideoUploadStatusToProcessing(); - this.uploadToS3(this.props.recorded_video.compressed_video, 'video') + return this.uploadToS3(this.props.recorded_video.compressed_video, 'video') .then((s3Video) => { console.log('uploadVideo success :: s3Video', s3Video); Store.dispatch( @@ -542,7 +544,7 @@ class CameraWorker extends PureComponent { }) ); - this.uploadToS3(this.props.recorded_video.cover_image, 'image') + return this.uploadToS3(this.props.recorded_video.cover_image, 'image') .then((s3CoverImage) => { console.log('uploadCoverImage success :: s3CoverImage', s3CoverImage); Store.dispatch( @@ -611,7 +613,7 @@ class CameraWorker extends PureComponent { }; } - new PepoApi(`/users/${this.props.currentUserId}/fan-video`) + return new PepoApi(`/users/${this.props.currentUserId}/fan-video`) .post(payload) .then((responseData) => { if (responseData.success && responseData.data) { From f2a8bba25f8ec3060e1bff0137339149881782b4 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Tue, 19 Nov 2019 13:57:44 +0530 Subject: [PATCH 081/302] tags url change to support replies --- src/components/VideoTags/index.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/components/VideoTags/index.js b/src/components/VideoTags/index.js index 048706ee..042149e8 100644 --- a/src/components/VideoTags/index.js +++ b/src/components/VideoTags/index.js @@ -1,5 +1,7 @@ import React, { PureComponent } from 'react'; import { View } from 'react-native'; +import qs from 'qs'; + import reduxGetter from '../../services/ReduxGetters'; import VideoCollections from '../VideoCollections'; import Colors from '../../theme/styles/Colors'; @@ -79,16 +81,17 @@ class VideoTags extends PureComponent { this.didFocus && this.didFocus.remove && this.didFocus.remove(); } - - _headerComponent() { // do nothing } - getFetchUrl = () => { - return `/tags/${this.getTagId()}/videos` - - } + getFetchUrl = () => { + let baseUrl = `/tags/${this.getTagId()}/allvideos`; + let params = { + supported_entities: ['videos', 'replies'] + }; + return baseUrl + "?" + qs.stringify(params); + }; getTagId = () => { return this.props.navigation.getParam("tagId") From 3b154d154f992ad5dcdfaf4c48eb1b653f7b948f Mon Sep 17 00:00:00 2001 From: Shraddha Date: Tue, 19 Nov 2019 16:28:51 +0530 Subject: [PATCH 082/302] few fixes --- src/assets/reply_video_icon.png | Bin 0 -> 1099 bytes src/assets/video_reply.png | Bin 0 -> 1935 bytes .../CommonComponents/ReplyIcon/index.js | 2 +- src/components/FanVideoDetails/VideoLink.js | 13 +++++++- src/components/VideoReplies/index.js | 26 +++++++++++---- src/components/VideoReplies/styles.js | 30 ++++++++++++++++-- 6 files changed, 61 insertions(+), 10 deletions(-) create mode 100644 src/assets/reply_video_icon.png create mode 100644 src/assets/video_reply.png diff --git a/src/assets/reply_video_icon.png b/src/assets/reply_video_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..695dd2c5d5a31f5ecbb405be5ba8c4a47ef8e792 GIT binary patch literal 1099 zcmV-R1ho5!P)O=uHA6oB8GP3kWgM5|b>Vnu9Mdr=E2YEe|GC&l2!pZY`b zAovGjRZzsMmx4bi2>u{SQ1H}~Qh#DkDyG>e{$Q=PrHP0VZEe%+^R0DBOm@>v)7Fl5 zFEe>>=FNQb@+PzM0`Q+bX!4ept{xMQf8P#3WuU_>LK3F#FO*S4cn09QqiGNQ{W<;jSYbnltU%xp)QCG$mpUA~vSU2T8yaUI#=glZO+4#yr!2Rn?mZ&|KNk-cZf@ z8PJROT*m4p8#d~S0yi2O{Pn5w!TMZMvUmcI^#`yHf6lX_qGH5{#;-ewnyYz%ra7G( zdswcAV{~LB65G|(_~kG=v!FMRrqW3Rj6|d67BAWxZtFV4VK^lf#OY^gfZ3b-d&0Aq zAVt(T{?qrR-z)MrPg72v;;0?}+5}MG#{B%e1(`ZX<6%1p0~7?F35`;MYWR@>Zp>xmn3gnKZzhRf`8hkFTlf)M6B( zl0E*`gvh3p2H1r1`FwFr^Ix8rpEpM!?BpNacc#us$u}O@$@jb&1Klt*uXxE?9bu^x zqdB)BTAunA&mQG@CZ6Bv(@UIFy87csu#z(@q^j4gxZgX||~s!JEN7D?>v`#$VeGQbuRYb!nQf zD;V;h2P~L{0`_p9W-A5(BJWhTabRU=KxIN42?p=BIT^zM*R=XGg)=-wysPi!kZn!w zCp4|@8!GN~EPR@*7z%X`w-_Lv@OoF(WILbQ+S*Ru)oaFi3W|7FKOkZlHEghRdmbZm z{wW;Wz#CYZ;uaU4KY#Sf)EOnGFt;Pn`efMv)}sXY6j7<=KedDgaGZbN^iTMyb=yb7 RIg?tSmx z1^>6t-e(VM|IgZMuf6Z9X;lKLudi=Iw>>~7a5iWk;3TQ|2OI$hYiepvk+uk_DOL+6 z-kLu8fPr8%7z8AuLx8rV?SKTG29hBGCxYkwq(6d6m)CK!J4?Q-|0_6Ry0+=4NM;*CerzA(2|L8{^~aeeeX8Y6p}#(9S@_^$3b&C z%6#S}A@k7N?Y?M9kwJ&&(AyJWK+(OHw}bu+w-Eh17dvc<3_7|WTwQF3&D4H4<4!Gh z>;xIGdLA9!4vGnnF(=M`5K}MRGn~6O2t}g4DB(<*$Ng;;f`K6}nQf(wrtLXO%w8#}jl? zcJgotSavU1#{0;*Y8idOxu6=P3zP69oe%;t12gYU6fI;7SOOuJSr8Vx2 z%%$=egrs&E$*}R?5e+J>_$UgCbcynZ`jGJ;6=+I^7bV$DiQ#5O~jqDF*2+=2n_Y1HQSH3&uf9VNR=*MGoSQ}W25Ty zxFg&Ayw<$S7cLWJHK_HWf~5}KSB3PSM7~3)EL(OsOQmgs4A}gM8tXtMTgNx(|3h-7 zOzr}nT>`m?u}S}=W!T_Nu)~K66vOUUf+e3+e+mzgp?9)Ukhy1{>`7lKd0 z5zrDv<+p&j=$o=)h!{-SQ=k{fN1W%O24vVnU?Gq2s1GqhZAo$fWtM}fVpTS~6(9tN<J!|<>>G#`Q8(&8Q zZ_vvrT0$-O9K4IN28I~|5r*3@f@?t5C7;nCduA)eT3kGn45&5C1n$M97MG?6$6eq< zupSb8&Jc9+j>7ZAL*UYkm-%JtsQwaTIBw%)FlamKECPDzTtqMbD{u{KNsaj!zx*FS zPwt(Hq4Wmu9oUY7DW5<-CFnGg%mU!`o#PZL?n0{=$MF&pxl9;Te=-k@1#!N`_{7P) z160x+dL@_G&q*a=E5Nm2Ah4_tD0GLQX#;U-ZUi&Y`FMl36f_{i zN+>yvMC;JW=-fQX+R<8|bIXYU`guEOYi!_IN2l5~NcAHw!S+GE2WhFqU1KG1DW8ZM zBr6$KW+Lt&PFm-7*s^?uK1S1K9`LLCYgco~&kXu7bJ!L)c-yE7G}a#!CG@cgLN?RM zO<)EX1hj~9N=F9M`eG&0GGbfiSpiZc;d*c<(CT!OI?Hm1%X>N>Cvu6XMA^tlpE1Pf z9LIq1pf`{xeTG|Uu5yZsk(M3m5KaeeO+l+PG!MhBp zDl*b%1~Ep^I%z|C4~^Y{L7zLybC9u&G()PEjN~jKMa$4)+{!NpI_9O2;ck>6{{sRQ V;{v`G=RN=c002ovPDHLkV1i?Dd~W~% literal 0 HcmV?d00001 diff --git a/src/components/CommonComponents/ReplyIcon/index.js b/src/components/CommonComponents/ReplyIcon/index.js index 9ecdda04..ee8766b5 100644 --- a/src/components/CommonComponents/ReplyIcon/index.js +++ b/src/components/CommonComponents/ReplyIcon/index.js @@ -7,7 +7,7 @@ import reduxGetter from '../../../services/ReduxGetters'; import inlineStyles from './styles'; import multipleClickHandler from "../../../services/MultipleClickHandler"; import pricer from '../../../services/Pricer'; -import reply_video from '../../../assets/reply_video.png'; +import reply_video from '../../../assets/video_reply.png'; import Utilities from '../../../services/Utilities'; import CurrentUser from '../../../models/CurrentUser'; import NavigationService from "../../../services/NavigationService"; diff --git a/src/components/FanVideoDetails/VideoLink.js b/src/components/FanVideoDetails/VideoLink.js index 058ac4aa..d2677dca 100644 --- a/src/components/FanVideoDetails/VideoLink.js +++ b/src/components/FanVideoDetails/VideoLink.js @@ -1,7 +1,8 @@ import React, { Component } from 'react'; -import { TextInput } from 'react-native'; +import { TextInput, TouchableOpacity, Image } from 'react-native'; import styles from './styles'; +import CloseIcon from '../../assets/modal-cross-icon.png'; class VideoLink extends Component { constructor(props) { @@ -22,6 +23,13 @@ class VideoLink extends Component { ); }; + onLinkCrossIconClick = () =>{ + console.log("in click function") + this.setState({ + value : "" + }) + } + render() { return ( @@ -36,6 +44,9 @@ class VideoLink extends Component { value={this.state.value} autoCapitalize={'none'} /> + + + ); } diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index 2f701e51..5da84f6c 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -5,7 +5,7 @@ import { Image, TouchableOpacity, Dimensions, - Animated, Platform , + Animated, Platform ,TouchableWithoutFeedback, StatusBar } from 'react-native'; @@ -28,13 +28,17 @@ import DataContract from '../../constants/DataContract'; import ReduxGetters from '../../services/ReduxGetters'; import Pricer from "../../services/Pricer"; import {getVideoReplyObject} from "../../helpers/cameraHelper"; +import Colors from '../../theme/styles/Colors'; +import VideoReplyIcon from '../../assets/reply_video_icon.png'; const { width, height } = Dimensions.get('window'); const landScape = width > height; const topPadding = getInset('top', landScape); const bottomPadding = getInset('bottom', landScape); const finalPadding = topPadding - bottomPadding; -const listBottomPadding = height - (height/1.5); +const bottomReplyViewHeight = 54; +const listBottomPadding = height - (height/1.5)+bottomReplyViewHeight ; + class VideoRepliesScreen extends PureComponent { @@ -194,22 +198,32 @@ class VideoRepliesScreen extends PureComponent { { Pricer.getToBT(Pricer.getFromDecimal(this.amount), 2)} - - - + {/**/} + {/**/} + {/**/} this.initialHeight? topPadding+bottomPadding : listBottomPadding} + listBottomPadding={this.state.currentHeight > this.initialHeight? topPadding+bottomPadding+bottomReplyViewHeight : listBottomPadding} /> + )} + + + + + Add a reply... + + + + ); } diff --git a/src/components/VideoReplies/styles.js b/src/components/VideoReplies/styles.js index 59a9dfbb..a81d1d6a 100644 --- a/src/components/VideoReplies/styles.js +++ b/src/components/VideoReplies/styles.js @@ -34,7 +34,8 @@ let stylesMap = { }, repliesTxt: { flex: 4, - alignItems: 'center' + alignItems: 'center', + marginRight:50 //equal to crossIcon width in order to maintain text in center }, headerStyles: { backgroundColor: Colors.white, @@ -55,7 +56,32 @@ let stylesMap = { headerSubText:{ fontSize: 12, color: 'rgba(42, 41, 59, 0.7)' - } + }, + addReplyView : { + flexDirection:'row', + alignItems:'center', + justifyContent:'flex-start', + width:'100%', + height:54, + shadowColor:'#000', + elevation: 8, + shadowOffset: { width: 0, height: 1 }, + shadowOpacity: 0.8,shadowRadius: 1, + position:'absolute', + bottom:0, + zIndex:9999, + backgroundColor:Colors.white, + paddingVertical:18, + paddingHorizontal:12 + }, + addReplyText : { + color:Colors.black, + marginLeft:10 + }, + addReplyImageDimension : { + height:10, + width:15 + } }; export default styles = DefaultStyleGenerator.generate(stylesMap); \ No newline at end of file From d5ef40860f7c5bc147a022a06cdf4d2946646183 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Tue, 19 Nov 2019 17:30:33 +0530 Subject: [PATCH 083/302] remove add video functionality and add scroll to index for reply collection --- .../FullScreenReplyCollection/index.js | 4 +++ src/components/ReplyCollection/index.js | 36 +++++++++---------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index 2ce52786..3c9bba54 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -203,6 +203,10 @@ class FullScreenReplyCollection extends PureComponent{ /> ; } + scrollToIndex = ( index )=>{ + this.flatlistRef.scrollToIndex({index: index}); + } + onViewableItemsChanged = (data) => { this.currentIndex = deepGet(data, 'viewableItems[0].index') || 0; } diff --git a/src/components/ReplyCollection/index.js b/src/components/ReplyCollection/index.js index 8ed17674..98206d40 100644 --- a/src/components/ReplyCollection/index.js +++ b/src/components/ReplyCollection/index.js @@ -41,26 +41,26 @@ class ReplyCollection extends PureComponent { } bindEvents(){ - VideoReplyEmitter.on('videoUploaded', ( payload )=>{ - this.fetchVideoReply( payload.videoId ); - }) + // VideoReplyEmitter.on('videoUploaded', ( payload )=>{ + // this.fetchVideoReply( payload.videoId ); + // }) } - fetchVideoReply = (id)=> { - new PepoApi(DataContract.replies.getSingleVideoReplyApi(id)) - .get() - .then((res)=> { - let newVideoReply = res.data['result_type']; - this.addVideo( newVideoReply ); - }) - } - - addVideo = ( item ) => { - this.videoPagination.addItems( item ); - let array = [...this.state.list]; // make a separate copy of the array - array.unshift( item ); - this.setState({list: array}); - } + // fetchVideoReply = (id)=> { + // new PepoApi(DataContract.replies.getSingleVideoReplyApi(id)) + // .get() + // .then((res)=> { + // let newVideoReply = res.data['result_type']; + // this.addVideo( newVideoReply ); + // }) + // } + + // addVideo = ( item ) => { + // this.videoPagination.addItems( item ); + // let array = [...this.state.list]; // make a separate copy of the array + // array.unshift( item ); + // this.setState({list: array}); + // } componentWillUnmount() { this.removePaginationListeners(); From b52e96eeb5de6e20ef6e4bfd3412e49bf84db128 Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Tue, 19 Nov 2019 17:29:04 +0530 Subject: [PATCH 084/302] balance fix --- src/components/FanVideoDetails/index.js | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/components/FanVideoDetails/index.js b/src/components/FanVideoDetails/index.js index 0f0e4bcd..d704250f 100644 --- a/src/components/FanVideoDetails/index.js +++ b/src/components/FanVideoDetails/index.js @@ -152,19 +152,7 @@ class FanVideoDetails extends Component { } enableStartUploadFlag = () => { - // if (!this.validLink()) return; - if(this.state.replyAmt > this.max){ - this.setState({ - amountError : `Maximum value is ${this.max}` - }) - }else if( this.state.replyAmt < this.min ){ - this.setState({ - amountError : `Minimum value is ${this.min}` - }) - }else{ - this.setState({ - amountError : "" - }) + this.clearErrors(); this.validateData().then((res) => { utilities.saveItem(`${CurrentUser.getUserId()}-accepted-camera-t-n-c`, true); @@ -181,7 +169,6 @@ class FanVideoDetails extends Component { // show error on UI. this.showError(err); }); - } }; clearErrors = () => { From cff28fa0589c213614ba6004d86fafc0bac92f6b Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Wed, 20 Nov 2019 12:59:29 +0530 Subject: [PATCH 085/302] video link cross icon fix --- src/components/FanVideoDetails/VideoLink.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/FanVideoDetails/VideoLink.js b/src/components/FanVideoDetails/VideoLink.js index d2677dca..de6cc9fe 100644 --- a/src/components/FanVideoDetails/VideoLink.js +++ b/src/components/FanVideoDetails/VideoLink.js @@ -24,7 +24,6 @@ class VideoLink extends Component { }; onLinkCrossIconClick = () =>{ - console.log("in click function") this.setState({ value : "" }) @@ -44,9 +43,9 @@ class VideoLink extends Component { value={this.state.value} autoCapitalize={'none'} /> - + {this.state.value ? - + : } ); } From 789e1429d7e331785e5082f3666d4103b17b122c Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Wed, 20 Nov 2019 13:07:08 +0530 Subject: [PATCH 086/302] minor fix --- src/components/FanVideoDetails/VideoLink.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/FanVideoDetails/VideoLink.js b/src/components/FanVideoDetails/VideoLink.js index de6cc9fe..81429203 100644 --- a/src/components/FanVideoDetails/VideoLink.js +++ b/src/components/FanVideoDetails/VideoLink.js @@ -24,9 +24,7 @@ class VideoLink extends Component { }; onLinkCrossIconClick = () =>{ - this.setState({ - value : "" - }) + this.onChangeValue(""); } render() { From a2374b2142ca4b3a2b3041b07d6e2b1d60dc27d1 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Wed, 20 Nov 2019 13:12:57 +0530 Subject: [PATCH 087/302] minor changes --- src/components/ReplyCollection/index.js | 36 ++++++++++++------------ src/components/VideoCollections/index.js | 1 + src/components/VideoReplies/index.js | 1 - 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/components/ReplyCollection/index.js b/src/components/ReplyCollection/index.js index 98206d40..8ed17674 100644 --- a/src/components/ReplyCollection/index.js +++ b/src/components/ReplyCollection/index.js @@ -41,26 +41,26 @@ class ReplyCollection extends PureComponent { } bindEvents(){ - // VideoReplyEmitter.on('videoUploaded', ( payload )=>{ - // this.fetchVideoReply( payload.videoId ); - // }) + VideoReplyEmitter.on('videoUploaded', ( payload )=>{ + this.fetchVideoReply( payload.videoId ); + }) } - // fetchVideoReply = (id)=> { - // new PepoApi(DataContract.replies.getSingleVideoReplyApi(id)) - // .get() - // .then((res)=> { - // let newVideoReply = res.data['result_type']; - // this.addVideo( newVideoReply ); - // }) - // } - - // addVideo = ( item ) => { - // this.videoPagination.addItems( item ); - // let array = [...this.state.list]; // make a separate copy of the array - // array.unshift( item ); - // this.setState({list: array}); - // } + fetchVideoReply = (id)=> { + new PepoApi(DataContract.replies.getSingleVideoReplyApi(id)) + .get() + .then((res)=> { + let newVideoReply = res.data['result_type']; + this.addVideo( newVideoReply ); + }) + } + + addVideo = ( item ) => { + this.videoPagination.addItems( item ); + let array = [...this.state.list]; // make a separate copy of the array + array.unshift( item ); + this.setState({list: array}); + } componentWillUnmount() { this.removePaginationListeners(); diff --git a/src/components/VideoCollections/index.js b/src/components/VideoCollections/index.js index e888c9a6..524d590d 100644 --- a/src/components/VideoCollections/index.js +++ b/src/components/VideoCollections/index.js @@ -5,6 +5,7 @@ import Pagination from "../../services/Pagination"; import CommonStyle from "../../theme/styles/Common"; import VideoThumbnail from '../CommonComponents/VideoThumbnail/VideoThumbnail'; +import ReplyThumbnail from '../CommonComponents/VideoThumbnail/ReplyThumbnail'; import entityHelper from '../../helpers/EntityHelper'; class VideoCollections extends PureComponent { diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index 5da84f6c..adca9726 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -53,7 +53,6 @@ class VideoRepliesScreen extends PureComponent { super(props); this.userId = props.navigation.getParam('userId'); this.videoId = props.navigation.getParam('videoId'); - this.userName = props.navigation.getParam('userName'); this.amount = ReduxGetters.getBtAmountForReply(this.videoId ); this.videoReplyCount = ReduxGetters.getVideoReplyCount(this.videoId); this.userName = ReduxGetters.getUserName(this.userId); From 07c5e3bf497949e97dafa31ba551ff09cb1f5380 Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Wed, 20 Nov 2019 13:36:36 +0530 Subject: [PATCH 088/302] thread changes --- .../ReplyThumbnailItem.js | 23 ++ .../InvertedReplyThumbnailList/index.js | 217 ++++++++++++++++++ .../InvertedReplyThumbnailList/styles.js | 0 .../CommonComponents/ReplyIcon/index.js | 3 +- src/components/FanVideoReplyDetails/index.js | 25 +- .../FullScreenReplyCollection/index.js | 6 +- src/components/Home/HomeFeedRow.js | 35 ++- src/components/Home/VideoList.js | 2 + src/components/Home/styles.js | 10 + src/components/ReplyCollection/index.js | 6 +- src/components/VideoRecorder/index.js | 1 - src/components/VideoReplies/index.js | 16 +- src/services/Utilities.js | 5 +- 13 files changed, 297 insertions(+), 52 deletions(-) create mode 100644 src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js create mode 100644 src/components/CommonComponents/InvertedReplyThumbnailList/index.js create mode 100644 src/components/CommonComponents/InvertedReplyThumbnailList/styles.js diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js new file mode 100644 index 00000000..07a55167 --- /dev/null +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js @@ -0,0 +1,23 @@ +import React, { Component } from 'react'; +import ProfilePicture from "../../ProfilePicture"; +import reduxGetters from '../../../services/ReduxGetters'; + +class ReplyThumbnailItem extends Component { + + constructor(props) { + super(props); + + this.videoId = this.props.payload.video_id; + this.replyDetailId = this.props.payload.reply_detail_id; + this.userId = reduxGetters.getReplyEntity(this.replyDetailId).creator_user_id; + + } + + render() { + console.log('ReplyThumbnailItem', this.userId); + return + } +} + +//make this component available to the app +export default ReplyThumbnailItem; diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js new file mode 100644 index 00000000..fe12f30e --- /dev/null +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -0,0 +1,217 @@ +import React, { Component } from 'react'; +import { Text, View} from 'react-native'; +import Pagination from "../../../services/Pagination"; +import PeopleCell from "../../PeopleList/PeopleCell"; +import CustomTextInput from "../TagsInput/CustomTextInput"; +import ReplyThumbnailItem from './ReplyThumbnailItem' +import {FlatList} from 'react-native-gesture-handler'; +class InvertedReplyList extends Component { + + static navigationOptions = { + header: null + }; + + constructor(props) { + super(props); + this.state = { + list: [], + refreshing : false, + loadingNext: false + }; + this.listRef = null; + console.log('InvertedReplyList::InvertedReplyList'); + + } + componentWillUnmount() { + this.removePaginationListeners(); + } + + getPagination = () => { + return this.invertedlistPagination; + }; + + getFetchUrl = () => { + return `/videos/${3847}/replies`; + return `/videos/${this.props.videoId}/replies`; + }; + + // region - Pagination and Event Handlers + + initPagination() { + // First, take care of existing Pagination if exists. + this.removePaginationListeners(); + console.log('initPagination'); + // Now, create a new one. + let fetchUrl = this.getFetchUrl(); + console.log('fetchUrl',fetchUrl); + this.invertedlistPagination = new Pagination(fetchUrl); + this.bindPaginationEvents(); + } + + bindPaginationEvents(){ + let pagination = this.invertedlistPagination; + if ( !pagination ) { + return; + } + let paginationEvent = pagination.event; + if ( null === paginationEvent ) { + return; + } + + paginationEvent.on("onBeforeRefresh" , this.beforeRefresh.bind(this) ); + paginationEvent.on("onRefresh" , this.onRefresh.bind(this) ); + paginationEvent.on("onRefreshError" , this.onRefreshError.bind(this)); + paginationEvent.on("onBeforeNext" , this.beforeNext.bind(this)); + paginationEvent.on("onNext" , this.onNext.bind(this) ); + paginationEvent.on("onNextError" , this.onNextError.bind(this)); + } + + removePaginationListeners(){ + let pagination = this.invertedlistPagination; + if ( !pagination ) { + return; + } + let paginationEvent = pagination.event; + if ( null === paginationEvent ) { + return; + } + paginationEvent.removeListener('onBeforeRefresh'); + paginationEvent.removeListener('onRefresh'); + paginationEvent.removeListener('onRefreshError'); + paginationEvent.removeListener('onBeforeNext'); + paginationEvent.removeListener('onNext'); + paginationEvent.removeListener('onNextError'); + this.invertedlistPagination = null; + } + + scrollToTop(){ + this.listRef.scrollToOffset({offset: 0}); + } + + + // onPullToRefresh = () => { + // fetchUser(this.props.userId , this.onUserFetch ); + // } + // + // onUserFetch =(res) => { + // this.props.onUserFetch && this.props.onUserFetch(res); + // } + + beforeRefresh = ( ) => { + //this.props.beforeRefresh && this.props.beforeRefresh(); + //this.onPullToRefresh(); + let stateObject = {refreshing : true}; + if (this.state.loadingNext) { + stateObject['loadingNext'] = false; + } + this.setState(stateObject); + }; + + onRefresh = ( res ) => { + let results = this.invertedlistPagination.getResults() ; + // if ( !results || results.length < 1) { + // // Create data for empty list. + // results = [ this.props.noResultsData ]; + // } + + this.props.onRefresh && this.props.onRefresh( results , res ); + this.setState({ refreshing : false , list : results }); + this.setState({ refreshing : false }); + } + + onRefreshError = ( error ) => { + this.setState({ refreshing : false }); + } + + beforeNext =() => { + if (this.state.refreshing) return; + this.setState({ loadingNext : true }); + } + + onNext = ( res ) => { + this.setState({ loadingNext : false , list : this.invertedlistPagination.getResults() }); + } + + onNextError = ( error ) => { + this.setState({ loadingNext : false }); + } + + getNext = () => { + this.invertedlistPagination.getNext(); + } + + refresh = () => { + this.invertedlistPagination.refresh(); + }; + + // isCurrentUser = () => { + // return this.props.userId === CurrentUser.getUserId(); + // } + + _keyExtractor = (item, index) => { + console.log('_keyExtractor',item); + return `id_${item.id}`; + }; + + _renderItem = ({item, index}) => { + // Check if this is an empty cell. + console.log('_renderThumbnailCell---', item); + return ; + // if ( item.isEmpty) { + // // Render no results cell here. + // return this.props.getNoResultsCell(item); + // } else { + // // Render People cell + // return this._renderThumbnailCell({item,index}); + // } + }; + + + setListRef = (ref) => { + this.listRef = ref; + }; + + componentDidMount () { + console.log('InvertedReplyList::InvertedReplyListcomponentDidMount'); + this.initPagination(); + this.refresh(); + } + + listHeaderComponent = () => { + if (this.props.HeaderComponent){ + let HeaderComponent = this.props.HeaderComponent; + return + } + }; + + getItemSeperatorComponent = () => { + return + } + + + + render() { + + return + } +} + +//make this component available to the app +export default InvertedReplyList; diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/styles.js b/src/components/CommonComponents/InvertedReplyThumbnailList/styles.js new file mode 100644 index 00000000..e69de29b diff --git a/src/components/CommonComponents/ReplyIcon/index.js b/src/components/CommonComponents/ReplyIcon/index.js index ee8766b5..07703930 100644 --- a/src/components/CommonComponents/ReplyIcon/index.js +++ b/src/components/CommonComponents/ReplyIcon/index.js @@ -53,8 +53,7 @@ class ReplyIcon extends PureComponent { if ( this.props.videoReplyCount > 0 ) { this.props.navigation.push('VideoReplies', {'videoId': this.props.videoId , - 'userId': this.props.userId , - 'userName' : this.props.userName + 'userId': this.props.userId }); } else { let activeTab = NavigationService.getActiveTab(); diff --git a/src/components/FanVideoReplyDetails/index.js b/src/components/FanVideoReplyDetails/index.js index 0163b773..a05e2f26 100644 --- a/src/components/FanVideoReplyDetails/index.js +++ b/src/components/FanVideoReplyDetails/index.js @@ -9,7 +9,6 @@ import { ScrollView } from 'react-native'; import deepGet from 'lodash/get'; -import utilities from '../../services/Utilities'; import CurrentUser from '../../models/CurrentUser'; import styles from './styles'; import VideoDescription from '../FanVideoDetails/VideoDescription'; @@ -180,6 +179,7 @@ class FanVideoReplyDetails extends Component { enableStartUploadFlag = () => { this.clearErrors(); + //todo @mayur button text change to validating or similar this.validateData().then((res) => { let videoOwnerId = this.replyObject.replyReceiverUserId; if (videoOwnerId === CurrentUser.getUserId()){ @@ -225,8 +225,10 @@ class FanVideoReplyDetails extends Component { validateData = () => { let params = {}; + //todo : @mayur put strings in data contract file params['video_description'] = this.videoDesc; params['link'] = this.videoLink; + params['parent_kind'] = 'video'; params['parent_id'] = this.replyObject.replyReceiverVideoId; @@ -265,27 +267,6 @@ class FanVideoReplyDetails extends Component { }); }; - validLink = () => { - if (!this.videoLink) return true; - //synced with backend - if ( - !this.videoLink.match( - /^(http(s)?:\/\/)([a-zA-Z0-9-_@:%+~#=]{1,256}\.)+[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=*]*)$/i - ) - ) { - this.setState( - { - error: 'Invalid link' - }, - () => { - this.setError(this.state.error); - } - ); - return false; - } - return true; - }; - getButtonText =() => { return "Reply | " }; diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index 3c9bba54..62fcaa39 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -20,7 +20,7 @@ import DataContract from "../../constants/DataContract"; const navigateToCamera = (navigation) => { let activeTab = NavigationService.getActiveTab(); - let params = getVideoReplyObject ( navigation.getParam('parentVideoId') , navigation.getParam('parentUserId')); + let params = getVideoReplyObject ( navigation.getParam('videoId') , navigation.getParam('userId')); utilities.handleVideoUploadModal(activeTab, navigation, params); }; @@ -47,7 +47,7 @@ const HeaderLeft = (props) => { }; const HeaderTitle = (props) => { - let userId = props.navigation.getParam('parentUserId'), + let userId = props.navigation.getParam('userId'), userName = ReduxGetters.getUserName(userId); return ( @@ -56,7 +56,7 @@ const HeaderLeft = (props) => { Send a reply with{' '} - { Pricer.getToBT(Pricer.getFromDecimal(props.navigation.getParam('amount')), 2)} + { Pricer.getToBT(Pricer.getFromDecimal( ReduxGetters.getBtAmountForReply( props.navigation.getParam('videoId'))), 2)} ); }; diff --git a/src/components/Home/HomeFeedRow.js b/src/components/Home/HomeFeedRow.js index c77dba92..588345c4 100644 --- a/src/components/Home/HomeFeedRow.js +++ b/src/components/Home/HomeFeedRow.js @@ -18,6 +18,8 @@ import PepoTxBtn from '../PepoTransactionButton/PepoTxBtn'; import VideoSupporterStat from '../CommonComponents/VideoSupporterStat/VideoSupporterStat'; import DataContract from '../../constants/DataContract'; +import InvertedReplyList from '../CommonComponents/InvertedReplyThumbnailList'; + class HomeFeedRow extends PureComponent { constructor(props) { @@ -51,20 +53,32 @@ class HomeFeedRow extends PureComponent { render() { return ( - - + + + + {/**/} + < InvertedReplyList videoId={this.videoId} userId={this.userId}/> + + + + + {/**/} + {/* */} + {/* */} + {/* < InvertedReplyList videoId={this.videoId} userId={this.userId}/>*/} + {/* */} + {/* */} + + {/**/} - + + {/*< InvertedReplyList videoId={this.videoId} userId={this.userId}/>*/} @@ -77,7 +91,6 @@ class HomeFeedRow extends PureComponent { pageName="feed" /> - diff --git a/src/components/Home/VideoList.js b/src/components/Home/VideoList.js index b57e6fa3..d1acb457 100644 --- a/src/components/Home/VideoList.js +++ b/src/components/Home/VideoList.js @@ -83,7 +83,9 @@ class VideoList extends PureComponent { showsVerticalScrollIndicator={false} onScrollToTop={this.onScrollToTop} onScrollToIndexFailed={this.onScrollToIndexFailed} + nestedScrollEnabled={true} ref={(ref) => (this.flatlistRef = ref)} + /> ); } diff --git a/src/components/Home/styles.js b/src/components/Home/styles.js index d46318af..1af59352 100644 --- a/src/components/Home/styles.js +++ b/src/components/Home/styles.js @@ -37,6 +37,11 @@ let stylesMap = { marginBottom: -15, zIndex: 1 }, + invertedList: { + alignSelf: 'flex-start', + // marginBottom: -15, + zIndex: 1 + }, pepoTxCount: { fontSize: 18, color: Colors.white, @@ -55,6 +60,11 @@ let stylesMap = { position: 'absolute', bottom: 0 }, + listContainer: { + width: width, + position: 'absolute', + bottom: height * 0.05 + 20, + }, bottomBg: { backgroundColor: 'rgba(0, 0, 0, 0.6)', borderTopLeftRadius: 20, diff --git a/src/components/ReplyCollection/index.js b/src/components/ReplyCollection/index.js index 8ed17674..d455fb44 100644 --- a/src/components/ReplyCollection/index.js +++ b/src/components/ReplyCollection/index.js @@ -212,14 +212,12 @@ class ReplyCollection extends PureComponent { onVideoClick = ( index ) => { const clonedInstance = this.videoPagination.fetchServices.cloneInstance(); - //TODO @ashutosh to understand this.props.navigation.push("FullScreenReplyCollection", { "fetchServices" : clonedInstance, "currentIndex": index, "baseUrl": this.props.fetchUrl, - "amount": this.props.amount, - 'parentUserId': this.props.userId, - 'parentVideoId': this.props.videoId + 'userId': this.props.userId, + 'videoId': this.props.videoId }); } diff --git a/src/components/VideoRecorder/index.js b/src/components/VideoRecorder/index.js index c64fdbd0..fc960710 100644 --- a/src/components/VideoRecorder/index.js +++ b/src/components/VideoRecorder/index.js @@ -54,7 +54,6 @@ class VideoRecorder extends Component { }; componentWillReceiveProps( nextProps ){ - let newState; if( nextProps.acceptedCameraTnC != this.state.acceptedCameraTnC ){ this.setState({acceptedCameraTnC: nextProps.acceptedCameraTnC }) } diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index adca9726..498acf7b 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -53,9 +53,6 @@ class VideoRepliesScreen extends PureComponent { super(props); this.userId = props.navigation.getParam('userId'); this.videoId = props.navigation.getParam('videoId'); - this.amount = ReduxGetters.getBtAmountForReply(this.videoId ); - this.videoReplyCount = ReduxGetters.getVideoReplyCount(this.videoId); - this.userName = ReduxGetters.getUserName(this.userId); this.fetchUrl = DataContract.replies.getReplyListApi(this.videoId); this.initialHeight = height/1.5; this.animatedValue = new Animated.Value(this.initialHeight) ; @@ -128,7 +125,6 @@ class VideoRepliesScreen extends PureComponent { openCamera = () => { let activeTab = NavigationService.getActiveTab(); - //TODO @mayur move it to a function , If possible change this to string let params = getVideoReplyObject ( this.videoId , this.userId) ; utilities.handleVideoUploadModal(activeTab, this.props.navigation, params); } @@ -194,7 +190,7 @@ class VideoRepliesScreen extends PureComponent { {/* {TODO integration pending} */} Send a reply with{' '} - { Pricer.getToBT(Pricer.getFromDecimal(this.amount), 2)} + { Pricer.getToBT(Pricer.getFromDecimal(ReduxGetters.getBtAmountForReply(this.videoId )), 2)} {/**/} @@ -204,11 +200,15 @@ class VideoRepliesScreen extends PureComponent { this.initialHeight? topPadding+bottomPadding+bottomReplyViewHeight : listBottomPadding} /> + + this.initialHeight? topPadding+bottomPadding : listBottomPadding} + + /> + @@ -231,3 +231,5 @@ class VideoRepliesScreen extends PureComponent { export default VideoRepliesScreen; + + diff --git a/src/services/Utilities.js b/src/services/Utilities.js index 5a712dc4..a3cd0deb 100644 --- a/src/services/Utilities.js +++ b/src/services/Utilities.js @@ -144,9 +144,10 @@ export default { }, handleVideoUploadModal(previousTabIndex, navigation, params = {}) { - if (reduxGetters.getVideoProcessingStatus() == true && previousTabIndex == 0) { + //todo: @mayur toast and flyer logic change. + if (reduxGetters.getVideoProcessingStatus() && previousTabIndex == 0) { FlyerEventEmitter.emit('onShowProfileFlyer', { id: 2 }); - } else if (reduxGetters.getVideoProcessingStatus() == true) { + } else if (reduxGetters.getVideoProcessingStatus()) { Toast.show({ text: 'Video uploading in progress.' }); From 982900e2bb787e935dcda609b2532f1eb44759d8 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Wed, 20 Nov 2019 16:19:09 +0530 Subject: [PATCH 089/302] minor ui fix --- .../CommonComponents/TagsInput/index.js | 52 ++++++++++--------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/src/components/CommonComponents/TagsInput/index.js b/src/components/CommonComponents/TagsInput/index.js index 62c33781..2a6fee74 100644 --- a/src/components/CommonComponents/TagsInput/index.js +++ b/src/components/CommonComponents/TagsInput/index.js @@ -1,9 +1,9 @@ import React, { PureComponent } from 'react'; -import {TouchableOpacity, FlatList, View, Dimensions, Text} from 'react-native'; +import { View, Dimensions, Text} from 'react-native'; +import { FlatList, TouchableOpacity, TouchableWithoutFeedback } from 'react-native-gesture-handler'; import PepoApi from '../../../services/PepoApi'; import CustomTextInput from './CustomTextInput'; -import ReduxGetters from '../../../services/ReduxGetters'; import deepGet from 'lodash/get'; import DataContract from "../../../constants/DataContract"; import inlineStyles from "./styles"; @@ -264,29 +264,31 @@ class TagsInput extends PureComponent { maxHeight: Dimensions.get('window').height - 300, backgroundColor: '#fff', } , this.props.dropdownStyle ]}> - {this.isHastagData() ? - : this.isMentionsData() && ( - - ) - } + + {this.isHastagData() ? + : this.isMentionsData() && ( + + ) + } + ); From 17ccee6ebe7b062e757f76ce987fe59a7035bd8b Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Wed, 20 Nov 2019 16:27:18 +0530 Subject: [PATCH 090/302] minor fix --- src/components/VideoRecorder/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/VideoRecorder/index.js b/src/components/VideoRecorder/index.js index c64fdbd0..575f74a4 100644 --- a/src/components/VideoRecorder/index.js +++ b/src/components/VideoRecorder/index.js @@ -193,7 +193,7 @@ class VideoRecorder extends Component { - Be the first one to reply to @{this.getUserName()}’s video, once you postt the reply you will pay {this.getPepoAmount()} Pepo Coins + Be the first one to reply to @{this.getUserName()}’s video, once you post the reply you will pay {this.getPepoAmount()} Pepo Coins Date: Wed, 20 Nov 2019 16:35:45 +0530 Subject: [PATCH 091/302] temp commit --- .../InvertedReplyThumbnailList/index.js | 3 +- src/components/Home/HomeFeedRow.js | 32 +++++++++---------- src/components/Home/styles.js | 9 ++++-- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index fe12f30e..c02e0ef4 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -193,7 +193,7 @@ class InvertedReplyList extends Component { render() { return } diff --git a/src/components/Home/HomeFeedRow.js b/src/components/Home/HomeFeedRow.js index 588345c4..b43db34c 100644 --- a/src/components/Home/HomeFeedRow.js +++ b/src/components/Home/HomeFeedRow.js @@ -53,26 +53,26 @@ class HomeFeedRow extends PureComponent { render() { return ( - - - - {/**/} - < InvertedReplyList videoId={this.videoId} userId={this.userId}/> - + + + {/**/} + {/* /!**!/*/} + {/* < InvertedReplyList videoId={this.videoId} userId={this.userId}/>*/} + {/**/} - {/**/} - {/* */} - {/* */} - {/* < InvertedReplyList videoId={this.videoId} userId={this.userId}/>*/} - {/* */} - {/* */} + + {/**/} + + < InvertedReplyList videoId={this.videoId} userId={this.userId}/> + + {/**/} - {/**/} + diff --git a/src/components/Home/styles.js b/src/components/Home/styles.js index 1af59352..f3380913 100644 --- a/src/components/Home/styles.js +++ b/src/components/Home/styles.js @@ -38,9 +38,8 @@ let stylesMap = { zIndex: 1 }, invertedList: { - alignSelf: 'flex-start', + // marginBottom: -15, - zIndex: 1 }, pepoTxCount: { fontSize: 18, @@ -63,7 +62,11 @@ let stylesMap = { listContainer: { width: width, position: 'absolute', - bottom: height * 0.05 + 20, + bottom: height * 0.05 + 50, + left: 10, + zIndex: 9, + alignSelf: 'flex-start', + height: height - 200 }, bottomBg: { backgroundColor: 'rgba(0, 0, 0, 0.6)', From 4d4b508e75e4f707a53536e68baa0eb8dc6eae5a Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Wed, 20 Nov 2019 17:39:14 +0530 Subject: [PATCH 092/302] fixing style --- .../CommonComponents/InvertedReplyThumbnailList/index.js | 8 ++++++-- src/components/Home/HomeFeedRow.js | 2 +- src/components/Home/styles.js | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index c02e0ef4..b7c6ac83 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import { Text, View} from 'react-native'; +import { Text, View, ScrollView, ListView} from 'react-native'; import Pagination from "../../../services/Pagination"; import PeopleCell from "../../PeopleList/PeopleCell"; import CustomTextInput from "../TagsInput/CustomTextInput"; @@ -116,6 +116,7 @@ class InvertedReplyList extends Component { this.props.onRefresh && this.props.onRefresh( results , res ); this.setState({ refreshing : false , list : results }); + // this.setState({ refreshing : false , list :[results[0], results[1]] }); this.setState({ refreshing : false }); } @@ -192,8 +193,9 @@ class InvertedReplyList extends Component { render() { + // return return + + } } diff --git a/src/components/Home/HomeFeedRow.js b/src/components/Home/HomeFeedRow.js index b43db34c..c60847ef 100644 --- a/src/components/Home/HomeFeedRow.js +++ b/src/components/Home/HomeFeedRow.js @@ -1,5 +1,5 @@ import React, { PureComponent } from 'react'; -import { View } from 'react-native'; +import { View, ScrollView } from 'react-native'; import { withNavigation } from 'react-navigation'; import FanVideo from '../VideoWrapper/FanVideo'; diff --git a/src/components/Home/styles.js b/src/components/Home/styles.js index f3380913..32e6fcc3 100644 --- a/src/components/Home/styles.js +++ b/src/components/Home/styles.js @@ -60,7 +60,7 @@ let stylesMap = { bottom: 0 }, listContainer: { - width: width, + // width: width, position: 'absolute', bottom: height * 0.05 + 50, left: 10, From 18258d83cc1196ff3098cd95a3180b9a28d3a840 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Wed, 20 Nov 2019 19:05:37 +0530 Subject: [PATCH 093/302] Add reply bottom bar --- RootNavigationContainer.js | 4 +- src/assets/cameraIconWhite.png | Bin 0 -> 818 bytes .../CommonComponents/BottomReplyBar/index.js | 37 +++++++++ .../CommonComponents/BottomReplyBar/styles.js | 21 ++++++ .../FlotingBackArrow/index.js | 24 ++++++ .../FlotingBackArrow/styles.js | 20 +++++ .../VideoReplyRow.js | 59 ++++++++------- .../FullScreenReplyCollection/index.js | 60 ++------------- .../FullScreenVideoRow.js | 63 +++++++++------- .../FullScreenVideoCollection/index.js | 7 +- .../UserVideoHistory/UserVideoHistoryRow.js | 71 ++++++++++-------- src/components/UserVideoHistory/index.js | 11 +-- src/helpers/cameraHelper.js | 12 ++- src/theme/styles/Common.js | 40 ++++++++++ 14 files changed, 277 insertions(+), 152 deletions(-) create mode 100644 src/assets/cameraIconWhite.png create mode 100644 src/components/CommonComponents/BottomReplyBar/index.js create mode 100644 src/components/CommonComponents/BottomReplyBar/styles.js create mode 100644 src/components/CommonComponents/FlotingBackArrow/index.js create mode 100644 src/components/CommonComponents/FlotingBackArrow/styles.js diff --git a/RootNavigationContainer.js b/RootNavigationContainer.js index 5bb45afc..e3edc003 100644 --- a/RootNavigationContainer.js +++ b/RootNavigationContainer.js @@ -72,7 +72,9 @@ const customTabHiddenRoutes = [ 'InAppBrowserComponent', 'CouchMarks', 'VideoReplies', - 'FullScreenReplyCollection' + 'FullScreenReplyCollection', + 'FullScreenVideoCollection', + 'UserVideoHistory' ]; const modalStackConfig = { diff --git a/src/assets/cameraIconWhite.png b/src/assets/cameraIconWhite.png new file mode 100644 index 0000000000000000000000000000000000000000..2d94f7b605eba965fc30d6455ba63ff8efba4ab2 GIT binary patch literal 818 zcmV-21I_%2P)KWG#|6o>a>5*0hK(uj&F6dMT=NTC*X+Nf9w!Hco55F{4j z9}p2sEer<5LJ=*5pkQTZCxV57pc11ffe@?>NTTNae(UYBncJP)J-oY}^&b3gXWzV; zdEd_N-0t3a-hXDLfVWbqtf4%D22nriLhZ8e4EzQ?EtN_y{&^C>4x&#eZ?;52H&J(^ z(6n8Fj-oAo9~9Q2Ih1F+loc2lfexdoD%d~(e52~f^JbCc`qDrX*Nw_(8b!?q)^)lk zO-F5x>0$gKTMm%*piyF`&^@GesK#_{?5Od2-Z;LmG5%J$4lvL@V=(18Y4|)Kd-0Xg zd9)c>O~5*OrafYHd}%scwGYHP#xjAItbvw{ZkE&-1PN!QuFqdsn3@|(5uZmLe+nXBK@;t1MhYgq)~0CXn{ z?PFkg-bJhjK{;1NN+f7X1(!n30M#N zw~$^Z+rSHVmwSok67a7?ioX>B_y=2@OTgCw z8Af_cw3+oyrc1!Tc|3dw>2_2`pHXIW3D}1NTHyED*@i~Z7r!Fqhh6|IAnS#$zWDCj z&t|vEEwH^YV<^wifYvpAm%JXZEu)KQ6S5l(ULn(l%vJZf6&Y+x=${>NH-)i z33&}DUZ?c)Xv3VAe~_2;w=QOU5#1)PADu$8sKx|*6=k{(YI(hO4tpCEQC z(oZvU(RN(~%;V6{ldq!{IVt}nkIQI0Yd&x-Ahi?t8KnP>c;S-;=e-uN!$^N>xkK { + navigateToCamera( this.props.videoId , this.props.userId , this.props.navigation ) + } + + render(){ + return( + + this.replyVideo())} > + + + Add a reply... + + + + ); + + } + +} + +export default withNavigation( BottomReplyBar ) \ No newline at end of file diff --git a/src/components/CommonComponents/BottomReplyBar/styles.js b/src/components/CommonComponents/BottomReplyBar/styles.js new file mode 100644 index 00000000..6a98ca97 --- /dev/null +++ b/src/components/CommonComponents/BottomReplyBar/styles.js @@ -0,0 +1,21 @@ +import DefaultStyleGenerator from '../../../theme/styles/DefaultStyleGenerator'; +import Colors from '../../../theme/styles/Colors'; +import { CUSTOM_TAB_Height } from "../../../theme/constants"; + +let stylesMap = { + wrapper : { + flex: 1, + height: CUSTOM_TAB_Height, + backgroundColor: Colors.black, + paddingHorizontal: 10 + }, + text: { + color: Colors.white + }, + replyIcon : { + height:10, + width:15 + } +}; + +export default styles = DefaultStyleGenerator.generate(stylesMap); diff --git a/src/components/CommonComponents/FlotingBackArrow/index.js b/src/components/CommonComponents/FlotingBackArrow/index.js new file mode 100644 index 00000000..3fd1489d --- /dev/null +++ b/src/components/CommonComponents/FlotingBackArrow/index.js @@ -0,0 +1,24 @@ +import React, { PureComponent } from 'react'; +import {Image,TouchableOpacity} from 'react-native'; + +import historyBack from "../../../assets/user-video-history-back-icon.png"; +import inlineStyles from './styles' +import { withNavigation } from 'react-navigation'; + +class FloatingBackArrow extends PureComponent { + + constructor(props){ + super(props); + } + + render(){ + return ( + this.props.navigation.goBack(null)} style={inlineStyles.historyBackSkipFont}> + + + ) + } + +} + +export default withNavigation( FloatingBackArrow ); \ No newline at end of file diff --git a/src/components/CommonComponents/FlotingBackArrow/styles.js b/src/components/CommonComponents/FlotingBackArrow/styles.js new file mode 100644 index 00000000..9a135846 --- /dev/null +++ b/src/components/CommonComponents/FlotingBackArrow/styles.js @@ -0,0 +1,20 @@ +import DefaultStyleGenerator from '../../../theme/styles/DefaultStyleGenerator'; +import {ifIphoneX} from "react-native-iphone-x-helper"; + +let stylesMap = { + historyBackSkipFont:{ + ...ifIphoneX({ + top: 55, + }, { + top: 25, + }), + width: 29, + height: 34, + position: 'absolute', + left: 10, + alignItems: 'center', + justifyContent: 'center' + } +}; + +export default styles = DefaultStyleGenerator.generate(stylesMap); diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index 59bf9019..e6e98174 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -4,8 +4,8 @@ import { withNavigation } from 'react-navigation'; import FanVideo from "../VideoWrapper/FanVideo"; import ShareIcon from "../CommonComponents/ShareIcon"; import ReportVideo from "../CommonComponents/ReportVideo"; +import BottomReplyBar from "../CommonComponents/BottomReplyBar"; import PepoApi from '../../services/PepoApi'; -import deepGet from 'lodash/get'; import inlineStyles from './styles'; @@ -15,6 +15,7 @@ import VideoReplySupporterStat from '../CommonComponents/VideoSupporterStat/Vide import ReplyVideoBottomStatus from '../BottomStatus/ReplyVideoBottomStatus'; import DataContract from '../../constants/DataContract'; import ReduxGetters from '../../services/ReduxGetters'; +import CommonStyle from "../../theme/styles/Common"; class VideoReplyRow extends PureComponent { constructor(props) { @@ -35,41 +36,47 @@ class VideoReplyRow extends PureComponent { replyDetailId = this.props.replyDetailId, videoId = ReduxGetters.getReplyEntityId(replyDetailId); return ( - - + + + + - {!!videoId && !!userId && ( - - + {!!videoId && !!userId && ( + + - - + + + + + + - - - + )} + + - - - )} + ); } diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index 3c9bba54..847112ca 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -1,5 +1,6 @@ import React , {PureComponent} from "react"; import {FlatList , View , TouchableOpacity, Image, Text, StatusBar} from "react-native"; +import FloatingBackArrow from "../CommonComponents/FlotingBackArrow"; import deepGet from "lodash/get"; import Pagination from "../../services/Pagination"; @@ -15,61 +16,16 @@ import entityHelper from "../../helpers/EntityHelper"; import {getVideoReplyObject} from "../../helpers/cameraHelper"; import Pricer from "../../services/Pricer"; import DataContract from "../../constants/DataContract"; - - - -const navigateToCamera = (navigation) => { - let activeTab = NavigationService.getActiveTab(); - let params = getVideoReplyObject ( navigation.getParam('parentVideoId') , navigation.getParam('parentUserId')); - utilities.handleVideoUploadModal(activeTab, navigation, params); -}; +import CommonStyle from "../../theme/styles/Common"; const maxVideosThreshold = 3; -const HeaderLeft = (props) => { - return ( - { - props.navigation.goBack(null); - }} - style={inlineStyles.iconWrapper} - > - - - ); - }; - - const HeaderRight = (props) => { - return ({ - navigateToCamera(props.navigation); - }} style={inlineStyles.iconWrapper} > - - ) - }; - - const HeaderTitle = (props) => { - let userId = props.navigation.getParam('parentUserId'), - userName = ReduxGetters.getUserName(userId); - return ( - - - Replies to {userName} - - Send a reply with{' '} - - { Pricer.getToBT(Pricer.getFromDecimal(props.navigation.getParam('amount')), 2)} - - ); - }; class FullScreenReplyCollection extends PureComponent{ static navigationOptions = (props) => { return { headerBackTitle: null, - headerStyle: inlineStyles.headerStyles, - headerLeft: , - headerRight: , - headerTitle: + header: null }; }; @@ -117,7 +73,7 @@ class FullScreenReplyCollection extends PureComponent{ //This is an hack for reset scroll for flatlist. Need to debug a bit more. this.willFocusSubscription = this.props.navigation.addListener('willFocus', (payload) => { - const offset = this.state.activeIndex > 0 ? inlineStyles.fullScreen.height * this.state.activeIndex : 0 ; + const offset = this.state.activeIndex > 0 ? CommonStyle.fullScreen.height * this.state.activeIndex : 0 ; this.flatlistRef && this.flatlistRef.scrollToOffset({offset: offset , animated: false}); this.isActiveScreen = true ; }); @@ -228,7 +184,7 @@ class FullScreenReplyCollection extends PureComponent{ } getItemLayout= (data, index) => { - return {length: inlineStyles.fullScreen.height, offset: inlineStyles.fullScreen.height * index, index} ; + return {length: CommonStyle.fullScreen.height, offset: CommonStyle.fullScreen.height * index, index} ; } closeVideo = () => { @@ -246,8 +202,7 @@ class FullScreenReplyCollection extends PureComponent{ render() { return ( - - + + ); } diff --git a/src/components/FullScreenVideoCollection/FullScreenVideoRow.js b/src/components/FullScreenVideoCollection/FullScreenVideoRow.js index e4d99866..c6b0c800 100644 --- a/src/components/FullScreenVideoCollection/FullScreenVideoRow.js +++ b/src/components/FullScreenVideoCollection/FullScreenVideoRow.js @@ -14,6 +14,7 @@ import ReplyIcon from '../CommonComponents/ReplyIcon'; import PepoTxBtn from '../PepoTransactionButton/PepoTxBtn'; import VideoSupporterStat from '../CommonComponents/VideoSupporterStat/VideoSupporterStat'; import DataContract from '../../constants/DataContract'; +import BottomReplyBar from '../CommonComponents/BottomReplyBar'; class FullScreeVideoRow extends PureComponent { @@ -32,42 +33,46 @@ class FullScreeVideoRow extends PureComponent { render() { return ( - - + + + + + + {!!this.videoId && !!this.userId && ( + + + + + + + + + - {!!this.videoId && !!this.userId && ( - - + + - - - - - - - - - - + )} - )} + ); } diff --git a/src/components/FullScreenVideoCollection/index.js b/src/components/FullScreenVideoCollection/index.js index e565f113..4905d809 100644 --- a/src/components/FullScreenVideoCollection/index.js +++ b/src/components/FullScreenVideoCollection/index.js @@ -11,6 +11,7 @@ import TopStatus from "../Home/TopStatus"; import CommonStyle from "../../theme/styles/Common"; import entityHelper from '../../helpers/EntityHelper'; import DataContract from "../../constants/DataContract"; +import VideoReplyRow from "../FullScreenReplyCollection/VideoReplyRow"; const maxVideosThreshold = 3; @@ -67,7 +68,7 @@ class FullScreenVideoCollection extends PureComponent{ //This is an hack for reset scroll for flatlist. Need to debug a bit more. this.willFocusSubscription = this.props.navigation.addListener('willFocus', (payload) => { - const offset = this.state.activeIndex > 0 ? inlineStyles.fullScreen.height * this.state.activeIndex : 0 ; + const offset = this.state.activeIndex > 0 ? CommonStyle.fullScreen.height * this.state.activeIndex : 0 ; this.flatlistRef && this.flatlistRef.scrollToOffset({offset: offset , animated: false}); this.isActiveScreen = true ; }); @@ -184,7 +185,7 @@ class FullScreenVideoCollection extends PureComponent{ } getItemLayout= (data, index) => { - return {length: inlineStyles.fullScreen.height, offset: inlineStyles.fullScreen.height * index, index} ; + return {length: CommonStyle.fullScreen.height, offset: CommonStyle.fullScreen.height * index, index} ; } closeVideo = () => { @@ -220,7 +221,7 @@ class FullScreenVideoCollection extends PureComponent{ onMomentumScrollEnd={this.onMomentumScrollEndCallback} onMomentumScrollBegin={this.onMomentumScrollBeginCallback} renderItem={this._renderItem} - style={[inlineStyles.fullScreen , {backgroundColor: "#000"}]} + style={[CommonStyle.fullScreen , {backgroundColor: "#000"}]} showsVerticalScrollIndicator={false} onScrollToTop={this.onScrollToTop} initialScrollIndex={this.state.activeIndex} diff --git a/src/components/UserVideoHistory/UserVideoHistoryRow.js b/src/components/UserVideoHistory/UserVideoHistoryRow.js index d7cabcfc..f0390f95 100644 --- a/src/components/UserVideoHistory/UserVideoHistoryRow.js +++ b/src/components/UserVideoHistory/UserVideoHistoryRow.js @@ -16,6 +16,8 @@ import ReplyIcon from '../CommonComponents/ReplyIcon'; import PepoTxBtn from '../PepoTransactionButton/PepoTxBtn'; import VideoSupporterStat from '../CommonComponents/VideoSupporterStat/VideoSupporterStat'; import DataContract from '../../constants/DataContract'; +import BottomReplyBar from '../CommonComponents/BottomReplyBar'; +import CommonStyle from "../../theme/styles/Common"; class UserVideoHistoryRow extends PureComponent { constructor(props) { @@ -46,42 +48,47 @@ class UserVideoHistoryRow extends PureComponent { render() { return ( - - + + + + - {!!this.props.videoId && !!this.props.userId && ( - - + {!!this.props.videoId && !!this.props.userId && ( + + - - - - - - + + + + + + - - + + - - - )} + + + )} + + + ); } diff --git a/src/components/UserVideoHistory/index.js b/src/components/UserVideoHistory/index.js index 166d0dd6..19787dc3 100644 --- a/src/components/UserVideoHistory/index.js +++ b/src/components/UserVideoHistory/index.js @@ -11,7 +11,7 @@ import inlineStyles from "./styles"; import CurrentUser from "../../models/CurrentUser"; import CommonStyle from "../../theme/styles/Common"; -import historyBack from '../../assets/user-video-history-back-icon.png'; +import FlotingBackArrow from "../CommonComponents/FlotingBackArrow"; const maxVideosThreshold = 3; @@ -149,7 +149,7 @@ class UserVideoHistoryScreen extends PureComponent{ } getItemLayout= (data, index) => { - return {length: inlineStyles.fullScreen.height, offset: inlineStyles.fullScreen.height * index, index} ; + return {length: CommonStyle.fullScreen.height, offset: CommonStyle.fullScreen.height * index, index} ; } isCurrentUser(){ @@ -189,17 +189,14 @@ class UserVideoHistoryScreen extends PureComponent{ onMomentumScrollEnd={this.onMomentumScrollEndCallback} onMomentumScrollBegin={this.onMomentumScrollBeginCallback} renderItem={this._renderItem} - style={[inlineStyles.fullScreen , {backgroundColor: "#000"}]} + style={[CommonStyle.fullScreen , {backgroundColor: "#000"}]} showsVerticalScrollIndicator={false} onScrollToTop={this.onScrollToTop} - initialScrollIndex={this.state.activeIndex} getItemLayout={this.getItemLayout} onScrollToIndexFailed={this.onScrollToIndexFailed} /> - - - + ); } diff --git a/src/helpers/cameraHelper.js b/src/helpers/cameraHelper.js index daddc05d..4640590d 100644 --- a/src/helpers/cameraHelper.js +++ b/src/helpers/cameraHelper.js @@ -1,7 +1,9 @@ import reduxGetter from "../services/ReduxGetters"; import AppConfig from '../constants/AppConfig' +import NavigationService from "../services/NavigationService"; +import Utilities from "../services/Utilities"; -let getVideoReplyObject = (videoId, creatorUserId) => { +const getVideoReplyObject = (videoId, creatorUserId) => { return { videoType : AppConfig.videoTypes.reply, videoId: videoId, @@ -12,4 +14,10 @@ let getVideoReplyObject = (videoId, creatorUserId) => { }; -export { getVideoReplyObject } +const navigateToCamera = (videoId , userId , navigation) => { + let activeTab = NavigationService.getActiveTab(); + let params = getVideoReplyObject ( videoId , userId); + Utilities.handleVideoUploadModal(activeTab, navigation, params); +}; + +export { getVideoReplyObject , navigateToCamera } diff --git a/src/theme/styles/Common.js b/src/theme/styles/Common.js index 505737a9..361865c2 100644 --- a/src/theme/styles/Common.js +++ b/src/theme/styles/Common.js @@ -1,3 +1,13 @@ +import { ifIphoneX , getStatusBarHeight , getBottomSpace} from 'react-native-iphone-x-helper'; +import { Dimensions, StatusBar , NativeModules } from 'react-native'; + +import NotchHelper from "../../helpers/NotchHelper"; +const {width, height} = Dimensions.get('window'); +let RNDeviceInfo = NativeModules.RNDeviceInfo; +let modalDeviceName = RNDeviceInfo.model === "Redmi Note 7 Pro" && RNDeviceInfo.brand === "xiaomi"; +let btmSpace = modalDeviceName ? 5 : 0; +import { CUSTOM_TAB_Height } from '../../theme/constants'; + import DefaultStyleGenerator from './DefaultStyleGenerator'; import Colors from './Colors'; @@ -8,6 +18,36 @@ const styles = { modalViewContainer: { flex:1, backgroundColor: 'rgba(0,0,0,0.5)' + }, + + fullScreen: { + width: width, + ...ifIphoneX( + { + height: height + }, + { + height: + NotchHelper.hasNotch() + ? height + statusBarHeight - btmSpace + : height + } + ) + }, + + videoWrapperfullScreen: { + width: width, + ...ifIphoneX( + { + height: height - CUSTOM_TAB_Height + }, + { + height: + NotchHelper.hasNotch() + ? height + statusBarHeight - CUSTOM_TAB_Height - btmSpace + : height - CUSTOM_TAB_Height + } + ) } }; From a6b1a5a7be00bb901a37927516bb6850b04b6b5a Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Wed, 20 Nov 2019 19:09:35 +0530 Subject: [PATCH 094/302] Minor fix --- src/components/UserVideoHistory/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/UserVideoHistory/index.js b/src/components/UserVideoHistory/index.js index 19787dc3..0c72a56f 100644 --- a/src/components/UserVideoHistory/index.js +++ b/src/components/UserVideoHistory/index.js @@ -57,7 +57,7 @@ class UserVideoHistoryScreen extends PureComponent{ //This is an hack for reset scroll for flatlist. Need to debug a bit more. this.willFocusSubscription = this.props.navigation.addListener('willFocus', (payload) => { - const offset = this.state.activeIndex > 0 ? inlineStyles.fullScreen.height * this.state.activeIndex : 0 ; + const offset = this.state.activeIndex > 0 ? CommonStyle.fullScreen.height * this.state.activeIndex : 0 ; this.flatlistRef && this.flatlistRef.scrollToOffset({offset: offset , animated: false}); this.isActiveScreen = true ; }); From aa19d0ba9706ecd20acc95213c82dd0318a79206 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Wed, 20 Nov 2019 19:17:18 +0530 Subject: [PATCH 095/302] Reply Icon --- src/components/FullScreenReplyCollection/index.js | 11 +---------- .../FullScreenVideoCollection/FullScreenVideoRow.js | 2 +- src/components/FullScreenVideoCollection/index.js | 7 ++----- src/components/UserVideoHistory/index.js | 2 -- src/theme/styles/Common.js | 5 +++++ 5 files changed, 9 insertions(+), 18 deletions(-) diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index 847112ca..e9ab48cd 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -1,20 +1,11 @@ import React , {PureComponent} from "react"; -import {FlatList , View , TouchableOpacity, Image, Text, StatusBar} from "react-native"; +import {FlatList , View } from "react-native"; import FloatingBackArrow from "../CommonComponents/FlotingBackArrow"; import deepGet from "lodash/get"; import Pagination from "../../services/Pagination"; -import inlineStyles from "./styles"; -import pepoIcon from '../../assets/pepo-tx-icon.png'; -import plusIcon from '../../assets/user-video-capture-icon-selected.png'; import VideoReplyRow from "./VideoReplyRow"; -import NavigationService from "../../services/NavigationService"; -import utilities from '../../services/Utilities'; -import crossIcon from '../../assets/cross_icon.png'; -import ReduxGetters from "../../services/ReduxGetters"; import entityHelper from "../../helpers/EntityHelper"; -import {getVideoReplyObject} from "../../helpers/cameraHelper"; -import Pricer from "../../services/Pricer"; import DataContract from "../../constants/DataContract"; import CommonStyle from "../../theme/styles/Common"; diff --git a/src/components/FullScreenVideoCollection/FullScreenVideoRow.js b/src/components/FullScreenVideoCollection/FullScreenVideoRow.js index c6b0c800..719e365c 100644 --- a/src/components/FullScreenVideoCollection/FullScreenVideoRow.js +++ b/src/components/FullScreenVideoCollection/FullScreenVideoRow.js @@ -72,7 +72,7 @@ class FullScreeVideoRow extends PureComponent { )} - + ); } diff --git a/src/components/FullScreenVideoCollection/index.js b/src/components/FullScreenVideoCollection/index.js index 4905d809..0e199bba 100644 --- a/src/components/FullScreenVideoCollection/index.js +++ b/src/components/FullScreenVideoCollection/index.js @@ -5,8 +5,7 @@ import deepGet from "lodash/get"; import reduxGetters from "../../services/ReduxGetters"; import Pagination from "../../services/Pagination"; import FullScreenVideoRow from "./FullScreenVideoRow"; -import inlineStyles from "./styles"; -import historyBack from '../../assets/user-video-history-back-icon.png'; +import FloatingBackArrow from "../CommonComponents/FlotingBackArrow"; import TopStatus from "../Home/TopStatus"; import CommonStyle from "../../theme/styles/Common"; import entityHelper from '../../helpers/EntityHelper'; @@ -228,9 +227,7 @@ class FullScreenVideoCollection extends PureComponent{ getItemLayout={this.getItemLayout} onScrollToIndexFailed={this.onScrollToIndexFailed} /> - - - + ); } diff --git a/src/components/UserVideoHistory/index.js b/src/components/UserVideoHistory/index.js index 0c72a56f..670d0433 100644 --- a/src/components/UserVideoHistory/index.js +++ b/src/components/UserVideoHistory/index.js @@ -6,8 +6,6 @@ import Pagination from "../../services/Pagination"; import UserVideoHistoryRow from "./UserVideoHistoryRow"; import TopStatus from "../../components/Home/TopStatus"; - -import inlineStyles from "./styles"; import CurrentUser from "../../models/CurrentUser"; import CommonStyle from "../../theme/styles/Common"; diff --git a/src/theme/styles/Common.js b/src/theme/styles/Common.js index 361865c2..efaf29ad 100644 --- a/src/theme/styles/Common.js +++ b/src/theme/styles/Common.js @@ -35,6 +35,11 @@ const styles = { ) }, + fullHeightWidth: { + width: "100%", + height: "100%" + }, + videoWrapperfullScreen: { width: width, ...ifIphoneX( From 87c807c7415f26b8cbb4d9826dbd892084454d6b Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Wed, 20 Nov 2019 19:32:16 +0530 Subject: [PATCH 096/302] Minor code fix --- RootNavigationContainer.js | 4 +++- .../CommonComponents/VideoPlayer/index.js | 14 +++++--------- .../CommonComponents/VideoReplyPlayer/index.js | 14 +++++--------- 3 files changed, 13 insertions(+), 19 deletions(-) diff --git a/RootNavigationContainer.js b/RootNavigationContainer.js index e3edc003..540cf674 100644 --- a/RootNavigationContainer.js +++ b/RootNavigationContainer.js @@ -74,7 +74,9 @@ const customTabHiddenRoutes = [ 'VideoReplies', 'FullScreenReplyCollection', 'FullScreenVideoCollection', - 'UserVideoHistory' + 'UserVideoHistory', + 'VideoPlayer', + 'VideoReplyPlayer' ]; const modalStackConfig = { diff --git a/src/components/CommonComponents/VideoPlayer/index.js b/src/components/CommonComponents/VideoPlayer/index.js index 04192fd9..211e4d06 100644 --- a/src/components/CommonComponents/VideoPlayer/index.js +++ b/src/components/CommonComponents/VideoPlayer/index.js @@ -1,14 +1,14 @@ import React, { Component } from 'react'; -import {View,Image,TouchableOpacity, Text} from 'react-native'; +import {View} from 'react-native'; import VideoRowComponent from "../../UserVideoHistory/UserVideoHistoryRow"; import TopStatus from "../../Home/TopStatus"; import deepGet from "lodash/get"; import PepoApi from "../../../services/PepoApi"; -import inlineStyles from './styles' -import historyBack from "../../../assets/user-video-history-back-icon.png"; import Utilities from '../../../services/Utilities'; import reduxGetter from '../../../services/ReduxGetters'; import DeletedVideoInfo from '../DeletedVideoInfo'; +import CommonStyles from "../../../theme/styles/Common"; +import FlotingBackArrow from "../../CommonComponents/FlotingBackArrow"; class VideoPlayer extends Component { @@ -73,18 +73,14 @@ class VideoPlayer extends Component { render() { if(this.state.isDeleted){ - // {TODO @Preshita move to common component } return }else{ return ( - + - {/* // {TODO @Preshita move to common component } */} - this.props.navigation.goBack()} style={inlineStyles.historyBackSkipFont}> - - + ) } diff --git a/src/components/CommonComponents/VideoReplyPlayer/index.js b/src/components/CommonComponents/VideoReplyPlayer/index.js index 800aace8..e0cd17a3 100644 --- a/src/components/CommonComponents/VideoReplyPlayer/index.js +++ b/src/components/CommonComponents/VideoReplyPlayer/index.js @@ -1,17 +1,16 @@ import React, { PureComponent } from 'react'; -import {View,Image,TouchableOpacity} from 'react-native'; -import VideoRowComponent from "../../UserVideoHistory/UserVideoHistoryRow"; +import {View} from 'react-native'; import TopStatus from "../../Home/TopStatus"; import deepGet from "lodash/get"; import PepoApi from "../../../services/PepoApi"; -import inlineStyles from './styles' -import historyBack from "../../../assets/user-video-history-back-icon.png"; import Utilities from '../../../services/Utilities'; import reduxGetter from '../../../services/ReduxGetters'; import ReduxGetters from '../../../services/ReduxGetters'; import DataContract from '../../../constants/DataContract'; import DeletedVideoInfo from '../DeletedVideoInfo'; import VideoReplyRow from '../../FullScreenReplyCollection/VideoReplyRow'; +import FlotingBackArrow from "../../CommonComponents/FlotingBackArrow"; +import CommonStyles from "../../../theme/styles/Common"; class VideoReplyPlayer extends PureComponent { @@ -80,7 +79,7 @@ class VideoReplyPlayer extends PureComponent { return }else{ return ( - + - {/* // {TODO @Preshita move to common component } */} - this.props.navigation.goBack()} style={inlineStyles.historyBackSkipFont}> - - + ) } From d5c6fda3b01b5e012c7dcbd718a55924914992eb Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Wed, 20 Nov 2019 20:05:02 +0530 Subject: [PATCH 097/302] activity support --- .../Notification/NotificationItem.js | 19 ++++++++++++++++--- src/constants/AppConfig.js | 12 ++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/components/Notification/NotificationItem.js b/src/components/Notification/NotificationItem.js index 8a1bef4e..3dc7b14a 100644 --- a/src/components/Notification/NotificationItem.js +++ b/src/components/Notification/NotificationItem.js @@ -204,10 +204,23 @@ class NotificationItem extends Component { } } + shouldShowVideo = () => { + let videoKinds = [ + AppConfig.notificationConstants.videoAddKind, + AppConfig.notificationConstants.userMention, + AppConfig.notificationConstants.replyUserMention, + AppConfig.notificationConstants.replySenderWithAmount, + AppConfig.notificationConstants.replySenderWithoutAmount, + AppConfig.notificationConstants.replyReceiverWithAmount, + AppConfig.notificationConstants.replyReceiverWithoutAmount + ] + return videoKinds.includes(this.props.kind); + } + render() { let headerWidth = '92%', notificationInfoWidth = '0%'; - if (this.props.kind === AppConfig.notificationConstants.videoAddKind) { + if (this.shouldShowVideo()) { headerWidth = '72%'; notificationInfoWidth = '20%'; } @@ -220,7 +233,7 @@ class NotificationItem extends Component { {this.getActivityIcon()} - + {this.getHeading()} @@ -233,7 +246,7 @@ class NotificationItem extends Component { {this.showIfFailed()} - {this.props.kind === AppConfig.notificationConstants.videoAddKind ? + { this.shouldShowVideo() ? {this.notificationInfo()} diff --git a/src/constants/AppConfig.js b/src/constants/AppConfig.js index 45163601..c3f8c323 100644 --- a/src/constants/AppConfig.js +++ b/src/constants/AppConfig.js @@ -9,6 +9,12 @@ const PROFILE_TX_SEND_SUCCESS = 'PROFILE_TX_SEND_SUCCESS', VIDEO_TX_SEND_SUCCESS = 'VIDEO_TX_SEND_SUCCESS', VIDEO_TX_RECEIVE_SUCCESS = 'VIDEO_TX_RECEIVE_SUCCESS', VIDEO_ADD = 'VIDEO_ADD', + USER_MENTION = 'USER_MENTION', + REPLY_USER_MENTION = 'REPLY_USER_MENTION', + REPLY_SENDER_WITH_AMOUNT = 'REPLY_SENDER_WITH_AMOUNT', + REPLY_SENDER_WITHOUT_AMOUNT = 'REPLY_SENDER_WITHOUT_AMOUNT', + REPLY_RECEIVER_WITH_AMOUNT = 'REPLY_RECEIVER_WITH_AMOUNT', + REPLY_RECEIVER_WITHOUT_AMOUNT = 'REPLY_RECEIVER_WITHOUT_AMOUNT', CONTRIBUTION_THANKS = 'CONTRIBUTION_THANKS', SYSTEM_NOTIFICATION = 'SYSTEM_NOTIFICATION', PROFILE_TX_SEND_FAILURE = 'PROFILE_TX_SEND_FAILURE', @@ -150,6 +156,12 @@ export default { videoTxSendKind: VIDEO_TX_SEND_SUCCESS, videoTxReceiveKind: VIDEO_TX_RECEIVE_SUCCESS, videoAddKind: VIDEO_ADD, + userMention: USER_MENTION, + replyUserMention: REPLY_USER_MENTION, + replySenderWithAmount: REPLY_SENDER_WITH_AMOUNT, + replySenderWithoutAmount: REPLY_SENDER_WITHOUT_AMOUNT, + replyReceiverWithAmount: REPLY_RECEIVER_WITH_AMOUNT, + replyReceiverWithoutAmount: REPLY_RECEIVER_WITHOUT_AMOUNT, AppreciationKind: CONTRIBUTION_THANKS, systemNotification: SYSTEM_NOTIFICATION, airDropNotification: AIRDROP_DONE, From 7b2a1e09d34e70f9bac190f37e4dac8b02dcee68 Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Wed, 20 Nov 2019 20:06:37 +0530 Subject: [PATCH 098/302] bottom video reply UI --- src/assets/reply-video-white.png | Bin 0 -> 818 bytes .../CommonComponents/BottomReplyBar/index.js | 4 ++-- .../CommonComponents/BottomReplyBar/styles.js | 12 +++++++++--- src/theme/styles/Colors.js | 3 ++- 4 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 src/assets/reply-video-white.png diff --git a/src/assets/reply-video-white.png b/src/assets/reply-video-white.png new file mode 100644 index 0000000000000000000000000000000000000000..2d94f7b605eba965fc30d6455ba63ff8efba4ab2 GIT binary patch literal 818 zcmV-21I_%2P)KWG#|6o>a>5*0hK(uj&F6dMT=NTC*X+Nf9w!Hco55F{4j z9}p2sEer<5LJ=*5pkQTZCxV57pc11ffe@?>NTTNae(UYBncJP)J-oY}^&b3gXWzV; zdEd_N-0t3a-hXDLfVWbqtf4%D22nriLhZ8e4EzQ?EtN_y{&^C>4x&#eZ?;52H&J(^ z(6n8Fj-oAo9~9Q2Ih1F+loc2lfexdoD%d~(e52~f^JbCc`qDrX*Nw_(8b!?q)^)lk zO-F5x>0$gKTMm%*piyF`&^@GesK#_{?5Od2-Z;LmG5%J$4lvL@V=(18Y4|)Kd-0Xg zd9)c>O~5*OrafYHd}%scwGYHP#xjAItbvw{ZkE&-1PN!QuFqdsn3@|(5uZmLe+nXBK@;t1MhYgq)~0CXn{ z?PFkg-bJhjK{;1NN+f7X1(!n30M#N zw~$^Z+rSHVmwSok67a7?ioX>B_y=2@OTgCw z8Af_cw3+oyrc1!Tc|3dw>2_2`pHXIW3D}1NTHyED*@i~Z7r!Fqhh6|IAnS#$zWDCj z&t|vEEwH^YV<^wifYvpAm%JXZEu)KQ6S5l(ULn(l%vJZf6&Y+x=${>NH-)i z33&}DUZ?c)Xv3VAe~_2;w=QOU5#1)PADu$8sKx|*6=k{(YI(hO4tpCEQC z(oZvU(RN(~%;V6{ldq!{IVt}nkIQI0Yd&x-Ahi?t8KnP>c;S-;=e-uN!$^N>xkK this.replyVideo())} > - + Add a reply... diff --git a/src/components/CommonComponents/BottomReplyBar/styles.js b/src/components/CommonComponents/BottomReplyBar/styles.js index 6a98ca97..2a17035f 100644 --- a/src/components/CommonComponents/BottomReplyBar/styles.js +++ b/src/components/CommonComponents/BottomReplyBar/styles.js @@ -6,11 +6,17 @@ let stylesMap = { wrapper : { flex: 1, height: CUSTOM_TAB_Height, - backgroundColor: Colors.black, - paddingHorizontal: 10 + backgroundColor: 'rgba(0, 0, 0, 0.6)', + paddingHorizontal: 10, + justifyContent: 'center', + borderTopWidth: 1, + borderColor: 'rgba(151, 151, 151, 0.6)', + marginTop: 5 }, text: { - color: Colors.white + color: Colors.white, + marginLeft: 10, + fontFamily: 'AvenirNext-Medium' }, replyIcon : { height:10, diff --git a/src/theme/styles/Colors.js b/src/theme/styles/Colors.js index 8a036a1d..9431bfce 100644 --- a/src/theme/styles/Colors.js +++ b/src/theme/styles/Colors.js @@ -25,5 +25,6 @@ export default { whisper: '#ECECEC', rhino: "#34445b", snow: '#FBFBFB', - green: '#0F9D58' + green: '#0F9D58', + nobel: '#979797' }; From 006c650babfbbb5a89e642543c575fde9b832247 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Wed, 20 Nov 2019 20:30:53 +0530 Subject: [PATCH 099/302] Styling --- .../CommonComponents/BottomReplyBar/styles.js | 2 +- .../CommonComponents/VideoPlayer/index.js | 6 +++--- .../VideoReplyPlayer/index.js | 6 +++--- .../FullScreenReplyCollection/index.js | 7 ++++--- .../FullScreenVideoCollection/index.js | 7 ++++--- src/components/UserVideoHistory/index.js | 7 ++++--- src/theme/styles/Common.js | 20 ++++++++++--------- 7 files changed, 30 insertions(+), 25 deletions(-) diff --git a/src/components/CommonComponents/BottomReplyBar/styles.js b/src/components/CommonComponents/BottomReplyBar/styles.js index 2a17035f..71f1965e 100644 --- a/src/components/CommonComponents/BottomReplyBar/styles.js +++ b/src/components/CommonComponents/BottomReplyBar/styles.js @@ -9,7 +9,7 @@ let stylesMap = { backgroundColor: 'rgba(0, 0, 0, 0.6)', paddingHorizontal: 10, justifyContent: 'center', - borderTopWidth: 1, + borderTopWidth: 0.5, borderColor: 'rgba(151, 151, 151, 0.6)', marginTop: 5 }, diff --git a/src/components/CommonComponents/VideoPlayer/index.js b/src/components/CommonComponents/VideoPlayer/index.js index 211e4d06..0f04f1c1 100644 --- a/src/components/CommonComponents/VideoPlayer/index.js +++ b/src/components/CommonComponents/VideoPlayer/index.js @@ -1,5 +1,4 @@ import React, { Component } from 'react'; -import {View} from 'react-native'; import VideoRowComponent from "../../UserVideoHistory/UserVideoHistoryRow"; import TopStatus from "../../Home/TopStatus"; import deepGet from "lodash/get"; @@ -9,6 +8,7 @@ import reduxGetter from '../../../services/ReduxGetters'; import DeletedVideoInfo from '../DeletedVideoInfo'; import CommonStyles from "../../../theme/styles/Common"; import FlotingBackArrow from "../../CommonComponents/FlotingBackArrow"; +import { SafeAreaView } from "react-navigation"; class VideoPlayer extends Component { @@ -76,12 +76,12 @@ class VideoPlayer extends Component { return }else{ return ( - + - + ) } } diff --git a/src/components/CommonComponents/VideoReplyPlayer/index.js b/src/components/CommonComponents/VideoReplyPlayer/index.js index e0cd17a3..826e7bb9 100644 --- a/src/components/CommonComponents/VideoReplyPlayer/index.js +++ b/src/components/CommonComponents/VideoReplyPlayer/index.js @@ -1,5 +1,4 @@ import React, { PureComponent } from 'react'; -import {View} from 'react-native'; import TopStatus from "../../Home/TopStatus"; import deepGet from "lodash/get"; import PepoApi from "../../../services/PepoApi"; @@ -11,6 +10,7 @@ import DeletedVideoInfo from '../DeletedVideoInfo'; import VideoReplyRow from '../../FullScreenReplyCollection/VideoReplyRow'; import FlotingBackArrow from "../../CommonComponents/FlotingBackArrow"; import CommonStyles from "../../../theme/styles/Common"; +import { SafeAreaView } from "react-navigation"; class VideoReplyPlayer extends PureComponent { @@ -79,7 +79,7 @@ class VideoReplyPlayer extends PureComponent { return }else{ return ( - + - + ) } } diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index e9ab48cd..516e1092 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -1,5 +1,5 @@ import React , {PureComponent} from "react"; -import {FlatList , View } from "react-native"; +import {FlatList } from "react-native"; import FloatingBackArrow from "../CommonComponents/FlotingBackArrow"; import deepGet from "lodash/get"; @@ -8,6 +8,7 @@ import VideoReplyRow from "./VideoReplyRow"; import entityHelper from "../../helpers/EntityHelper"; import DataContract from "../../constants/DataContract"; import CommonStyle from "../../theme/styles/Common"; +import { SafeAreaView } from "react-navigation"; const maxVideosThreshold = 3; @@ -193,7 +194,7 @@ class FullScreenReplyCollection extends PureComponent{ render() { return ( - + - + ); } diff --git a/src/components/FullScreenVideoCollection/index.js b/src/components/FullScreenVideoCollection/index.js index 0e199bba..47e58815 100644 --- a/src/components/FullScreenVideoCollection/index.js +++ b/src/components/FullScreenVideoCollection/index.js @@ -1,5 +1,5 @@ import React , {PureComponent} from "react"; -import {FlatList , View , TouchableOpacity, Image} from "react-native"; +import {FlatList} from "react-native"; import deepGet from "lodash/get"; import reduxGetters from "../../services/ReduxGetters"; @@ -11,6 +11,7 @@ import CommonStyle from "../../theme/styles/Common"; import entityHelper from '../../helpers/EntityHelper'; import DataContract from "../../constants/DataContract"; import VideoReplyRow from "../FullScreenReplyCollection/VideoReplyRow"; +import { SafeAreaView } from "react-navigation"; const maxVideosThreshold = 3; @@ -202,7 +203,7 @@ class FullScreenVideoCollection extends PureComponent{ render() { return ( - + {this.props.navigation.getParam("showBalanceFlyer") && } - + ); } diff --git a/src/components/UserVideoHistory/index.js b/src/components/UserVideoHistory/index.js index 670d0433..887c7d81 100644 --- a/src/components/UserVideoHistory/index.js +++ b/src/components/UserVideoHistory/index.js @@ -1,5 +1,5 @@ import React , {PureComponent} from "react"; -import {FlatList , View , TouchableOpacity, Image} from "react-native"; +import {FlatList} from "react-native"; import deepGet from "lodash/get"; import reduxGetters from "../../services/ReduxGetters"; import Pagination from "../../services/Pagination"; @@ -10,6 +10,7 @@ import CurrentUser from "../../models/CurrentUser"; import CommonStyle from "../../theme/styles/Common"; import FlotingBackArrow from "../CommonComponents/FlotingBackArrow"; +import { SafeAreaView } from "react-navigation"; const maxVideosThreshold = 3; @@ -169,7 +170,7 @@ class UserVideoHistoryScreen extends PureComponent{ render() { return( - + {!this.isCurrentUser() && } - + ); } diff --git a/src/theme/styles/Common.js b/src/theme/styles/Common.js index efaf29ad..32e00500 100644 --- a/src/theme/styles/Common.js +++ b/src/theme/styles/Common.js @@ -19,12 +19,14 @@ const styles = { flex:1, backgroundColor: 'rgba(0,0,0,0.5)' }, - + fullScreenVideoSafeAreaContainer: { + flex:1, backgroundColor: 'rgba(0, 0, 0, 0.6)', + }, fullScreen: { width: width, ...ifIphoneX( { - height: height + height: height - getBottomSpace([true]) }, { height: @@ -35,16 +37,11 @@ const styles = { ) }, - fullHeightWidth: { - width: "100%", - height: "100%" - }, - videoWrapperfullScreen: { width: width, ...ifIphoneX( { - height: height - CUSTOM_TAB_Height + height: height - CUSTOM_TAB_Height - getBottomSpace([true]) }, { height: @@ -53,7 +50,12 @@ const styles = { : height - CUSTOM_TAB_Height } ) - } + }, + + fullHeightWidth: { + width: "100%", + height: "100%" + }, }; export default CommonStyle = DefaultStyleGenerator.generate(styles); From 3ef0fe6b1030a2097e175a47dd7a2679a44daa2f Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Wed, 20 Nov 2019 20:36:28 +0530 Subject: [PATCH 100/302] minor changes --- src/components/Notification/NotificationItem.js | 2 +- src/constants/AppConfig.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/Notification/NotificationItem.js b/src/components/Notification/NotificationItem.js index 3dc7b14a..48af9c04 100644 --- a/src/components/Notification/NotificationItem.js +++ b/src/components/Notification/NotificationItem.js @@ -125,7 +125,7 @@ class NotificationItem extends Component { }; notificationInfo = () => { - if (this.props.kind == AppConfig.notificationConstants.videoAddKind) { + if (this.shouldShowVideo()) { return this.showVideoComponent(); } }; diff --git a/src/constants/AppConfig.js b/src/constants/AppConfig.js index c3f8c323..287cfcdc 100644 --- a/src/constants/AppConfig.js +++ b/src/constants/AppConfig.js @@ -175,8 +175,9 @@ export default { PROFILE_TX_SEND_FAILURE, VIDEO_TX_SEND_FAILURE, AIRDROP_DONE, - TOPUP_DONE - + TOPUP_DONE, + REPLY_SENDER_WITH_AMOUNT, + REPLY_RECEIVER_WITH_AMOUNT ], whitelistedNotificationKinds: [ PROFILE_TX_SEND_SUCCESS, From 114f17563b38dcf35886b91456fa1303cda65f85 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Wed, 20 Nov 2019 20:48:30 +0530 Subject: [PATCH 101/302] activity center fix, tx fix --- .../Notification/NotificationItem.js | 21 +++++++++++++++---- src/constants/AppConfig.js | 17 +++++++++++++-- src/services/CameraWorker.js | 12 +++++------ 3 files changed, 37 insertions(+), 13 deletions(-) diff --git a/src/components/Notification/NotificationItem.js b/src/components/Notification/NotificationItem.js index 8a1bef4e..48af9c04 100644 --- a/src/components/Notification/NotificationItem.js +++ b/src/components/Notification/NotificationItem.js @@ -125,7 +125,7 @@ class NotificationItem extends Component { }; notificationInfo = () => { - if (this.props.kind == AppConfig.notificationConstants.videoAddKind) { + if (this.shouldShowVideo()) { return this.showVideoComponent(); } }; @@ -204,10 +204,23 @@ class NotificationItem extends Component { } } + shouldShowVideo = () => { + let videoKinds = [ + AppConfig.notificationConstants.videoAddKind, + AppConfig.notificationConstants.userMention, + AppConfig.notificationConstants.replyUserMention, + AppConfig.notificationConstants.replySenderWithAmount, + AppConfig.notificationConstants.replySenderWithoutAmount, + AppConfig.notificationConstants.replyReceiverWithAmount, + AppConfig.notificationConstants.replyReceiverWithoutAmount + ] + return videoKinds.includes(this.props.kind); + } + render() { let headerWidth = '92%', notificationInfoWidth = '0%'; - if (this.props.kind === AppConfig.notificationConstants.videoAddKind) { + if (this.shouldShowVideo()) { headerWidth = '72%'; notificationInfoWidth = '20%'; } @@ -220,7 +233,7 @@ class NotificationItem extends Component { {this.getActivityIcon()} - + {this.getHeading()} @@ -233,7 +246,7 @@ class NotificationItem extends Component { {this.showIfFailed()} - {this.props.kind === AppConfig.notificationConstants.videoAddKind ? + { this.shouldShowVideo() ? {this.notificationInfo()} diff --git a/src/constants/AppConfig.js b/src/constants/AppConfig.js index 45163601..287cfcdc 100644 --- a/src/constants/AppConfig.js +++ b/src/constants/AppConfig.js @@ -9,6 +9,12 @@ const PROFILE_TX_SEND_SUCCESS = 'PROFILE_TX_SEND_SUCCESS', VIDEO_TX_SEND_SUCCESS = 'VIDEO_TX_SEND_SUCCESS', VIDEO_TX_RECEIVE_SUCCESS = 'VIDEO_TX_RECEIVE_SUCCESS', VIDEO_ADD = 'VIDEO_ADD', + USER_MENTION = 'USER_MENTION', + REPLY_USER_MENTION = 'REPLY_USER_MENTION', + REPLY_SENDER_WITH_AMOUNT = 'REPLY_SENDER_WITH_AMOUNT', + REPLY_SENDER_WITHOUT_AMOUNT = 'REPLY_SENDER_WITHOUT_AMOUNT', + REPLY_RECEIVER_WITH_AMOUNT = 'REPLY_RECEIVER_WITH_AMOUNT', + REPLY_RECEIVER_WITHOUT_AMOUNT = 'REPLY_RECEIVER_WITHOUT_AMOUNT', CONTRIBUTION_THANKS = 'CONTRIBUTION_THANKS', SYSTEM_NOTIFICATION = 'SYSTEM_NOTIFICATION', PROFILE_TX_SEND_FAILURE = 'PROFILE_TX_SEND_FAILURE', @@ -150,6 +156,12 @@ export default { videoTxSendKind: VIDEO_TX_SEND_SUCCESS, videoTxReceiveKind: VIDEO_TX_RECEIVE_SUCCESS, videoAddKind: VIDEO_ADD, + userMention: USER_MENTION, + replyUserMention: REPLY_USER_MENTION, + replySenderWithAmount: REPLY_SENDER_WITH_AMOUNT, + replySenderWithoutAmount: REPLY_SENDER_WITHOUT_AMOUNT, + replyReceiverWithAmount: REPLY_RECEIVER_WITH_AMOUNT, + replyReceiverWithoutAmount: REPLY_RECEIVER_WITHOUT_AMOUNT, AppreciationKind: CONTRIBUTION_THANKS, systemNotification: SYSTEM_NOTIFICATION, airDropNotification: AIRDROP_DONE, @@ -163,8 +175,9 @@ export default { PROFILE_TX_SEND_FAILURE, VIDEO_TX_SEND_FAILURE, AIRDROP_DONE, - TOPUP_DONE - + TOPUP_DONE, + REPLY_SENDER_WITH_AMOUNT, + REPLY_RECEIVER_WITH_AMOUNT ], whitelistedNotificationKinds: [ PROFILE_TX_SEND_SUCCESS, diff --git a/src/services/CameraWorker.js b/src/services/CameraWorker.js index b2670a70..a050297e 100644 --- a/src/services/CameraWorker.js +++ b/src/services/CameraWorker.js @@ -186,11 +186,11 @@ class CameraWorker extends PureComponent { icon: 'success', imageUri: this.props.recorded_video.cover_image }); + this.executingTx = false; Store.dispatch( upsertRecordedVideo({ do_discard: true, - pepo_api_posting: false, - executing_tx: false + pepo_api_posting: false }) ); }; @@ -198,6 +198,7 @@ class CameraWorker extends PureComponent { onFlowInterrupt = (ostWorkflowContext, error) => { console.log('CameraWorker.onFlowInterrupt', ostWorkflowContext, error); this.VideoUploadStatusToNotProcessing(); + this.executingTx = false; Toast.show({ text: ostSdkErrors.getErrorMessage(ostWorkflowContext, error), icon: 'error' @@ -226,19 +227,16 @@ class CameraWorker extends PureComponent { let goForTx = this.props.recorded_video.go_for_tx, doDiscard = this.props.recorded_video.do_discard, - executingTx = this.props.recorded_video.executing_tx, receiverUserId = deepGet (this.props.recorded_video, 'reply_obj.replyReceiverUserId'), amountToSendWithReply = deepGet(this.props.recorded_video, 'reply_obj.amountToSendWithReply'); - if (! goForTx || ! receiverUserId || doDiscard || executingTx ){ + if (! goForTx || ! receiverUserId || doDiscard || this.executingTx ){ return; } + this.executingTx = true; if ( receiverUserId === this.props.currentUserId || ! Number(amountToSendWithReply)) { this.videoUploadedSuccessCallback(); return; }; - upsertRecordedVideo({ - executing_tx: true - }); this.VideoUploadStatusToProcessing(); console.log('CameraWorker.executeTransaction'); From cd0ffb668acedbc24e6d1e9900821990c4436ecb Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Wed, 20 Nov 2019 20:57:32 +0530 Subject: [PATCH 102/302] Color fix --- src/components/CommonComponents/BottomReplyBar/styles.js | 2 +- src/theme/styles/Common.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/CommonComponents/BottomReplyBar/styles.js b/src/components/CommonComponents/BottomReplyBar/styles.js index 71f1965e..05f34bfe 100644 --- a/src/components/CommonComponents/BottomReplyBar/styles.js +++ b/src/components/CommonComponents/BottomReplyBar/styles.js @@ -6,7 +6,7 @@ let stylesMap = { wrapper : { flex: 1, height: CUSTOM_TAB_Height, - backgroundColor: 'rgba(0, 0, 0, 0.6)', + backgroundColor: '#333333', paddingHorizontal: 10, justifyContent: 'center', borderTopWidth: 0.5, diff --git a/src/theme/styles/Common.js b/src/theme/styles/Common.js index 32e00500..2d4d3c6a 100644 --- a/src/theme/styles/Common.js +++ b/src/theme/styles/Common.js @@ -20,7 +20,7 @@ const styles = { backgroundColor: 'rgba(0,0,0,0.5)' }, fullScreenVideoSafeAreaContainer: { - flex:1, backgroundColor: 'rgba(0, 0, 0, 0.6)', + flex:1, backgroundColor: '#333333', }, fullScreen: { width: width, From 7cee6113e0f8eeb534b072f30d704f966bebb278 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Wed, 20 Nov 2019 21:33:23 +0530 Subject: [PATCH 103/302] Minor fix --- src/components/CommonComponents/BottomReplyBar/styles.js | 2 +- src/theme/styles/Colors.js | 3 ++- src/theme/styles/Common.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/CommonComponents/BottomReplyBar/styles.js b/src/components/CommonComponents/BottomReplyBar/styles.js index 05f34bfe..965669c2 100644 --- a/src/components/CommonComponents/BottomReplyBar/styles.js +++ b/src/components/CommonComponents/BottomReplyBar/styles.js @@ -6,7 +6,7 @@ let stylesMap = { wrapper : { flex: 1, height: CUSTOM_TAB_Height, - backgroundColor: '#333333', + backgroundColor: Colors.gray, paddingHorizontal: 10, justifyContent: 'center', borderTopWidth: 0.5, diff --git a/src/theme/styles/Colors.js b/src/theme/styles/Colors.js index 9431bfce..b687d8e2 100644 --- a/src/theme/styles/Colors.js +++ b/src/theme/styles/Colors.js @@ -26,5 +26,6 @@ export default { rhino: "#34445b", snow: '#FBFBFB', green: '#0F9D58', - nobel: '#979797' + nobel: '#979797', + gray:"#333333" }; diff --git a/src/theme/styles/Common.js b/src/theme/styles/Common.js index 2d4d3c6a..b891d3d5 100644 --- a/src/theme/styles/Common.js +++ b/src/theme/styles/Common.js @@ -20,7 +20,7 @@ const styles = { backgroundColor: 'rgba(0,0,0,0.5)' }, fullScreenVideoSafeAreaContainer: { - flex:1, backgroundColor: '#333333', + flex:1, backgroundColor: Colors.gray, }, fullScreen: { width: width, From 25ecc5e93cd9d9db8dabfe342a3063e229bf7cad Mon Sep 17 00:00:00 2001 From: Akshay Raje Date: Wed, 20 Nov 2019 21:42:12 +0530 Subject: [PATCH 104/302] Pixel --- .../CommonComponents/UserInfo/index.js | 1 - .../FullScreenVideoRow.js | 6 +- src/components/Home/HomeFeedRow.js | 7 +- src/components/PepoTransactionButton/Base.js | 9 ++- .../PepoTransactionButton/PepoTxBtn.js | 81 ++++++++++--------- .../PepoTransactionButton/ReplyPepoTxBtn.js | 29 +++---- .../UserVideoHistory/UserVideoHistoryRow.js | 18 ++++- src/components/VideoWrapper/Base.js | 4 +- src/services/PepoApi.js | 1 + src/services/PixelCall.js | 16 ++-- 10 files changed, 101 insertions(+), 71 deletions(-) diff --git a/src/components/CommonComponents/UserInfo/index.js b/src/components/CommonComponents/UserInfo/index.js index f77e135b..14dcc99e 100644 --- a/src/components/CommonComponents/UserInfo/index.js +++ b/src/components/CommonComponents/UserInfo/index.js @@ -16,7 +16,6 @@ import InAppBrowser from '../../../services/InAppBrowser'; import profileLink from '../../../assets/profile_link.png'; import twitterLink from '../../../assets/twitter_link.png'; import Utilities from '../../../services/Utilities'; -import inlineStyles from '../../Home/styles'; const mapStateToProps = (state, ownProps) => { return { diff --git a/src/components/FullScreenVideoCollection/FullScreenVideoRow.js b/src/components/FullScreenVideoCollection/FullScreenVideoRow.js index 719e365c..28172668 100644 --- a/src/components/FullScreenVideoCollection/FullScreenVideoRow.js +++ b/src/components/FullScreenVideoCollection/FullScreenVideoRow.js @@ -34,7 +34,7 @@ class FullScreeVideoRow extends PureComponent { render() { return ( - + {p_type: 'tag'}} // @todo to confirm this /> @@ -68,11 +69,12 @@ class FullScreeVideoRow extends PureComponent { {p_type: 'feed'}} /> )} - + ); } diff --git a/src/components/Home/HomeFeedRow.js b/src/components/Home/HomeFeedRow.js index c77dba92..c443a17e 100644 --- a/src/components/Home/HomeFeedRow.js +++ b/src/components/Home/HomeFeedRow.js @@ -65,7 +65,12 @@ class HomeFeedRow extends PureComponent { - + {p_type: 'feed'}} + /> diff --git a/src/components/PepoTransactionButton/Base.js b/src/components/PepoTransactionButton/Base.js index 986153cf..58f02d8e 100644 --- a/src/components/PepoTransactionButton/Base.js +++ b/src/components/PepoTransactionButton/Base.js @@ -3,6 +3,7 @@ import { TouchableWithoutFeedback, View } from 'react-native'; import { OstWalletSdk } from '@ostdotcom/ost-wallet-sdk-react-native'; import Toast from '../../theme/components/NotificationToast'; import deepGet from 'lodash/get'; +import assignIn from "lodash/assignIn"; import CurrentUser from '../../models/CurrentUser'; import PepoButton from './PepoButton'; @@ -120,7 +121,7 @@ class Base extends PureComponent { } dropPixel() { - //TODO @Ashutosh , confrim from @Akshay + //TODO @Ashutosh , confrim from @Akshay PixelCall(this.getDropPixel()); } @@ -242,4 +243,10 @@ class Base extends PureComponent { } } +Base.defaultProps = { + getPixelDropData: () => { + throw "error"; + } +}; + export default Base; diff --git a/src/components/PepoTransactionButton/PepoTxBtn.js b/src/components/PepoTransactionButton/PepoTxBtn.js index e2809cb4..e186b8ba 100644 --- a/src/components/PepoTransactionButton/PepoTxBtn.js +++ b/src/components/PepoTransactionButton/PepoTxBtn.js @@ -1,6 +1,7 @@ - import { connect } from 'react-redux'; import clone from 'lodash/clone'; +import assignIn from 'lodash/assignIn'; + import CurrentUser from '../../models/CurrentUser'; import appConfig from '../../constants/AppConfig'; import Store from '../../store'; @@ -22,51 +23,51 @@ const mapStateToProps = (state, ownProps) => ({ isCurrentUserActivated: CurrentUser.isUserActivated() }); - class PepoTxBtn extends Base { - - constructor(props){ - super(props); - } +class PepoTxBtn extends Base { - getSdkMetaProperties() { - const metaProperties = clone(appConfig.metaProperties); - metaProperties['name'] = 'video'; - metaProperties['details'] = `vi_${this.props.entityId}`; - return metaProperties; - } + constructor(props){ + super(props); + } - getDropPixel(){ - //TODO confrim with @JUNISHA @Ashutosh - return { - e_entity: 'video', - e_action: 'contribution', - e_data_json: { - video_id: this.props.entityId, - profile_user_id: this.props.userId, - amount: this.btAmount - }, - p_type: 'feed' - } - } + getSdkMetaProperties() { + const metaProperties = clone(appConfig.metaProperties); + metaProperties['name'] = 'video'; + metaProperties['details'] = `vi_${this.props.entityId}`; + return metaProperties; + } - reduxEntityUpdate( totalBt, supporters ){ - let videoStats = reduxGetter.getVideoStats(this.props.entityId), - updateVideoStats = false; - if (totalBt && totalBt > 0) { - videoStats['total_amount_raised_in_wei'] = Pricer.getToDecimal(totalBt); - updateVideoStats = true; - } + getDropPixel(){ + let specificData = this.props.getPixelDropData(), + defaultData = { + e_entity: 'video', + e_action: 'contribution', + e_data_json: { + video_id: this.props.entityId, + profile_user_id: this.props.userId, + amount: this.btAmount + } + }; + return assignIn({}, specificData, defaultData); + } - if (supporters && !this.props.isSupporting) { - videoStats['total_contributed_by'] = supporters; - updateVideoStats = true; - } + reduxEntityUpdate( totalBt, supporters ){ + let videoStats = reduxGetter.getVideoStats(this.props.entityId), + updateVideoStats = false; + if (totalBt && totalBt > 0) { + videoStats['total_amount_raised_in_wei'] = Pricer.getToDecimal(totalBt); + updateVideoStats = true; + } - if (updateVideoStats) { - Store.dispatch(upsertVideoStatEntities(utilities._getEntityFromObj(videoStats))); - } + if (supporters && !this.props.isSupporting) { + videoStats['total_contributed_by'] = supporters; + updateVideoStats = true; } + if (updateVideoStats) { + Store.dispatch(upsertVideoStatEntities(utilities._getEntityFromObj(videoStats))); + } } - export default connect(mapStateToProps)(withNavigation(PepoTxBtn)); \ No newline at end of file +} + +export default connect(mapStateToProps)(withNavigation(PepoTxBtn)); diff --git a/src/components/PepoTransactionButton/ReplyPepoTxBtn.js b/src/components/PepoTransactionButton/ReplyPepoTxBtn.js index 79e476fc..192cba93 100644 --- a/src/components/PepoTransactionButton/ReplyPepoTxBtn.js +++ b/src/components/PepoTransactionButton/ReplyPepoTxBtn.js @@ -10,6 +10,7 @@ import utilities from '../../services/Utilities'; import { withNavigation } from 'react-navigation'; import Base from "./Base"; +import assignIn from "lodash/assignIn"; const mapStateToProps = (state, ownProps) => ({ balance: state.balance, @@ -17,8 +18,8 @@ const mapStateToProps = (state, ownProps) => ({ isEntityUserActivated: utilities.isUserActivated(reduxGetter.getUserActivationStatus(ownProps.userId)), isCurrentUserActivated: CurrentUser.isUserActivated() , supporters: reduxGetter.getReplySupporters(ownProps.entityId), - isSupporting: reduxGetter.isReplySupported(ownProps.entityId) , - totalBt: reduxGetter.getReplyBt(ownProps.entityId), + isSupporting: reduxGetter.isReplySupported(ownProps.entityId) , + totalBt: reduxGetter.getReplyBt(ownProps.entityId), }); class ReplyPepoTxBtn extends Base { @@ -35,17 +36,17 @@ class ReplyPepoTxBtn extends Base { } getDropPixel(){ - //TODO confrim with @JUNISHA - return { - e_entity: 'video', - e_action: 'contribution', - e_data_json: { - reply_id: this.props.entityId, - profile_user_id: this.props.userId, - amount: this.btAmount - }, - p_type: 'reply' - } + let specificData = this.props.getPixelDropData(), + defaultData = { + e_entity: 'reply', + e_action: 'contribution', + e_data_json: { + reply_id: this.props.entityId, + profile_user_id: this.props.userId, + amount: this.btAmount + } + }; + return assignIn({}, specificData, defaultData); } reduxEntityUpdate( totalBt, supporters ){ @@ -69,4 +70,4 @@ class ReplyPepoTxBtn extends Base { } -export default connect(mapStateToProps)( withNavigation( ReplyPepoTxBtn )); \ No newline at end of file +export default connect(mapStateToProps)( withNavigation( ReplyPepoTxBtn )); diff --git a/src/components/UserVideoHistory/UserVideoHistoryRow.js b/src/components/UserVideoHistory/UserVideoHistoryRow.js index f0390f95..4d978505 100644 --- a/src/components/UserVideoHistory/UserVideoHistoryRow.js +++ b/src/components/UserVideoHistory/UserVideoHistoryRow.js @@ -5,6 +5,7 @@ import FanVideo from '../VideoWrapper/FanVideo'; import ShareIcon from "../CommonComponents/ShareIcon"; import ReportVideo from "../CommonComponents/ReportVideo"; import PepoApi from '../../services/PepoApi'; +import findCurrentRoute from '../../services/NavigationService'; import CurrentUser from '../../models/CurrentUser'; @@ -46,10 +47,18 @@ class UserVideoHistoryRow extends PureComponent { return this.props.userId == CurrentUser.getUserId(); } + getPType() { + if(findCurrentRoute(this.props.navigation.state) === 'VideoPlayer'){ + return 'video_player'; + } else { + return 'user_profile'; + } + } + render() { return ( - + {p_type: this.getPType()}} /> @@ -86,9 +96,9 @@ class UserVideoHistoryRow extends PureComponent { /> )} - - - + + + ); } diff --git a/src/components/VideoWrapper/Base.js b/src/components/VideoWrapper/Base.js index 6bf8a786..e7723069 100644 --- a/src/components/VideoWrapper/Base.js +++ b/src/components/VideoWrapper/Base.js @@ -106,7 +106,7 @@ class Base extends PureComponent { if (this.props.isActive && this.state.paused) { this.setState({ paused: false }); return; - } + } if ( this.isPaused() != this.currentPauseStatus ) { //Force render. this.forceUpdate(); @@ -201,6 +201,8 @@ class Base extends PureComponent { }; PixelCall(pixelParams); this.isPixelCalledOnEnd = true; + + this.sendFeedVideoEvent(VIDEO_PLAY_END_EVENT_NAME); }; getIsVideoPausedStatus = () => { diff --git a/src/services/PepoApi.js b/src/services/PepoApi.js index 68a0a7eb..3f7b57dc 100644 --- a/src/services/PepoApi.js +++ b/src/services/PepoApi.js @@ -25,6 +25,7 @@ export default class PepoApi { 'User-Agent': DeviceInfo.getUserAgent(), 'X-PEPO-DEVICE-OS': Platform.OS, 'X-PEPO-DEVICE-OS-VERSION': DeviceInfo.getSystemVersion(), + 'X-PEPO-DEVICE-ID': DeviceInfo.getUniqueID(), 'X-PEPO-BUILD-NUMBER': DeviceInfo.getBuildNumber(), 'X-PEPO-APP-VERSION': DeviceInfo.getVersion() } diff --git a/src/services/PixelCall.js b/src/services/PixelCall.js index 60bfedf9..d691bd8f 100644 --- a/src/services/PixelCall.js +++ b/src/services/PixelCall.js @@ -2,8 +2,8 @@ import {Platform, Dimensions} from 'react-native'; import DeviceInfo from 'react-native-device-info'; import qs from 'qs'; import assignIn from 'lodash/assignIn'; -import Store from '../store'; import { TRACKER_ENDPOINT } from '../constants/index'; +import CurrentUser from "../models/CurrentUser"; const keyAliasMap = { t_version: 'v', @@ -48,11 +48,6 @@ const staticData = { user_agent: DeviceInfo.getUserAgent() }; -if(Store.getState().current_user.id){ - staticData.u_id = Store.getState().current_user.id; - staticData.e_data_json.user_id = Store.getState().current_user.id; -} - const makeCompactData = params => { let compactData = {}; for(var key in params){ @@ -66,7 +61,14 @@ const makeCompactData = params => { export default (data) => { // Extend outer data with staticData - let pixelData = assignIn({}, staticData, data); + let pixelData = assignIn({}, staticData, data), + currentUserId = CurrentUser.getUserId(); + + // Add user context (if any) + if(currentUserId){ + pixelData.u_id = currentUserId; + pixelData.e_data_json.user_id = currentUserId; + } // Compact data let compactData = makeCompactData(pixelData); From 041d5b9aea4d54ac720af2eaa56436b619dc184f Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Wed, 20 Nov 2019 23:43:00 +0530 Subject: [PATCH 105/302] fix for bottom bar --- src/components/CommonComponents/BottomReplyBar/styles.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/CommonComponents/BottomReplyBar/styles.js b/src/components/CommonComponents/BottomReplyBar/styles.js index 965669c2..14bdc3c8 100644 --- a/src/components/CommonComponents/BottomReplyBar/styles.js +++ b/src/components/CommonComponents/BottomReplyBar/styles.js @@ -10,8 +10,7 @@ let stylesMap = { paddingHorizontal: 10, justifyContent: 'center', borderTopWidth: 0.5, - borderColor: 'rgba(151, 151, 151, 0.6)', - marginTop: 5 + borderColor: 'rgba(151, 151, 151, 0.6)' }, text: { color: Colors.white, From e808d316fd6ac33b7e4a50d02ffeb94f9e7eb292 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Thu, 21 Nov 2019 13:20:04 +0530 Subject: [PATCH 106/302] Minor fix --- src/theme/styles/Common.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/theme/styles/Common.js b/src/theme/styles/Common.js index b891d3d5..7c05d4b6 100644 --- a/src/theme/styles/Common.js +++ b/src/theme/styles/Common.js @@ -1,4 +1,4 @@ -import { ifIphoneX , getStatusBarHeight , getBottomSpace} from 'react-native-iphone-x-helper'; +import { ifIphoneX , getBottomSpace} from 'react-native-iphone-x-helper'; import { Dimensions, StatusBar , NativeModules } from 'react-native'; import NotchHelper from "../../helpers/NotchHelper"; @@ -7,6 +7,7 @@ let RNDeviceInfo = NativeModules.RNDeviceInfo; let modalDeviceName = RNDeviceInfo.model === "Redmi Note 7 Pro" && RNDeviceInfo.brand === "xiaomi"; let btmSpace = modalDeviceName ? 5 : 0; import { CUSTOM_TAB_Height } from '../../theme/constants'; +const statusBarHeight = StatusBar.currentHeight; import DefaultStyleGenerator from './DefaultStyleGenerator'; import Colors from './Colors'; From 92c5787e426415b3d185876ab1847fd4c83c6aa5 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Thu, 21 Nov 2019 16:08:46 +0530 Subject: [PATCH 107/302] Reply Video validation --- src/components/BottomStatus/Base.js | 7 ++- .../CommonComponents/BottomReplyBar/index.js | 6 ++- .../CommonComponents/ReplyIcon/index.js | 48 +++++------------- src/components/Home/HomeFeedRow.js | 9 ---- .../UserVideoHistory/UserVideoHistoryRow.js | 41 +++++----------- src/components/VideoReplies/index.js | 11 +++-- src/helpers/cameraHelper.js | 49 +++++++++++++++++-- src/services/OstErrors.js | 4 +- 8 files changed, 88 insertions(+), 87 deletions(-) diff --git a/src/components/BottomStatus/Base.js b/src/components/BottomStatus/Base.js index 22d8f2db..c64f4f32 100644 --- a/src/components/BottomStatus/Base.js +++ b/src/components/BottomStatus/Base.js @@ -29,8 +29,8 @@ class BottomStatus extends PureComponent { return !!entity } - //TODO @preshita move to bottom status navigateToUserProfile = () => { + if(!this.props.isUserNavigate) return; if (Utilities.checkActiveUser()) { if (this.props.userId == CurrentUser.getUserId()) { this.props.navigation.navigate('ProfileScreen'); @@ -40,7 +40,6 @@ class BottomStatus extends PureComponent { } }; - //TODO @preshita move to bottom status onDescriptionClick = ( tapEntity ) => { if (!tapEntity) { return; @@ -117,4 +116,8 @@ class BottomStatus extends PureComponent { }; } +BottomStatus.defaultProps = { + isUserNavigate : true +} + export default BottomStatus; diff --git a/src/components/CommonComponents/BottomReplyBar/index.js b/src/components/CommonComponents/BottomReplyBar/index.js index d7b09a10..ac286ebb 100644 --- a/src/components/CommonComponents/BottomReplyBar/index.js +++ b/src/components/CommonComponents/BottomReplyBar/index.js @@ -5,7 +5,7 @@ import inlineStyles from './styles'; import { TouchableWithoutFeedback } from 'react-native-gesture-handler'; import cameraIconWhite from '../../../assets/reply-video-white.png'; -import {navigateToCamera} from "../../../helpers/cameraHelper"; +import {navigateToCamera, replyPreValidationAndMessage} from "../../../helpers/cameraHelper"; import multipleClickHandler from '../../../services/MultipleClickHandler'; class BottomReplyBar extends PureComponent { @@ -15,7 +15,9 @@ class BottomReplyBar extends PureComponent { } replyVideo =( ) => { - navigateToCamera( this.props.videoId , this.props.userId , this.props.navigation ) + if( replyPreValidationAndMessage( this.props.videoId , this.props.userId) ) { + navigateToCamera( this.props.videoId , this.props.userId , this.props.navigation ) ; + } } render(){ diff --git a/src/components/CommonComponents/ReplyIcon/index.js b/src/components/CommonComponents/ReplyIcon/index.js index ee8766b5..4e27f8e4 100644 --- a/src/components/CommonComponents/ReplyIcon/index.js +++ b/src/components/CommonComponents/ReplyIcon/index.js @@ -2,29 +2,18 @@ import React, { PureComponent } from 'react'; import {TouchableOpacity , Image, View, Text} from "react-native"; import { connect } from 'react-redux'; import {withNavigation} from "react-navigation"; - import reduxGetter from '../../../services/ReduxGetters'; import inlineStyles from './styles'; import multipleClickHandler from "../../../services/MultipleClickHandler"; -import pricer from '../../../services/Pricer'; import reply_video from '../../../assets/video_reply.png'; import Utilities from '../../../services/Utilities'; -import CurrentUser from '../../../models/CurrentUser'; import NavigationService from "../../../services/NavigationService"; import utilities from "../../../services/Utilities"; -import { LoginPopoverActions } from '../../LoginPopover'; -import Pricer from '../../../services/Pricer'; -import {getVideoReplyObject} from "../../../helpers/cameraHelper"; +import {getVideoReplyObject, replyPreValidationAndMessage} from "../../../helpers/cameraHelper"; const mapStateToProps = (state , ownProps) => { return { - isVideoUserActivated : Utilities.isUserActivated(reduxGetter.getUserActivationStatus(ownProps.userId)), - isCurrentUserActivated : CurrentUser.isUserActivated(), - balance : state.balance, - requiredPepo : reduxGetter.getBtAmountForReply(ownProps.videoId, state), - videoReplyCount : reduxGetter.getVideoReplyCount(ownProps.videoId, state), - isReplyAllowed : reduxGetter.isReplyAllowed(ownProps.videoId, state), - userName : reduxGetter.getUserName(ownProps.userId) + videoReplyCount : reduxGetter.getVideoReplyCount(ownProps.videoId, state) } }; @@ -34,46 +23,33 @@ class ReplyIcon extends PureComponent { super(props); }; - isDisabled = () => { - return !this.props.isReplyAllowed || !this.props.isVideoUserActivated || !this.props.isCurrentUserActivated || !this.hasSufficientBalance(); - }; - - hasSufficientBalance = () => { - return Pricer.getWeiToNumber(this.props.balance) >= Pricer.getWeiToNumber(this.props.requiredPepo); - }; - replyVideo = ()=> { - if(this.isDisabled()) { - if(!CurrentUser.getOstUserId()){ - LoginPopoverActions.show(); - } - return; - } + + if(!Utilities.checkActiveUser()) return; if ( this.props.videoReplyCount > 0 ) { this.props.navigation.push('VideoReplies', {'videoId': this.props.videoId , - 'userId': this.props.userId , - 'userName' : this.props.userName + 'userId': this.props.userId }); - } else { - let activeTab = NavigationService.getActiveTab(); - let params = getVideoReplyObject(this.props.videoId, this.props.userId); - utilities.handleVideoUploadModal(activeTab, this.props.navigation, params); + } else if( replyPreValidationAndMessage(this.props.videoId , this.props.userId ) ){ + let activeTab = NavigationService.getActiveTab(); + let params = getVideoReplyObject(this.props.videoId, this.props.userId); + utilities.handleVideoUploadModal(activeTab, this.props.navigation, params); } - + }; render(){ return ( - + {this.props.videoReplyCount} this.replyVideo())} > - ); + ); } }; diff --git a/src/components/Home/HomeFeedRow.js b/src/components/Home/HomeFeedRow.js index c443a17e..4163473f 100644 --- a/src/components/Home/HomeFeedRow.js +++ b/src/components/Home/HomeFeedRow.js @@ -39,15 +39,6 @@ class HomeFeedRow extends PureComponent { .catch((error) => {}); }; - navigateToTransactionScreen = (e) => { - if (utilities.checkActiveUser() && CurrentUser.isUserActivated(true)) { - this.props.navigation.push('TransactionScreen', { - toUserId: this.userId, - videoId: reduxGetter.getHomeFeedVideoId(this.props.feedId), - requestAcknowledgeDelegate: this.refetchFeed - }); - } - }; render() { return ( diff --git a/src/components/UserVideoHistory/UserVideoHistoryRow.js b/src/components/UserVideoHistory/UserVideoHistoryRow.js index 4d978505..3029731c 100644 --- a/src/components/UserVideoHistory/UserVideoHistoryRow.js +++ b/src/components/UserVideoHistory/UserVideoHistoryRow.js @@ -5,14 +5,11 @@ import FanVideo from '../VideoWrapper/FanVideo'; import ShareIcon from "../CommonComponents/ShareIcon"; import ReportVideo from "../CommonComponents/ReportVideo"; import PepoApi from '../../services/PepoApi'; -import findCurrentRoute from '../../services/NavigationService'; - -import CurrentUser from '../../models/CurrentUser'; import VideoBottomStatus from '../BottomStatus/VideoBottomStatus'; import inlineStyles from './styles'; -import utilities from '../../services/Utilities'; +import Utilities from '../../services/Utilities'; import ReplyIcon from '../CommonComponents/ReplyIcon'; import PepoTxBtn from '../PepoTransactionButton/PepoTxBtn'; import VideoSupporterStat from '../CommonComponents/VideoSupporterStat/VideoSupporterStat'; @@ -23,6 +20,16 @@ import CommonStyle from "../../theme/styles/Common"; class UserVideoHistoryRow extends PureComponent { constructor(props) { super(props); + this.isUserNavigate = false; + this.pageType = "user_profile"; + this.pageInit(); + } + + pageInit = () => { + if( Utilities.getLastChildRoutename(this.props.navigation.state) === 'VideoPlayer'){ + this.isUserNavigate = true; + return this.pageType = 'video_player'; + } } refetchVideo = () => { @@ -32,29 +39,6 @@ class UserVideoHistoryRow extends PureComponent { .catch((error) => {}); }; - navigateToTransactionScreen = (e) => { - if (this.isCurrentUser()) return; - if (utilities.checkActiveUser() && CurrentUser.isUserActivated(true)) { - this.props.navigation.push('TransactionScreen', { - toUserId: this.props.userId, - videoId: this.props.videoId, - requestAcknowledgeDelegate: this.refetchVideo - }); - } - }; - - isCurrentUser() { - return this.props.userId == CurrentUser.getUserId(); - } - - getPType() { - if(findCurrentRoute(this.props.navigation.state) === 'VideoPlayer'){ - return 'video_player'; - } else { - return 'user_profile'; - } - } - render() { return ( @@ -77,7 +61,7 @@ class UserVideoHistoryRow extends PureComponent { resyncDataDelegate={this.refetchVideo} userId={this.props.userId} entityId={this.props.videoId} - getPixelDropData={() => {p_type: this.getPType()}} + getPixelDropData={() => {p_type:this.pageType}} /> @@ -93,6 +77,7 @@ class UserVideoHistoryRow extends PureComponent { )} diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index adca9726..22b8e91f 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -27,7 +27,7 @@ import { getInset } from 'react-native-safe-area-view'; import DataContract from '../../constants/DataContract'; import ReduxGetters from '../../services/ReduxGetters'; import Pricer from "../../services/Pricer"; -import {getVideoReplyObject} from "../../helpers/cameraHelper"; +import {getVideoReplyObject, replyPreValidationAndMessage} from "../../helpers/cameraHelper"; import Colors from '../../theme/styles/Colors'; import VideoReplyIcon from '../../assets/reply_video_icon.png'; @@ -127,10 +127,11 @@ class VideoRepliesScreen extends PureComponent { ; openCamera = () => { - let activeTab = NavigationService.getActiveTab(); - //TODO @mayur move it to a function , If possible change this to string - let params = getVideoReplyObject ( this.videoId , this.userId) ; - utilities.handleVideoUploadModal(activeTab, this.props.navigation, params); + if( replyPreValidationAndMessage( this.videoId , this.userId ) ){ + let activeTab = NavigationService.getActiveTab(); + let params = getVideoReplyObject ( this.videoId , this.userId) ; + utilities.handleVideoUploadModal(activeTab, this.props.navigation, params); + } } onData = ( data ) => { diff --git a/src/helpers/cameraHelper.js b/src/helpers/cameraHelper.js index 4640590d..18a068e2 100644 --- a/src/helpers/cameraHelper.js +++ b/src/helpers/cameraHelper.js @@ -1,15 +1,19 @@ -import reduxGetter from "../services/ReduxGetters"; import AppConfig from '../constants/AppConfig' import NavigationService from "../services/NavigationService"; import Utilities from "../services/Utilities"; +import CurrentUser from "../models/CurrentUser"; +import { Toast } from "native-base"; +import { ostErrors } from "../services/OstErrors"; +import Pricer from "../services/Pricer"; +import ReduxGetters from "../services/ReduxGetters"; const getVideoReplyObject = (videoId, creatorUserId) => { return { videoType : AppConfig.videoTypes.reply, videoId: videoId, userId: creatorUserId, - amount: reduxGetter.getBtAmountForReply(videoId), - videoReplyCount: reduxGetter.getVideoReplyCount(videoId) + amount: ReduxGetters.getBtAmountForReply(videoId), + videoReplyCount: ReduxGetters.getVideoReplyCount(videoId) }; }; @@ -20,4 +24,41 @@ const navigateToCamera = (videoId , userId , navigation) => { Utilities.handleVideoUploadModal(activeTab, navigation, params); }; -export { getVideoReplyObject , navigateToCamera } +const replyPreValidationAndMessage = (videoId , userId) => { + + if(!videoId || !userId){ + console.warn("replyPreValidationAndMessage missing videoId - " + videoId + "or userId - " + userId ); + return false; + } + + if(!CurrentUser.isUserActivated( true )){ + return false; + } + + const isReplyAllowed = ReduxGetters.isReplyAllowed(videoId) , + isVideoUserActivated = Utilities.isUserActivated(ReduxGetters.getUserActivationStatus(userId)) + ; + + if( !isReplyAllowed || !isVideoUserActivated ){ + Toast.show({ + text: ostErrors.getUIErrorMessage("video_reply_not_allowed"), + icon: 'error' + }); + return false; + } + + const requiredPepo = ReduxGetters.getBtAmountForReply(videoId); + + if(Pricer.getWeiToNumber(ReduxGetters.getBalance()) < Pricer.getWeiToNumber(requiredPepo)){ + Toast.show({ + text: ostErrors.getUIErrorMessage("video_reply_not_allowed_low_bal"), + icon: 'error' + }); + return false ; + } + + return true; + +} + +export { getVideoReplyObject , navigateToCamera , replyPreValidationAndMessage} diff --git a/src/services/OstErrors.js b/src/services/OstErrors.js index 7d837bea..ba21baa2 100644 --- a/src/services/OstErrors.js +++ b/src/services/OstErrors.js @@ -40,7 +40,9 @@ const UIErros = { max_pepocorns: `Sorry, you don't have enough Pepo Coins to buy this many ${Utilities.getPepoCornsName()}`, price_point_validation_failed: `Sorry, you don't have enough Pepo Coins to buy this many ${Utilities.getPepoCornsName()}`, min_pepocorns: `Minimum amount allowed is 1 ${Utilities.getPepoCornsName()}.`, - bt_exceeds_bal_amount_error : `Sorry, you don't have enough Pepo Coins for this transactions.` + bt_exceeds_bal_amount_error : `Sorry, you don't have enough Pepo Coins for this transactions.`, + video_reply_not_allowed: 'Reply is not allowed for this video.', + video_reply_not_allowed_low_bal: "Insufficient balance for reply" }; const UIWhitelistedErrorCode = { From b7dc10edb2b1cef96c2845063e70be3c97d9b7dc Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Thu, 21 Nov 2019 17:11:30 +0530 Subject: [PATCH 108/302] code changes --- .../ReplyThumbnailItem.js | 8 ++-- .../InvertedReplyThumbnailList/index.js | 45 ++++++++++++------- .../VideoReplyRow.js | 43 +++++++++++------- .../FullScreenReplyCollection/index.js | 10 ++++- .../FullScreenReplyCollection/styles.js | 16 ++++++- .../FullScreenVideoCollection/styles.js | 16 ++++++- .../UserVideoHistory/UserVideoHistoryRow.js | 43 +++++++++++------- src/components/UserVideoHistory/styles.js | 16 ++++++- src/components/VideoCollections/index.js | 1 + src/components/VideoReplies/index.js | 6 --- src/constants/DataContract.js | 3 +- src/helpers/ReplyHelper.js | 15 +++++++ 12 files changed, 156 insertions(+), 66 deletions(-) create mode 100644 src/helpers/ReplyHelper.js diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js index 07a55167..8dd08f6d 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js @@ -1,21 +1,21 @@ import React, { Component } from 'react'; import ProfilePicture from "../../ProfilePicture"; import reduxGetters from '../../../services/ReduxGetters'; +import { TouchableOpacity } from 'react-native-gesture-handler'; class ReplyThumbnailItem extends Component { constructor(props) { super(props); - this.videoId = this.props.payload.video_id; this.replyDetailId = this.props.payload.reply_detail_id; this.userId = reduxGetters.getReplyEntity(this.replyDetailId).creator_user_id; - } render() { - console.log('ReplyThumbnailItem', this.userId); - return + return + + } } diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index b7c6ac83..9caf560a 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -1,10 +1,12 @@ import React, { Component } from 'react'; -import { Text, View, ScrollView, ListView} from 'react-native'; +import { View, ScrollView} from 'react-native'; +import { withNavigation } from 'react-navigation'; + import Pagination from "../../../services/Pagination"; -import PeopleCell from "../../PeopleList/PeopleCell"; -import CustomTextInput from "../TagsInput/CustomTextInput"; import ReplyThumbnailItem from './ReplyThumbnailItem' import {FlatList} from 'react-native-gesture-handler'; +import ReplyHelper from '../../../helpers/ReplyHelper'; + class InvertedReplyList extends Component { static navigationOptions = { @@ -19,11 +21,25 @@ class InvertedReplyList extends Component { loadingNext: false }; this.listRef = null; - console.log('InvertedReplyList::InvertedReplyList'); + this.onItemClick = null; + this.invertedlistPagination = null; + } + setClickHandlers = ()=> { + this.onItemClick = this.props.onChildClickDelegate || this.defaultChildClickHandler; } + + defaultChildClickHandler = ( index )=> { + const parentVideoId = this.props.videoId, + parentUserId = this.props.userId, + clonedInstance = this.invertedlistPagination.fetchServices.cloneInstance(), + navigation = this.props.navigation; +    ReplyHelper.openRepliesList(parentUserId, parentVideoId, clonedInstance, index, navigation); +  }; + componentWillUnmount() { this.removePaginationListeners(); + this.onItemClick = ()=> {}; } getPagination = () => { @@ -31,7 +47,7 @@ class InvertedReplyList extends Component { }; getFetchUrl = () => { - return `/videos/${3847}/replies`; + // return `/videos/${3847}/replies`; return `/videos/${this.props.videoId}/replies`; }; @@ -150,14 +166,12 @@ class InvertedReplyList extends Component { // } _keyExtractor = (item, index) => { - console.log('_keyExtractor',item); return `id_${item.id}`; }; _renderItem = ({item, index}) => { // Check if this is an empty cell. - console.log('_renderThumbnailCell---', item); - return ; + return {this.onItemClick(index)}} />; // if ( item.isEmpty) { // // Render no results cell here. // return this.props.getNoResultsCell(item); @@ -176,12 +190,13 @@ class InvertedReplyList extends Component { console.log('InvertedReplyList::InvertedReplyListcomponentDidMount'); this.initPagination(); this.refresh(); + this.setClickHandlers(); } listHeaderComponent = () => { if (this.props.HeaderComponent){ let HeaderComponent = this.props.HeaderComponent; - return + return } }; @@ -189,13 +204,11 @@ class InvertedReplyList extends Component { return } - - render() { - // return - return + - + } } //make this component available to the app -export default InvertedReplyList; +export default withNavigation(InvertedReplyList); diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index 59bf9019..5c9cf861 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -5,7 +5,6 @@ import FanVideo from "../VideoWrapper/FanVideo"; import ShareIcon from "../CommonComponents/ShareIcon"; import ReportVideo from "../CommonComponents/ReportVideo"; import PepoApi from '../../services/PepoApi'; -import deepGet from 'lodash/get'; import inlineStyles from './styles'; @@ -15,6 +14,7 @@ import VideoReplySupporterStat from '../CommonComponents/VideoSupporterStat/Vide import ReplyVideoBottomStatus from '../BottomStatus/ReplyVideoBottomStatus'; import DataContract from '../../constants/DataContract'; import ReduxGetters from '../../services/ReduxGetters'; +import InvertedReplyList from '../CommonComponents/InvertedReplyThumbnailList'; class VideoReplyRow extends PureComponent { constructor(props) { @@ -33,9 +33,10 @@ class VideoReplyRow extends PureComponent { render() { let userId = this.props.userId, replyDetailId = this.props.replyDetailId, - videoId = ReduxGetters.getReplyEntityId(replyDetailId); + videoId = ReduxGetters.getReplyEntityId(replyDetailId), + parentVideoId = ReduxGetters.getReplyEntity( replyDetailId )[DataContract.replies.parentVideoIdKey]; return ( - + + + + + + + {!!videoId && !!userId && ( - + + - - + + + + + + - - - - - )} diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index 62fcaa39..6f2b5857 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -48,7 +48,8 @@ const HeaderLeft = (props) => { const HeaderTitle = (props) => { let userId = props.navigation.getParam('userId'), - userName = ReduxGetters.getUserName(userId); + userName = ReduxGetters.getUserName(userId), + amount = Pricer.getToBT(Pricer.getFromDecimal( ReduxGetters.getBtAmountForReply( props.navigation.getParam('videoId'))), 2); return ( @@ -56,7 +57,7 @@ const HeaderLeft = (props) => { Send a reply with{' '} - { Pricer.getToBT(Pricer.getFromDecimal( ReduxGetters.getBtAmountForReply( props.navigation.getParam('videoId'))), 2)} + { amount } ); }; @@ -200,9 +201,14 @@ class FullScreenReplyCollection extends PureComponent{ doRender={Math.abs(index - this.state.activeIndex) < maxVideosThreshold} userId={userId} replyDetailId={replyDetailId} + onChildClickDelegate={this.childClickHandler} /> ; } + childClickHandler = ( index )=> { + this.scrollToIndex( index ); + } + scrollToIndex = ( index )=>{ this.flatlistRef.scrollToIndex({index: index}); } diff --git a/src/components/FullScreenReplyCollection/styles.js b/src/components/FullScreenReplyCollection/styles.js index f23d9c3d..e1e6f0b8 100644 --- a/src/components/FullScreenReplyCollection/styles.js +++ b/src/components/FullScreenReplyCollection/styles.js @@ -111,7 +111,21 @@ let stylesMap = { }, headerSubText:{ fontSize: 12 - } + }, + bottomContainer: { + width: width, + position: 'absolute', + bottom: 0 + }, + listContainer: { + // width: width, + position: 'absolute', + bottom: height * 0.05 + 50, + left: 10, + zIndex: 9, + alignSelf: 'flex-start', + height: height - 200 + } }; export default styles = DefaultStyleGenerator.generate(stylesMap); diff --git a/src/components/FullScreenVideoCollection/styles.js b/src/components/FullScreenVideoCollection/styles.js index b59db44e..ba4617a9 100644 --- a/src/components/FullScreenVideoCollection/styles.js +++ b/src/components/FullScreenVideoCollection/styles.js @@ -118,7 +118,21 @@ let stylesMap = { height :10, width:23, zIndex: 1, - } + }, + bottomContainer: { + width: width, + position: 'absolute', + bottom: 0 + }, + listContainer: { + // width: width, + position: 'absolute', + bottom: height * 0.05 + 50, + left: 10, + zIndex: 9, + alignSelf: 'flex-start', + height: height - 200 + } }; export default styles = DefaultStyleGenerator.generate(stylesMap); diff --git a/src/components/UserVideoHistory/UserVideoHistoryRow.js b/src/components/UserVideoHistory/UserVideoHistoryRow.js index d7cabcfc..0d4f253a 100644 --- a/src/components/UserVideoHistory/UserVideoHistoryRow.js +++ b/src/components/UserVideoHistory/UserVideoHistoryRow.js @@ -16,6 +16,7 @@ import ReplyIcon from '../CommonComponents/ReplyIcon'; import PepoTxBtn from '../PepoTransactionButton/PepoTxBtn'; import VideoSupporterStat from '../CommonComponents/VideoSupporterStat/VideoSupporterStat'; import DataContract from '../../constants/DataContract'; +import InvertedReplyList from '../CommonComponents/InvertedReplyThumbnailList'; class UserVideoHistoryRow extends PureComponent { constructor(props) { @@ -46,7 +47,7 @@ class UserVideoHistoryRow extends PureComponent { render() { return ( - + + + + + + + {!!this.props.videoId && !!this.props.userId && ( - - + + + - - + + + + + + + - - - - - - )} diff --git a/src/components/UserVideoHistory/styles.js b/src/components/UserVideoHistory/styles.js index c4eb3865..a7fdc7fe 100644 --- a/src/components/UserVideoHistory/styles.js +++ b/src/components/UserVideoHistory/styles.js @@ -118,7 +118,21 @@ let stylesMap = { height :10, width:23, zIndex: 1, - } + }, + bottomContainer: { + width: width, + position: 'absolute', + bottom: 0 + }, +listContainer: { + // width: width, + position: 'absolute', + bottom: height * 0.05 + 50, + left: 10, + zIndex: 9, + alignSelf: 'flex-start', + height: height - 200 +} }; export default styles = DefaultStyleGenerator.generate(stylesMap); diff --git a/src/components/VideoCollections/index.js b/src/components/VideoCollections/index.js index 524d590d..5fbf0d48 100644 --- a/src/components/VideoCollections/index.js +++ b/src/components/VideoCollections/index.js @@ -2,6 +2,7 @@ import React, { PureComponent } from 'react'; import { ActivityIndicator , FlatList} from "react-native"; import {SafeAreaView} from "react-navigation"; import Pagination from "../../services/Pagination"; +import deepGet from 'lodash/get'; import CommonStyle from "../../theme/styles/Common"; import VideoThumbnail from '../CommonComponents/VideoThumbnail/VideoThumbnail'; diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index 498acf7b..9ed648c0 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -203,12 +203,6 @@ class VideoRepliesScreen extends PureComponent { listBottomPadding={this.state.currentHeight > this.initialHeight? topPadding+bottomPadding+bottomReplyViewHeight : listBottomPadding} /> - - this.initialHeight? topPadding+bottomPadding : listBottomPadding} - - /> - diff --git a/src/constants/DataContract.js b/src/constants/DataContract.js index 53f920fa..23b724c9 100644 --- a/src/constants/DataContract.js +++ b/src/constants/DataContract.js @@ -52,7 +52,8 @@ export default { videoReplyKind: { video: "VIDEO" }, - replyDetailIdKey: 'reply_detail_id' + replyDetailIdKey: 'reply_detail_id', + parentVideoIdKey: 'parent_id' }, common: { diff --git a/src/helpers/ReplyHelper.js b/src/helpers/ReplyHelper.js new file mode 100644 index 00000000..46efd4ff --- /dev/null +++ b/src/helpers/ReplyHelper.js @@ -0,0 +1,15 @@ +import { FetchServices } from "../services/FetchServices"; +import DataContract from "../constants/DataContract"; +import ReduxGetters from "../services/ReduxGetters"; + +async function openRepliesList( parentUserId, parentVideoId, fetchServicesClonedInstance, currentIndex, navigation){ +    navigation.push('FullScreenReplyCollection',{ +      "fetchServices": fetchServicesClonedInstance, +      "currentIndex": currentIndex, +      "baseUrl": DataContract.replies.getReplyListApi(parentVideoId), +      'userId': parentUserId, +      'videoId': parentVideoId +    }); +} + +export default { openRepliesList } \ No newline at end of file From f75b168938b49fb50020993ed6beda7c5c8c78ab Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Thu, 21 Nov 2019 17:27:22 +0530 Subject: [PATCH 109/302] reply list changes --- .../InvertedReplyThumbnailList/index.js | 183 +++++++++--------- .../VideoReplyRow.js | 7 +- .../FullScreenReplyCollection/index.js | 1 + src/components/Home/HomeFeedRow.js | 77 ++++++-- src/components/Home/styles.js | 4 +- .../UserVideoHistory/UserVideoHistoryRow.js | 85 ++++++-- src/services/CameraWorker.js | 6 +- 7 files changed, 232 insertions(+), 131 deletions(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index 9caf560a..f64b296e 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -1,7 +1,6 @@ import React, { Component } from 'react'; -import { View, ScrollView} from 'react-native'; +import { Text, View, ScrollView, ListView, Dimensions} from 'react-native'; import { withNavigation } from 'react-navigation'; - import Pagination from "../../../services/Pagination"; import ReplyThumbnailItem from './ReplyThumbnailItem' import {FlatList} from 'react-native-gesture-handler'; @@ -15,20 +14,33 @@ class InvertedReplyList extends Component { constructor(props) { super(props); + this.paginationService = null; + this.hasInitialData = true; + this.setPagination(); + this.state = { - list: [], + list: this.paginationService.getResults(), refreshing : false, loadingNext: false }; + this.listRef = null; this.onItemClick = null; - this.invertedlistPagination = null; } setClickHandlers = ()=> { this.onItemClick = this.props.onChildClickDelegate || this.defaultChildClickHandler; } + getPagination = () => { + return this.paginationService; + }; + + componentDidMount () { + this.bindPaginationEvents(); + this.setClickHandlers(); + } + defaultChildClickHandler = ( index )=> { const parentVideoId = this.props.videoId, parentUserId = this.props.userId, @@ -37,35 +49,40 @@ class InvertedReplyList extends Component {     ReplyHelper.openRepliesList(parentUserId, parentVideoId, clonedInstance, index, navigation);   }; + + setPagination() { + let fetchUrl = this.getFetchUrl(); + this.paginationService = this.props.paginationService; + if( !this.paginationService || !( this.paginationService instanceof Pagination)){ + this.paginationService = new Pagination(fetchUrl); + if( this.props.doRender ){ + this.initPagination() + }else { + //Load data later + this.hasInitialData = false; + } + } + } + componentWillUnmount() { this.removePaginationListeners(); this.onItemClick = ()=> {}; } + componentDidUpdate(prevProps, prevState ) { + if( this.props.doRender && this.props.doRender !== prevProps.doRender && !this.hasInitialData ){ + this.initPagination(); + } + } - getPagination = () => { - return this.invertedlistPagination; - }; - - getFetchUrl = () => { - // return `/videos/${3847}/replies`; - return `/videos/${this.props.videoId}/replies`; - }; // region - Pagination and Event Handlers - initPagination() { - // First, take care of existing Pagination if exists. - this.removePaginationListeners(); - console.log('initPagination'); - // Now, create a new one. - let fetchUrl = this.getFetchUrl(); - console.log('fetchUrl',fetchUrl); - this.invertedlistPagination = new Pagination(fetchUrl); - this.bindPaginationEvents(); + initPagination(){ + this.getPagination().initPagination(); } bindPaginationEvents(){ - let pagination = this.invertedlistPagination; + let pagination = this.getPagination(); if ( !pagination ) { return; } @@ -83,7 +100,7 @@ class InvertedReplyList extends Component { } removePaginationListeners(){ - let pagination = this.invertedlistPagination; + let pagination = this.getPagination(); if ( !pagination ) { return; } @@ -97,25 +114,19 @@ class InvertedReplyList extends Component { paginationEvent.removeListener('onBeforeNext'); paginationEvent.removeListener('onNext'); paginationEvent.removeListener('onNextError'); - this.invertedlistPagination = null; } + getFetchUrl = () => { + return `/videos/${3847}/replies`; + return `/videos/${this.props.videoId}/replies`; + }; + scrollToTop(){ this.listRef.scrollToOffset({offset: 0}); } - - // onPullToRefresh = () => { - // fetchUser(this.props.userId , this.onUserFetch ); - // } - // - // onUserFetch =(res) => { - // this.props.onUserFetch && this.props.onUserFetch(res); - // } - beforeRefresh = ( ) => { - //this.props.beforeRefresh && this.props.beforeRefresh(); - //this.onPullToRefresh(); + this.props.beforeRefresh && this.props.beforeRefresh(); let stateObject = {refreshing : true}; if (this.state.loadingNext) { stateObject['loadingNext'] = false; @@ -124,16 +135,10 @@ class InvertedReplyList extends Component { }; onRefresh = ( res ) => { - let results = this.invertedlistPagination.getResults() ; - // if ( !results || results.length < 1) { - // // Create data for empty list. - // results = [ this.props.noResultsData ]; - // } - + let results = this.getPagination().getResults() ; this.props.onRefresh && this.props.onRefresh( results , res ); this.setState({ refreshing : false , list : results }); - // this.setState({ refreshing : false , list :[results[0], results[1]] }); - this.setState({ refreshing : false }); + // this.setState({ refreshing : false , list : [results[0], results[1]] }); } onRefreshError = ( error ) => { @@ -146,7 +151,7 @@ class InvertedReplyList extends Component { } onNext = ( res ) => { - this.setState({ loadingNext : false , list : this.invertedlistPagination.getResults() }); + this.setState({ loadingNext : false , list : this.getPagination().getResults() }); } onNextError = ( error ) => { @@ -154,31 +159,21 @@ class InvertedReplyList extends Component { } getNext = () => { - this.invertedlistPagination.getNext(); + this.getPagination().getNext(); } refresh = () => { - this.invertedlistPagination.refresh(); + this.getPagination().refresh(); }; - // isCurrentUser = () => { - // return this.props.userId === CurrentUser.getUserId(); - // } - _keyExtractor = (item, index) => { return `id_${item.id}`; }; _renderItem = ({item, index}) => { - // Check if this is an empty cell. - return {this.onItemClick(index)}} />; - // if ( item.isEmpty) { - // // Render no results cell here. - // return this.props.getNoResultsCell(item); - // } else { - // // Render People cell - // return this._renderThumbnailCell({item,index}); - // } + + return {this.onItemClick(index)}} />; + }; @@ -186,48 +181,52 @@ class InvertedReplyList extends Component { this.listRef = ref; }; - componentDidMount () { - console.log('InvertedReplyList::InvertedReplyListcomponentDidMount'); - this.initPagination(); - this.refresh(); - this.setClickHandlers(); + getItemSeperatorComponent = () => { + return } - listHeaderComponent = () => { - if (this.props.HeaderComponent){ - let HeaderComponent = this.props.HeaderComponent; - return + getListHeight = () => { + + let noOfItems = this.state.list.length ; + if (this.props.availableHeight > 0 && noOfItems > 0){ + + let heightOfElements = noOfItems * 30, + heightOfSeparator = (noOfItems - 1 ) * 25, + availableScreenHeight = this.props.availableHeight - 50, + heightOfFlatList = heightOfElements + heightOfSeparator; + if (availableScreenHeight < heightOfFlatList ){ + return availableScreenHeight; } + return heightOfFlatList; + } + return 0; }; - getItemSeperatorComponent = () => { - return - } render() { - - return - - - + let height = this.getListHeight(); + return height > 0 ? + : } } +InvertedReplyList.defaultProps = { + paginationService : null +}; + //make this component available to the app export default withNavigation(InvertedReplyList); diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index 5c9cf861..1ef57638 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -14,7 +14,7 @@ import VideoReplySupporterStat from '../CommonComponents/VideoSupporterStat/Vide import ReplyVideoBottomStatus from '../BottomStatus/ReplyVideoBottomStatus'; import DataContract from '../../constants/DataContract'; import ReduxGetters from '../../services/ReduxGetters'; -import InvertedReplyList from '../CommonComponents/InvertedReplyThumbnailList'; +import InvertedReplyList from "../CommonComponents/InvertedReplyThumbnailList"; class VideoReplyRow extends PureComponent { constructor(props) { @@ -84,4 +84,9 @@ class VideoReplyRow extends PureComponent { } } + +VideoReplyRow.defaultProps = { + paginationService : null +} + export default withNavigation(VideoReplyRow); diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index 6f2b5857..67b85243 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -201,6 +201,7 @@ class FullScreenReplyCollection extends PureComponent{ doRender={Math.abs(index - this.state.activeIndex) < maxVideosThreshold} userId={userId} replyDetailId={replyDetailId} + paginationService ={this.getVideoPagination()} onChildClickDelegate={this.childClickHandler} /> ; } diff --git a/src/components/Home/HomeFeedRow.js b/src/components/Home/HomeFeedRow.js index c60847ef..97327aa8 100644 --- a/src/components/Home/HomeFeedRow.js +++ b/src/components/Home/HomeFeedRow.js @@ -24,6 +24,9 @@ import InvertedReplyList from '../CommonComponents/InvertedReplyThumbnailList'; class HomeFeedRow extends PureComponent { constructor(props) { super(props); + this.state ={ + yCoordinateOfReportButton : 0 + } } get userId() { @@ -51,38 +54,77 @@ class HomeFeedRow extends PureComponent { } }; + componentDidMount() { + setTimeout(()=>{ + this.measureWindow(); + }, 10); + }; + + + componentDidUpdate(prevProps) { + + if (prevProps.isActive !== this.props.isActive){ + this.measureWindow(); + } + + }; + + measureWindow = () => { + if (this.props.isActive === true){ + console.log('measureWindow:::isActive true', this.videoId); + this.reportViewRef.measureInWindow(this.calculateYCoordinateOfReportButton); + } + }; + + + calculateYCoordinateOfReportButton = (ox, oy, width, height) => { + this.setState({yCoordinateOfReportButton: oy}); + console.log('============== measurePosition ==============' ); + console.log('ox',ox); + console.log('oy',oy); + console.log('width',width); + console.log('height',height); + console.log('============== measurePosition ==============' ); + }; + render() { return ( - {/**/} - {/* /!**!/*/} - {/* < InvertedReplyList videoId={this.videoId} userId={this.userId}/>*/} - {/**/} + - - {/**/} - - < InvertedReplyList videoId={this.videoId} userId={this.userId}/> - - {/**/} + + - + + + - - + {/*< InvertedReplyList videoId={this.videoId} userId={this.userId}/>*/} - + + + {this.reportViewRef = ref }} onLayout={()=>{}} > + + diff --git a/src/components/Home/styles.js b/src/components/Home/styles.js index 32e6fcc3..caf31452 100644 --- a/src/components/Home/styles.js +++ b/src/components/Home/styles.js @@ -65,8 +65,8 @@ let stylesMap = { bottom: height * 0.05 + 50, left: 10, zIndex: 9, - alignSelf: 'flex-start', - height: height - 200 + // alignSelf: 'flex-start', + //height: height - 200 }, bottomBg: { backgroundColor: 'rgba(0, 0, 0, 0.6)', diff --git a/src/components/UserVideoHistory/UserVideoHistoryRow.js b/src/components/UserVideoHistory/UserVideoHistoryRow.js index 0d4f253a..6672e06c 100644 --- a/src/components/UserVideoHistory/UserVideoHistoryRow.js +++ b/src/components/UserVideoHistory/UserVideoHistoryRow.js @@ -16,13 +16,51 @@ import ReplyIcon from '../CommonComponents/ReplyIcon'; import PepoTxBtn from '../PepoTransactionButton/PepoTxBtn'; import VideoSupporterStat from '../CommonComponents/VideoSupporterStat/VideoSupporterStat'; import DataContract from '../../constants/DataContract'; -import InvertedReplyList from '../CommonComponents/InvertedReplyThumbnailList'; +import InvertedReplyList from "../CommonComponents/InvertedReplyThumbnailList"; class UserVideoHistoryRow extends PureComponent { constructor(props) { super(props); + this.state = { + yCoordinateOfReportButton : 0 + }; } + componentDidMount() { + setTimeout(()=>{ + this.measureWindow(); + }, 10); + }; + + + componentDidUpdate(prevProps) { + + if (prevProps.isActive !== this.props.isActive){ + this.measureWindow(); + } + + }; + + measureWindow = () => { + if (this.props.isActive === true){ + console.log('measureWindow:::isActive true', this.videoId); + this.reportViewRef.measureInWindow(this.calculateYCoordinateOfReportButton); + } + }; + + + calculateYCoordinateOfReportButton = (ox, oy, width, height) => { + this.setState({yCoordinateOfReportButton: oy}); + console.log('============== measurePosition ==============' ); + console.log('ox',ox); + console.log('oy',oy); + console.log('width',width); + console.log('height',height); + console.log('============== measurePosition ==============' ); + }; + + + refetchVideo = () => { new PepoApi(`/videos/${this.props.videoId}`) .get() @@ -63,27 +101,40 @@ class UserVideoHistoryRow extends PureComponent { {!!this.props.videoId && !!this.props.userId && ( - - - - - - - - - - + - + + + + + + + + + + + + + {this.reportViewRef = ref }} onLayout={()=>{}} > + + + + + + Date: Thu, 21 Nov 2019 17:31:10 +0530 Subject: [PATCH 110/302] Pixel call static data --- package-lock.json | 8 ++++++++ package.json | 1 + src/services/PixelCall.js | 36 ++++++++++++++++++++---------------- 3 files changed, 29 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index d76e1cd2..9dfb5b2e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10469,6 +10469,14 @@ "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz", "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==" }, + "moment-timezone": { + "version": "0.5.27", + "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.27.tgz", + "integrity": "sha512-EIKQs7h5sAsjhPCqN6ggx6cEbs94GK050254TIJySD1bzoM5JTYDwAU1IoVOeTOL6Gm27kYJ51/uuvq1kIlrbw==", + "requires": { + "moment": ">= 2.9.0" + } + }, "morgan": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.9.1.tgz", diff --git a/package.json b/package.json index c542f054..13ba1efa 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "lodash": "4.17.11", "metro-react-native-babel-preset": "0.54.1", "moment": "2.24.0", + "moment-timezone": "0.5.27", "native-base": "2.12.1", "numeral": "2.0.6", "qs": "6.7.0", diff --git a/src/services/PixelCall.js b/src/services/PixelCall.js index d691bd8f..cb609e64 100644 --- a/src/services/PixelCall.js +++ b/src/services/PixelCall.js @@ -2,6 +2,8 @@ import {Platform, Dimensions} from 'react-native'; import DeviceInfo from 'react-native-device-info'; import qs from 'qs'; import assignIn from 'lodash/assignIn'; +import momentTimezone from 'moment-timezone'; + import { TRACKER_ENDPOINT } from '../constants/index'; import CurrentUser from "../models/CurrentUser"; @@ -12,7 +14,6 @@ const keyAliasMap = { u_service_id: 'serid', u_session_id: 'sesid', u_timezone: 'tz', - e_timestamp: 'ts', e_entity: 'ee', e_action: 'ea', p_type: 'pt', @@ -28,16 +29,16 @@ const keyAliasMap = { device_width: 'dw', device_height: 'dh', user_agent: 'ua', + mobile_app_version: 'mav', e_data_json: 'ed' }; const staticData = { - t_version: 1.0, - t_gid: 'placeholder_t_gid', + t_version: 2, + t_gid: DeviceInfo.getUniqueID(), u_service_id: 1, u_session_id: 'placeholder_u_session_id', - u_timezone: DeviceInfo.getTimezone(), - e_timestamp: Math.round((new Date).getTime()/1000), + u_timezone: momentTimezone.tz(DeviceInfo.getTimezone()).utcOffset(), device_id: DeviceInfo.getUniqueID(), device_model: DeviceInfo.getModel(), device_platform: DeviceInfo.getSystemVersion(), @@ -45,14 +46,17 @@ const staticData = { device_language: DeviceInfo.getDeviceLocale(), device_width: Dimensions.get('window').width, device_height: Dimensions.get('window').height, - user_agent: DeviceInfo.getUserAgent() + device_type: 'mobile_app', + user_agent: DeviceInfo.getUserAgent(), + mobile_app_version: DeviceInfo.getVersion() }; const makeCompactData = params => { let compactData = {}; for(var key in params){ if (params.hasOwnProperty(key)) { - compactData[keyAliasMap[key]] = typeof params[key] === 'object' ? JSON.stringify(params[key]) : params[key]; + let keyName = keyAliasMap[key] ? keyAliasMap[key] : key; + compactData[keyName] = typeof params[key] === 'object' ? JSON.stringify(params[key]) : params[key]; } } return compactData; @@ -64,21 +68,21 @@ export default (data) => { let pixelData = assignIn({}, staticData, data), currentUserId = CurrentUser.getUserId(); - // Add user context (if any) + // Add user context (if any) else bail out if(currentUserId){ pixelData.u_id = currentUserId; - pixelData.e_data_json.user_id = currentUserId; + } else { + return; } // Compact data let compactData = makeCompactData(pixelData); - // Log - let ts = (new Date).getTime(); - console.log(`PixelCall (${ts}) URL: ${TRACKER_ENDPOINT}, data: `, compactData); - // Fire the fetch call - fetch(`${TRACKER_ENDPOINT}?${qs.stringify(compactData)}`) - .then((response) => console.log(`PixelCall (${ts}) fetch request complete!`)) - .catch((error) => console.log(`PixelCall (${ts}) fetch error: `, error)); + fetch(`${TRACKER_ENDPOINT}?${qs.stringify(compactData)}`, { + headers: { + 'User-Agent': DeviceInfo.getUserAgent() + } + }).then((response) => console.log(`PixelCall to URL: ${TRACKER_ENDPOINT} completed with data: `, compactData)) + .catch((error) => console.log(`PixelCall fetch error: `, error)); } From 5e25b1f4c35202a1d182c2b20b94ad2fe7a4917c Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Thu, 21 Nov 2019 17:43:47 +0530 Subject: [PATCH 111/302] conflicts --- .../UserVideoHistory/UserVideoHistoryRow.js | 25 ++++++------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/src/components/UserVideoHistory/UserVideoHistoryRow.js b/src/components/UserVideoHistory/UserVideoHistoryRow.js index 6672e06c..2c1e725b 100644 --- a/src/components/UserVideoHistory/UserVideoHistoryRow.js +++ b/src/components/UserVideoHistory/UserVideoHistoryRow.js @@ -85,7 +85,7 @@ class UserVideoHistoryRow extends PureComponent { render() { return ( - + - - - - - - {!!this.props.videoId && !!this.props.userId && ( - - @@ -127,19 +120,17 @@ class UserVideoHistoryRow extends PureComponent { - - - + )} From 366a435dca946657fc1961e0a053bbbb90a750d3 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Thu, 21 Nov 2019 18:16:28 +0530 Subject: [PATCH 112/302] Dev test --- .../FullScreenReplyCollection/VideoReplyRow.js | 8 +++++--- src/components/ReplyCollection/index.js | 6 +----- src/components/VideoReplies/index.js | 10 +++------- src/services/CameraWorker.js | 2 ++ src/services/ReduxGetters.js | 10 ++++++++++ 5 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index e6e98174..8cb31f28 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -5,6 +5,7 @@ import FanVideo from "../VideoWrapper/FanVideo"; import ShareIcon from "../CommonComponents/ShareIcon"; import ReportVideo from "../CommonComponents/ReportVideo"; import BottomReplyBar from "../CommonComponents/BottomReplyBar"; +import ReplyIcon from "../CommonComponents/ReplyIcon"; import PepoApi from '../../services/PepoApi'; import inlineStyles from './styles'; @@ -20,6 +21,8 @@ import CommonStyle from "../../theme/styles/Common"; class VideoReplyRow extends PureComponent { constructor(props) { super(props); + this.parentVideoId = ReduxGetters.getReplyParentVideoId( this.props.replyDetailId ); + this.parentUserId = ReduxGetters.getReplyParentUserId( this.props.replyDetailId ); } refetchVideoReply = () => { @@ -29,8 +32,6 @@ class VideoReplyRow extends PureComponent { .catch((error) => {}); }; - //Required from Backend , we need video stats entity - render() { let userId = this.props.userId, replyDetailId = this.props.replyDetailId, @@ -57,6 +58,7 @@ class VideoReplyRow extends PureComponent { userId={userId} entityId={replyDetailId} /> + @@ -76,7 +78,7 @@ class VideoReplyRow extends PureComponent { - + ); } diff --git a/src/components/ReplyCollection/index.js b/src/components/ReplyCollection/index.js index 8ed17674..5f6462df 100644 --- a/src/components/ReplyCollection/index.js +++ b/src/components/ReplyCollection/index.js @@ -212,14 +212,10 @@ class ReplyCollection extends PureComponent { onVideoClick = ( index ) => { const clonedInstance = this.videoPagination.fetchServices.cloneInstance(); - //TODO @ashutosh to understand this.props.navigation.push("FullScreenReplyCollection", { "fetchServices" : clonedInstance, "currentIndex": index, - "baseUrl": this.props.fetchUrl, - "amount": this.props.amount, - 'parentUserId': this.props.userId, - 'parentVideoId': this.props.videoId + "baseUrl": this.props.fetchUrl }); } diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index 22b8e91f..c7e5b7a2 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -5,13 +5,11 @@ import { Image, TouchableOpacity, Dimensions, - Animated, Platform ,TouchableWithoutFeedback, - StatusBar + Animated ,TouchableWithoutFeedback } from 'react-native'; import { ifIphoneX } from 'react-native-iphone-x-helper'; -import plusIcon from '../../assets/user-video-capture-icon-selected.png'; import pepoIcon from "../../assets/pepo-tx-icon.png"; import inlineStyles from './styles'; import crossIcon from '../../assets/cross_icon.png'; @@ -28,14 +26,12 @@ import DataContract from '../../constants/DataContract'; import ReduxGetters from '../../services/ReduxGetters'; import Pricer from "../../services/Pricer"; import {getVideoReplyObject, replyPreValidationAndMessage} from "../../helpers/cameraHelper"; -import Colors from '../../theme/styles/Colors'; import VideoReplyIcon from '../../assets/reply_video_icon.png'; const { width, height } = Dimensions.get('window'); const landScape = width > height; const topPadding = getInset('top', landScape); const bottomPadding = getInset('bottom', landScape); -const finalPadding = topPadding - bottomPadding; const bottomReplyViewHeight = 54; const listBottomPadding = height - (height/1.5)+bottomReplyViewHeight ; @@ -86,8 +82,8 @@ class VideoRepliesScreen extends PureComponent { componentWillUnmount() { this.onAnimatedValueChange= () => {}; this.animatedValue.removeListener(this.listener); - //videoUploaderComponent.removeListener('show'); - //videoUploaderComponent.removeListener('hide'); + videoUploaderComponent.removeListener('show'); + videoUploaderComponent.removeListener('hide'); } showVideoUploader = () => { diff --git a/src/services/CameraWorker.js b/src/services/CameraWorker.js index a050297e..ab605d54 100644 --- a/src/services/CameraWorker.js +++ b/src/services/CameraWorker.js @@ -180,6 +180,8 @@ class CameraWorker extends PureComponent { }; videoUploadedSuccessCallback = ( ostWorkflowContext, ostWorkflowEntity ) => { + //todo @ashutosh + let replyDetailId = deepGet(this.props.recorded_video , 'reply_obj.replyDetailId') console.log('CameraWorker.videoUploadedSuccessCallback'); Toast.show({ text: 'Your video uploaded successfully.', diff --git a/src/services/ReduxGetters.js b/src/services/ReduxGetters.js index cfa865e5..20259a9b 100644 --- a/src/services/ReduxGetters.js +++ b/src/services/ReduxGetters.js @@ -506,6 +506,16 @@ class ReduxGetters { state = state || Store.getState(); return deepGet(state, `reply_detail_entities.id_${id}.status`, '').toLowerCase() == appConfig.replyStatusMap.deleted; } + + getReplyParentVideoId(id , state){ + state = state || Store.getState(); + return deepGet(state, `reply_detail_entities.id_${id}.parent_id`); + } + + getReplyParentUserId(id , state){ + state = state || Store.getState(); + return deepGet(state, `reply_detail_entities.id_${id}.creator_user_id`); + } } export default new ReduxGetters(); From 273956654f5a97169e1b12f3e095cbbac8998245 Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Thu, 21 Nov 2019 18:36:17 +0530 Subject: [PATCH 113/302] videoreplyrow integration with inverted list --- .../InvertedReplyThumbnailList/index.js | 3 +- .../VideoReplyRow.js | 70 ++++++++++++++++--- .../FullScreenVideoCollection/index.js | 1 + src/constants/DataContract.js | 3 +- 4 files changed, 63 insertions(+), 14 deletions(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index f64b296e..e1cf29ca 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -44,7 +44,7 @@ class InvertedReplyList extends Component { defaultChildClickHandler = ( index )=> { const parentVideoId = this.props.videoId, parentUserId = this.props.userId, - clonedInstance = this.invertedlistPagination.fetchServices.cloneInstance(), + clonedInstance = this.getPagination().fetchServices.cloneInstance(), navigation = this.props.navigation;     ReplyHelper.openRepliesList(parentUserId, parentVideoId, clonedInstance, index, navigation);   }; @@ -117,7 +117,6 @@ class InvertedReplyList extends Component { } getFetchUrl = () => { - return `/videos/${3847}/replies`; return `/videos/${this.props.videoId}/replies`; }; diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index 1ef57638..b2c80047 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -19,9 +19,47 @@ import InvertedReplyList from "../CommonComponents/InvertedReplyThumbnailList"; class VideoReplyRow extends PureComponent { constructor(props) { super(props); + this.state = { + yCoordinateOfReportButton : 0 + }; } - refetchVideoReply = () => { + + componentDidMount() { + setTimeout(()=>{ + this.measureWindow(); + }, 10); + }; + + + componentDidUpdate(prevProps) { + + if (prevProps.isActive !== this.props.isActive){ + this.measureWindow(); + } + + }; + + measureWindow = () => { + if (this.props.isActive === true){ + console.log('measureWindow:::isActive true', this.videoId); + this.reportViewRef.measureInWindow(this.calculateYCoordinateOfReportButton); + } + }; + + + calculateYCoordinateOfReportButton = (ox, oy, width, height) => { + this.setState({yCoordinateOfReportButton: oy}); + console.log('============== measurePosition ==============' ); + console.log('ox',ox); + console.log('oy',oy); + console.log('width',width); + console.log('height',height); + console.log('============== measurePosition ==============' ); + }; + + + refetchVideoReply = () => { new PepoApi(`/replies/${this.props.replyDetailId}`) .get() .then((res) => {}) @@ -34,7 +72,9 @@ class VideoReplyRow extends PureComponent { let userId = this.props.userId, replyDetailId = this.props.replyDetailId, videoId = ReduxGetters.getReplyEntityId(replyDetailId), - parentVideoId = ReduxGetters.getReplyEntity( replyDetailId )[DataContract.replies.parentVideoIdKey]; + parentVideoId = ReduxGetters.getReplyEntity( replyDetailId )[DataContract.replies.parentVideoIdKey], + parentUserId = ReduxGetters.getReplyEntity(replyDetailId)[DataContract.replies.creatorUserIdKey]; + ; return ( - - - - - - {!!videoId && !!userId && ( - - + + + + + + + + + {this.reportViewRef = ref }} onLayout={()=>{}} > + - + {/**/} + )} diff --git a/src/components/FullScreenVideoCollection/index.js b/src/components/FullScreenVideoCollection/index.js index e565f113..5d2a5ecf 100644 --- a/src/components/FullScreenVideoCollection/index.js +++ b/src/components/FullScreenVideoCollection/index.js @@ -11,6 +11,7 @@ import TopStatus from "../Home/TopStatus"; import CommonStyle from "../../theme/styles/Common"; import entityHelper from '../../helpers/EntityHelper'; import DataContract from "../../constants/DataContract"; +import VideoReplyRow from "../../components/FullScreenReplyCollection/VideoReplyRow"; const maxVideosThreshold = 3; diff --git a/src/constants/DataContract.js b/src/constants/DataContract.js index 23b724c9..cad53a98 100644 --- a/src/constants/DataContract.js +++ b/src/constants/DataContract.js @@ -53,7 +53,8 @@ export default { video: "VIDEO" }, replyDetailIdKey: 'reply_detail_id', - parentVideoIdKey: 'parent_id' + parentVideoIdKey: 'parent_id', + creatorUserIdKey: 'creator_user_id' }, common: { From 0d7dd18d0a268e231d650081865b142ad7b4bd8c Mon Sep 17 00:00:00 2001 From: Akshay Raje Date: Thu, 21 Nov 2019 18:48:17 +0530 Subject: [PATCH 114/302] Pixel call fires --- .../CommonComponents/UserInfo/index.js | 11 ++++------ .../Transaction/TransactionScreen.js | 21 ++++++------------- src/services/PixelCall.js | 20 +++++++++++------- 3 files changed, 23 insertions(+), 29 deletions(-) diff --git a/src/components/CommonComponents/UserInfo/index.js b/src/components/CommonComponents/UserInfo/index.js index 14dcc99e..1a4dfe0c 100644 --- a/src/components/CommonComponents/UserInfo/index.js +++ b/src/components/CommonComponents/UserInfo/index.js @@ -51,15 +51,12 @@ class UserInfo extends React.PureComponent { } onDidFocus = (payload) => { - let pixelParams = { + PixelCall({ e_entity: 'page', e_action: 'view', - e_data_json: { - profile_user_id: this.props.userId - }, - p_type: 'user_profile' - }; - PixelCall(pixelParams); + p_type: 'user_profile', + p_name: this.props.userId + }); }; goToSupporting = () => { diff --git a/src/components/Transaction/TransactionScreen.js b/src/components/Transaction/TransactionScreen.js index 9991b93e..e83cfe47 100644 --- a/src/components/Transaction/TransactionScreen.js +++ b/src/components/Transaction/TransactionScreen.js @@ -432,22 +432,13 @@ class TransactionScreen extends Component { } dropPixel() { - let pixelParams = { + PixelCall({ + e_entity: 'user', e_action: 'contribution', - e_data_json: { - profile_user_id: this.toUser.id, - amount: this.state.btAmount - } - }; - if (this.videoId) { - pixelParams.e_entity = 'video'; - pixelParams.e_data_json.video_id = this.videoId; - pixelParams.p_type = 'feed'; - } else { - pixelParams.e_entity = 'user_profile'; - pixelParams.p_type = 'user_profile'; - } - PixelCall(pixelParams); + p_type: 'user_profile', + p_name: this.toUser.id, + amount: this.state.btAmount + }); } onFlowInterrupt(ostWorkflowContext, error) { diff --git a/src/services/PixelCall.js b/src/services/PixelCall.js index cb609e64..bbcdb1c1 100644 --- a/src/services/PixelCall.js +++ b/src/services/PixelCall.js @@ -29,7 +29,6 @@ const keyAliasMap = { device_width: 'dw', device_height: 'dh', user_agent: 'ua', - mobile_app_version: 'mav', e_data_json: 'ed' }; @@ -51,6 +50,8 @@ const staticData = { mobile_app_version: DeviceInfo.getVersion() }; +const mandatoryKeys = ['e_entity', 'e_action', 'p_type', 'p_name']; + const makeCompactData = params => { let compactData = {}; for(var key in params){ @@ -65,14 +66,19 @@ const makeCompactData = params => { export default (data) => { // Extend outer data with staticData - let pixelData = assignIn({}, staticData, data), - currentUserId = CurrentUser.getUserId(); + let pixelData = assignIn({}, staticData, data); // Add user context (if any) else bail out - if(currentUserId){ - pixelData.u_id = currentUserId; - } else { - return; + let currentUserId = CurrentUser.getUserId(); + if(!currentUserId) return; + pixelData.u_id = currentUserId; + + // Validate and bail out on fail + for(var mi = 0; mi < mandatoryKeys.length; mi++){ + if(!pixelData[mandatoryKeys[mi]]){ + console.log(`PixelCall validation failed for ${mandatoryKeys[mi]}`); + return; + } } // Compact data From e10c1272020cf15ca563122d65c5fe30e0084aaa Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Thu, 21 Nov 2019 19:53:22 +0530 Subject: [PATCH 115/302] code changes --- .../InvertedReplyThumbnailList/index.js | 16 +++++++++++++++- .../CommonComponents/VideoReplyPlayer/index.js | 1 + .../FullScreenReplyCollection/VideoReplyRow.js | 2 ++ .../FullScreenReplyCollection/index.js | 2 ++ .../FullScreenVideoCollection/index.js | 1 + .../UserVideoHistory/UserVideoHistoryRow.js | 2 +- 6 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index e1cf29ca..9ff8500c 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -6,6 +6,8 @@ import ReplyThumbnailItem from './ReplyThumbnailItem' import {FlatList} from 'react-native-gesture-handler'; import ReplyHelper from '../../../helpers/ReplyHelper'; +const ITEM_HEIGHT = 55; + class InvertedReplyList extends Component { static navigationOptions = { @@ -68,12 +70,19 @@ class InvertedReplyList extends Component { this.removePaginationListeners(); this.onItemClick = ()=> {}; } + componentDidUpdate(prevProps, prevState ) { if( this.props.doRender && this.props.doRender !== prevProps.doRender && !this.hasInitialData ){ this.initPagination(); } + if(this.props.currentIndex != prevProps.currentIndex){ + this.listRef && this.listRef.scrollToIndex({index : this.props.currentIndex}); + } } + onScrollToIndexFailed =( info) => { + console.log("======onScrollToIndexFailed=====" , info ); + } // region - Pagination and Event Handlers @@ -175,7 +184,6 @@ class InvertedReplyList extends Component { }; - setListRef = (ref) => { this.listRef = ref; }; @@ -201,6 +209,9 @@ class InvertedReplyList extends Component { return 0; }; + getItemLayout= (data, index) => { + return {length: ITEM_HEIGHT, offset: ITEM_HEIGHT * index, index} ; + } render() { let height = this.getListHeight(); @@ -219,6 +230,9 @@ class InvertedReplyList extends Component { numColumns={this.numColumns} key={this.flatListKey} nestedScrollEnabled={true} + initialScrollIndex={this.props.currentIndex} + getItemLayout={this.getItemLayout} + onScrollToIndexFailed={this.onScrollToIndexFailed} />: } } diff --git a/src/components/CommonComponents/VideoReplyPlayer/index.js b/src/components/CommonComponents/VideoReplyPlayer/index.js index 800aace8..f8e644b2 100644 --- a/src/components/CommonComponents/VideoReplyPlayer/index.js +++ b/src/components/CommonComponents/VideoReplyPlayer/index.js @@ -87,6 +87,7 @@ class VideoReplyPlayer extends PureComponent { doRender={true} userId={this.state.userId} replyDetailId={this.replyDetailId} + currentIndex={0} /> {/* // {TODO @Preshita move to common component } */} this.props.navigation.goBack()} style={inlineStyles.historyBackSkipFont}> diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index b2c80047..50c19624 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -95,6 +95,8 @@ class VideoReplyRow extends PureComponent { doRender={this.props.doRender} availableHeight={this.state.yCoordinateOfReportButton} paginationService={this.props.paginationService} + onChildClickDelegate={this.props.onChildClickDelegate} + currentIndex={this.props.currentIndex} /> diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index 67b85243..2a3f1190 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -203,6 +203,7 @@ class FullScreenReplyCollection extends PureComponent{ replyDetailId={replyDetailId} paginationService ={this.getVideoPagination()} onChildClickDelegate={this.childClickHandler} + currentIndex={this.state.activeIndex} /> ; } @@ -212,6 +213,7 @@ class FullScreenReplyCollection extends PureComponent{ scrollToIndex = ( index )=>{ this.flatlistRef.scrollToIndex({index: index}); + this.setActiveIndex(); } onViewableItemsChanged = (data) => { diff --git a/src/components/FullScreenVideoCollection/index.js b/src/components/FullScreenVideoCollection/index.js index 5d2a5ecf..c44be97e 100644 --- a/src/components/FullScreenVideoCollection/index.js +++ b/src/components/FullScreenVideoCollection/index.js @@ -153,6 +153,7 @@ class FullScreenVideoCollection extends PureComponent{ doRender={Math.abs(index - this.state.activeIndex) < maxVideosThreshold} userId={userId} replyDetailId={replyDetailId} + currentIndex={this.currentIndex} /> ; } diff --git a/src/components/UserVideoHistory/UserVideoHistoryRow.js b/src/components/UserVideoHistory/UserVideoHistoryRow.js index 2c1e725b..45859ee9 100644 --- a/src/components/UserVideoHistory/UserVideoHistoryRow.js +++ b/src/components/UserVideoHistory/UserVideoHistoryRow.js @@ -115,7 +115,7 @@ class UserVideoHistoryRow extends PureComponent { entityId={this.props.videoId} /> - + {this.reportViewRef = ref }} onLayout={()=>{}} > From 5791a895a2261a228756ac9d3c940fd55d0343c3 Mon Sep 17 00:00:00 2001 From: Akshay Raje Date: Thu, 21 Nov 2019 20:07:49 +0530 Subject: [PATCH 116/302] Pixel call validation fix --- src/services/PixelCall.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/services/PixelCall.js b/src/services/PixelCall.js index bbcdb1c1..3ab02af7 100644 --- a/src/services/PixelCall.js +++ b/src/services/PixelCall.js @@ -50,7 +50,7 @@ const staticData = { mobile_app_version: DeviceInfo.getVersion() }; -const mandatoryKeys = ['e_entity', 'e_action', 'p_type', 'p_name']; +const mandatoryKeys = ['e_entity', 'e_action', 'p_type']; const makeCompactData = params => { let compactData = {}; @@ -76,7 +76,13 @@ export default (data) => { // Validate and bail out on fail for(var mi = 0; mi < mandatoryKeys.length; mi++){ if(!pixelData[mandatoryKeys[mi]]){ - console.log(`PixelCall validation failed for ${mandatoryKeys[mi]}`); + console.log(`PixelCall validation failed. Mandatory key ${mandatoryKeys[mi]} missing.`); + return; + } + } + for(var key in pixelData){ + if (pixelData.hasOwnProperty(key) && !pixelData[key]) { + console.log(`PixelCall validation failed. Invalid value of ${mandatoryKeys[mi]}.`); return; } } From 83b0fe150e9a364b0668bdf783705795ad3ebed0 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Thu, 21 Nov 2019 20:08:00 +0530 Subject: [PATCH 117/302] Merge branch 'video-replies-primary' of github.com:ostdotcom/pepo-react into video-replies-primary --- .../CommonComponents/UserInfo/index.js | 11 +++---- .../CommonComponents/VideoPlayer/index.js | 13 ++++++-- .../VideoReplyPlayer/index.js | 9 ++++++ .../VideoReplyRow.js | 16 ++++++++++ .../FullScreenReplyCollection/index.js | 11 +++++++ .../FullScreenVideoRow.js | 17 ++++++++++ .../FullScreenVideoCollection/index.js | 19 ++++++++++++ src/components/Home/HomeFeedRow.js | 17 ++++++++-- src/components/PepoTransactionButton/Base.js | 8 +++-- .../PepoTransactionButton/PepoTxBtn.js | 7 ++--- .../PepoTransactionButton/ReplyPepoTxBtn.js | 7 ++--- .../Transaction/TransactionScreen.js | 21 ++++--------- .../UserVideoHistory/UserVideoHistoryRow.js | 20 +++++++++++- src/components/UserVideoHistory/index.js | 8 +++++ src/components/VideoCollections/index.js | 1 + src/components/VideoTags/index.js | 1 + src/components/VideoWrapper/Base.js | 31 +++++++------------ src/services/CameraWorker.js | 2 +- src/services/PixelCall.js | 20 +++++++----- 19 files changed, 169 insertions(+), 70 deletions(-) diff --git a/src/components/CommonComponents/UserInfo/index.js b/src/components/CommonComponents/UserInfo/index.js index 14dcc99e..1a4dfe0c 100644 --- a/src/components/CommonComponents/UserInfo/index.js +++ b/src/components/CommonComponents/UserInfo/index.js @@ -51,15 +51,12 @@ class UserInfo extends React.PureComponent { } onDidFocus = (payload) => { - let pixelParams = { + PixelCall({ e_entity: 'page', e_action: 'view', - e_data_json: { - profile_user_id: this.props.userId - }, - p_type: 'user_profile' - }; - PixelCall(pixelParams); + p_type: 'user_profile', + p_name: this.props.userId + }); }; goToSupporting = () => { diff --git a/src/components/CommonComponents/VideoPlayer/index.js b/src/components/CommonComponents/VideoPlayer/index.js index 0f04f1c1..c7751712 100644 --- a/src/components/CommonComponents/VideoPlayer/index.js +++ b/src/components/CommonComponents/VideoPlayer/index.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import VideoRowComponent from "../../UserVideoHistory/UserVideoHistoryRow"; +import UserVideoHistoryRow from "../../UserVideoHistory/UserVideoHistoryRow"; import TopStatus from "../../Home/TopStatus"; import deepGet from "lodash/get"; import PepoApi from "../../../services/PepoApi"; @@ -71,6 +71,13 @@ class VideoPlayer extends Component { } }; + getPixelDropData = () => { + return pixelParams = { + p_type: 'single_video', + p_name: this.videoId + }; + } + render() { if(this.state.isDeleted){ return @@ -78,8 +85,8 @@ class VideoPlayer extends Component { return ( - + ) diff --git a/src/components/CommonComponents/VideoReplyPlayer/index.js b/src/components/CommonComponents/VideoReplyPlayer/index.js index 826e7bb9..fbd8897a 100644 --- a/src/components/CommonComponents/VideoReplyPlayer/index.js +++ b/src/components/CommonComponents/VideoReplyPlayer/index.js @@ -74,6 +74,14 @@ class VideoReplyPlayer extends PureComponent { } }; + getPixelDropData = () => { + return pixelParams = { + e_entity: 'reply', + p_type: 'single_reply', + p_name: this.replyDetailId, + }; + } + render() { if(this.state.isDeleted){ return @@ -86,6 +94,7 @@ class VideoReplyPlayer extends PureComponent { doRender={true} userId={this.state.userId} replyDetailId={this.replyDetailId} + getPixelDropData={this.getPixelDropData} /> diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index 8cb31f28..2f33bb91 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -17,6 +17,7 @@ import ReplyVideoBottomStatus from '../BottomStatus/ReplyVideoBottomStatus'; import DataContract from '../../constants/DataContract'; import ReduxGetters from '../../services/ReduxGetters'; import CommonStyle from "../../theme/styles/Common"; +import assignIn from 'lodash/assignIn'; class VideoReplyRow extends PureComponent { constructor(props) { @@ -32,6 +33,12 @@ class VideoReplyRow extends PureComponent { .catch((error) => {}); }; + getPixelDropData = () => { + const parentData = this.props.getPixelDropData(); + const pixelParams = { e_entity: 'reply' , parent_video_id : this.parentVideoId , reply_detail_id :this.props.replyDetailId }; + return assignIn({}, pixelParams, parentData); + } + render() { let userId = this.props.userId, replyDetailId = this.props.replyDetailId, @@ -46,6 +53,7 @@ class VideoReplyRow extends PureComponent { videoId={videoId} doRender={this.props.doRender} isActive={this.props.isActive} + getPixelDropData={this.getPixelDropData} /> {!!videoId && !!userId && ( @@ -57,6 +65,7 @@ class VideoReplyRow extends PureComponent { resyncDataDelegate={this.refetchVideoReply} userId={userId} entityId={replyDetailId} + getPixelDropData={this.getPixelDropData} /> @@ -84,4 +93,11 @@ class VideoReplyRow extends PureComponent { } } +VideoReplyRow.defaultProps = { + getPixelDropData: function(){ + console.warn("getPixelDropData props is mandatory for Video component"); + return {}; + } + }; + export default withNavigation(VideoReplyRow); diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index 516e1092..52559b9b 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -140,11 +140,22 @@ class FullScreenReplyCollection extends PureComponent{ } }; + getPixelDropData = ( replyDetailId ) => { + return () => { + return { + e_entity: 'reply', + p_type: 'video_reply', + p_name: replyDetailId + }; + } + } + _renderVideoReplyRow(item, index){ let userId = deepGet(item,'payload.user_id'), replyDetailId = deepGet(item,`payload.${DataContract.replies.replyDetailIdKey}`); return {}); }; + getPixelDropData = () => { + const parentData = this.props.getPixelDropData(); + const pixelParams = { e_entity: 'video' , video_id : this.videoId}; + return assignIn({}, pixelParams, parentData); + } + render() { return ( @@ -42,6 +49,7 @@ class FullScreeVideoRow extends PureComponent { videoId={this.videoId} doRender={this.props.doRender} isActive={this.props.isActive} + getPixelDropData={this.getPixelDropData} /> {!!this.videoId && !!this.userId && ( @@ -53,6 +61,7 @@ class FullScreeVideoRow extends PureComponent { resyncDataDelegate={this.refetchVideo} userId={this.userId} entityId={this.videoId} + getPixelDropData={this.getPixelDropData} getPixelDropData={() => {p_type: 'tag'}} // @todo to confirm this /> @@ -80,4 +89,12 @@ class FullScreeVideoRow extends PureComponent { } } +FullScreeVideoRow.defaultProps = { + getPixelDropData: function(){ + console.warn("getPixelDropData props is mandatory for Video component"); + return {}; + } + }; + + export default withNavigation(FullScreeVideoRow); diff --git a/src/components/FullScreenVideoCollection/index.js b/src/components/FullScreenVideoCollection/index.js index 47e58815..0d98667f 100644 --- a/src/components/FullScreenVideoCollection/index.js +++ b/src/components/FullScreenVideoCollection/index.js @@ -29,6 +29,7 @@ class FullScreenVideoCollection extends PureComponent{ this.setVideoPagination(); this.paginationEvent = this.getVideoPagination().event; this.currentIndex = this.props.navigation.getParam("currentIndex"); + this.tagId = this.props.navigation.getParam("tagId"); this.isScrolled = false ; this.willFocusSubscription = null ; this.flatlistRef = null; @@ -145,11 +146,28 @@ class FullScreenVideoCollection extends PureComponent{ }; + getPixelDropData = () => { + return pixelParams = { + e_entity: 'video', + p_type: 'tag', + p_name: this.tagId, + }; + } + + getReplyPixelDrop = () => { + return pixelParams = { + e_entity: 'reply', + p_type: 'tag', + p_name: this.tagId, + }; + } + _renderVideoReplyRow(item, index){ let userId = deepGet(item,'payload.user_id'), replyDetailId = deepGet(item,`payload.${DataContract.replies.replyDetailIdKey}`); return ; diff --git a/src/components/Home/HomeFeedRow.js b/src/components/Home/HomeFeedRow.js index 4163473f..1dd42e78 100644 --- a/src/components/Home/HomeFeedRow.js +++ b/src/components/Home/HomeFeedRow.js @@ -6,12 +6,11 @@ import FanVideo from '../VideoWrapper/FanVideo'; import ShareIcon from "../CommonComponents/ShareIcon"; import PepoApi from '../../services/PepoApi'; import reduxGetter from '../../services/ReduxGetters'; -import CurrentUser from '../../models/CurrentUser'; +import assignIn from 'lodash/assignIn'; import VideoBottomStatus from '../BottomStatus/VideoBottomStatus'; import inlineStyles from './styles'; -import utilities from '../../services/Utilities'; import ReportVideo from "../CommonComponents/ReportVideo"; import ReplyIcon from '../CommonComponents/ReplyIcon'; import PepoTxBtn from '../PepoTransactionButton/PepoTxBtn'; @@ -39,6 +38,16 @@ class HomeFeedRow extends PureComponent { .catch((error) => {}); }; + getPixelDropData = () => { + const parentData = this.props.getPixelDropData && this.props.getPixelDropData() || {}; + const pixelParams = { + e_entity: 'video', + p_type: 'feed', + video_id: this.videoId, + }; + return assignIn({}, pixelParams, parentData); + } + render() { return ( @@ -50,6 +59,7 @@ class HomeFeedRow extends PureComponent { doRender={this.props.doRender} isActive={this.props.isActive} shouldPlay={this.props.shouldPlay} + getPixelDropData={this.getPixelDropData} /> @@ -60,7 +70,7 @@ class HomeFeedRow extends PureComponent { resyncDataDelegate={this.refetchFeed} userId={this.userId} entityId={this.videoId} - getPixelDropData={() => {p_type: 'feed'}} + getPixelDropData={this.getPixelDropData} /> @@ -81,4 +91,5 @@ class HomeFeedRow extends PureComponent { } } + export default withNavigation(HomeFeedRow); diff --git a/src/components/PepoTransactionButton/Base.js b/src/components/PepoTransactionButton/Base.js index 58f02d8e..5127d2ca 100644 --- a/src/components/PepoTransactionButton/Base.js +++ b/src/components/PepoTransactionButton/Base.js @@ -117,7 +117,8 @@ class Base extends PureComponent { } getDropPixel(){ - throw "Overwrite"; + console.log("getDropPixel is mandatory to be implemented in Transaction button"); + return {}; } dropPixel() { @@ -244,8 +245,9 @@ class Base extends PureComponent { } Base.defaultProps = { - getPixelDropData: () => { - throw "error"; + getPixelDropData: function(){ + console.warn("getPixelDropData props is mandatory for Video component"); + return {}; } }; diff --git a/src/components/PepoTransactionButton/PepoTxBtn.js b/src/components/PepoTransactionButton/PepoTxBtn.js index e186b8ba..47cf7bcf 100644 --- a/src/components/PepoTransactionButton/PepoTxBtn.js +++ b/src/components/PepoTransactionButton/PepoTxBtn.js @@ -41,11 +41,8 @@ class PepoTxBtn extends Base { defaultData = { e_entity: 'video', e_action: 'contribution', - e_data_json: { - video_id: this.props.entityId, - profile_user_id: this.props.userId, - amount: this.btAmount - } + video_id: this.props.entityId, + amount: this.btAmount }; return assignIn({}, specificData, defaultData); } diff --git a/src/components/PepoTransactionButton/ReplyPepoTxBtn.js b/src/components/PepoTransactionButton/ReplyPepoTxBtn.js index 192cba93..ba5087c3 100644 --- a/src/components/PepoTransactionButton/ReplyPepoTxBtn.js +++ b/src/components/PepoTransactionButton/ReplyPepoTxBtn.js @@ -40,11 +40,8 @@ class ReplyPepoTxBtn extends Base { defaultData = { e_entity: 'reply', e_action: 'contribution', - e_data_json: { - reply_id: this.props.entityId, - profile_user_id: this.props.userId, - amount: this.btAmount - } + reply_detail_id: this.props.entityId, + amount: this.btAmount }; return assignIn({}, specificData, defaultData); } diff --git a/src/components/Transaction/TransactionScreen.js b/src/components/Transaction/TransactionScreen.js index 9991b93e..e83cfe47 100644 --- a/src/components/Transaction/TransactionScreen.js +++ b/src/components/Transaction/TransactionScreen.js @@ -432,22 +432,13 @@ class TransactionScreen extends Component { } dropPixel() { - let pixelParams = { + PixelCall({ + e_entity: 'user', e_action: 'contribution', - e_data_json: { - profile_user_id: this.toUser.id, - amount: this.state.btAmount - } - }; - if (this.videoId) { - pixelParams.e_entity = 'video'; - pixelParams.e_data_json.video_id = this.videoId; - pixelParams.p_type = 'feed'; - } else { - pixelParams.e_entity = 'user_profile'; - pixelParams.p_type = 'user_profile'; - } - PixelCall(pixelParams); + p_type: 'user_profile', + p_name: this.toUser.id, + amount: this.state.btAmount + }); } onFlowInterrupt(ostWorkflowContext, error) { diff --git a/src/components/UserVideoHistory/UserVideoHistoryRow.js b/src/components/UserVideoHistory/UserVideoHistoryRow.js index 3029731c..a21772c7 100644 --- a/src/components/UserVideoHistory/UserVideoHistoryRow.js +++ b/src/components/UserVideoHistory/UserVideoHistoryRow.js @@ -16,6 +16,7 @@ import VideoSupporterStat from '../CommonComponents/VideoSupporterStat/VideoSupp import DataContract from '../../constants/DataContract'; import BottomReplyBar from '../CommonComponents/BottomReplyBar'; import CommonStyle from "../../theme/styles/Common"; +import assignIn from 'lodash/assignIn'; class UserVideoHistoryRow extends PureComponent { constructor(props) { @@ -32,6 +33,15 @@ class UserVideoHistoryRow extends PureComponent { } } + getPixelDropData = () => { + const parentData = this.props.getPixelDropData() ; + const pixelParams = { + e_entity: 'video', + video_id: this.props.videoId, + }; + return assignIn({}, pixelParams, parentData); + } + refetchVideo = () => { new PepoApi(`/videos/${this.props.videoId}`) .get() @@ -50,6 +60,7 @@ class UserVideoHistoryRow extends PureComponent { videoId={this.props.videoId} doRender={this.props.doRender} isActive={this.props.isActive} + getPixelDropData={this.getPixelDropData} /> {!!this.props.videoId && !!this.props.userId && ( @@ -61,7 +72,7 @@ class UserVideoHistoryRow extends PureComponent { resyncDataDelegate={this.refetchVideo} userId={this.props.userId} entityId={this.props.videoId} - getPixelDropData={() => {p_type:this.pageType}} + getPixelDropData={this.getPixelDropData} /> @@ -89,4 +100,11 @@ class UserVideoHistoryRow extends PureComponent { } } +UserVideoHistoryRow.defaultProps = { + getPixelDropData: function(){ + console.warn("getPixelDropData props is mandatory for UserVideoHistoryRow component"); + return {}; + } +}; + export default withNavigation(UserVideoHistoryRow); diff --git a/src/components/UserVideoHistory/index.js b/src/components/UserVideoHistory/index.js index 887c7d81..8446e1b2 100644 --- a/src/components/UserVideoHistory/index.js +++ b/src/components/UserVideoHistory/index.js @@ -119,9 +119,17 @@ class UserVideoHistoryScreen extends PureComponent{ return `id_${item}`; }; + getPixelDropData = () => { + return pixelParams = { + p_type: 'user_profile', + p_name: this.userId + }; + } + _renderItem = ({ item, index }) => { const videoId = reduxGetters.getUserVideoId(item) ; return ; diff --git a/src/components/VideoCollections/index.js b/src/components/VideoCollections/index.js index 524d590d..ef011588 100644 --- a/src/components/VideoCollections/index.js +++ b/src/components/VideoCollections/index.js @@ -196,6 +196,7 @@ class VideoCollections extends PureComponent { const clonedInstance = this.videoPagination.fetchServices.cloneInstance(); this.props.navigation.push("FullScreenVideoCollection", { fetchServices : clonedInstance, + tagId: this.props.tagId, currentIndex: index, payload, baseUrl: this.props.getFetchUrl(), diff --git a/src/components/VideoTags/index.js b/src/components/VideoTags/index.js index 042149e8..a30d7010 100644 --- a/src/components/VideoTags/index.js +++ b/src/components/VideoTags/index.js @@ -118,6 +118,7 @@ class VideoTags extends PureComponent { navigation={this.props.navigation} noResultsData={this.noResultsData} getNoResultsCell={this.renderNoResults} + tagId={this.getTagId()} extraParams={this.getExtraParams()} /> } else { diff --git a/src/components/VideoWrapper/Base.js b/src/components/VideoWrapper/Base.js index e7723069..ad79a296 100644 --- a/src/components/VideoWrapper/Base.js +++ b/src/components/VideoWrapper/Base.js @@ -9,6 +9,7 @@ import {VideoPlayPauseEmitter} from '../../helpers/Emitters'; import AppConfig from '../../constants/AppConfig'; import socketPixelCall from './../../services/SocketPixelCall' import CurrentUser from "../../models/CurrentUser"; +import assignIn from 'lodash/assignIn'; const VIDEO_PLAY_START_EVENT_NAME = "video_play_start"; @@ -158,19 +159,11 @@ class Base extends PureComponent { fireEvent(params) { if (this.videoContext.isEventCalledOnView(CurrentUser.getUserId(), this.props.video_id)) return; if (params.currentTime >= this.minTimeConsideredForView) { - let pixelParams = { - e_entity: 'video', - e_action: 'view', - e_data_json: { - video_id: this.props.videoId, - profile_user_id: this.props.userId - }, - p_type: this.props.navigation.state.routeName === 'HomeScreen' ? 'feed' : 'user_profile' - }; + const parentData = this.props.getPixelDropData() ; + let pixelParams = { e_action: 'view' }; + pixelParams = assignIn({}, pixelParams, parentData); PixelCall(pixelParams); - this.sendFeedVideoEvent(VIDEO_PLAY_START_EVENT_NAME); - this.videoContext.eventFired(CurrentUser.getUserId(), this.props.video_id); } } @@ -190,15 +183,9 @@ class Base extends PureComponent { onEnd = (params) => { if (this.isPixelCalledOnEnd) return; - let pixelParams = { - e_entity: 'video', - e_action: 'full_viewed', - e_data_json: { - video_id: this.props.videoId, - profile_user_id: this.props.userId - }, - p_type: this.props.navigation.state.routeName === 'HomeScreen' ? 'feed' : 'user_profile' - }; + const parentData = this.props.getPixelDropData() ; + let pixelParams = { e_action: 'full_viewed', }; + pixelParams = assignIn({}, pixelParams, parentData); PixelCall(pixelParams); this.isPixelCalledOnEnd = true; @@ -245,6 +232,10 @@ Base.defaultProps = { shouldPlay: function(){ return true; }, + getPixelDropData: function(){ + console.warn("getPixelDropData props is mandatory for Video component"); + return {}; + }, doRender: true , isActive: true }; diff --git a/src/services/CameraWorker.js b/src/services/CameraWorker.js index ab605d54..b2f6ff4e 100644 --- a/src/services/CameraWorker.js +++ b/src/services/CameraWorker.js @@ -181,7 +181,7 @@ class CameraWorker extends PureComponent { videoUploadedSuccessCallback = ( ostWorkflowContext, ostWorkflowEntity ) => { //todo @ashutosh - let replyDetailId = deepGet(this.props.recorded_video , 'reply_obj.replyDetailId') + let replyDetailId = deepGet(this.props.recorded_video , 'reply_obj.replyDetailId'); console.log('CameraWorker.videoUploadedSuccessCallback'); Toast.show({ text: 'Your video uploaded successfully.', diff --git a/src/services/PixelCall.js b/src/services/PixelCall.js index cb609e64..bbcdb1c1 100644 --- a/src/services/PixelCall.js +++ b/src/services/PixelCall.js @@ -29,7 +29,6 @@ const keyAliasMap = { device_width: 'dw', device_height: 'dh', user_agent: 'ua', - mobile_app_version: 'mav', e_data_json: 'ed' }; @@ -51,6 +50,8 @@ const staticData = { mobile_app_version: DeviceInfo.getVersion() }; +const mandatoryKeys = ['e_entity', 'e_action', 'p_type', 'p_name']; + const makeCompactData = params => { let compactData = {}; for(var key in params){ @@ -65,14 +66,19 @@ const makeCompactData = params => { export default (data) => { // Extend outer data with staticData - let pixelData = assignIn({}, staticData, data), - currentUserId = CurrentUser.getUserId(); + let pixelData = assignIn({}, staticData, data); // Add user context (if any) else bail out - if(currentUserId){ - pixelData.u_id = currentUserId; - } else { - return; + let currentUserId = CurrentUser.getUserId(); + if(!currentUserId) return; + pixelData.u_id = currentUserId; + + // Validate and bail out on fail + for(var mi = 0; mi < mandatoryKeys.length; mi++){ + if(!pixelData[mandatoryKeys[mi]]){ + console.log(`PixelCall validation failed for ${mandatoryKeys[mi]}`); + return; + } } // Compact data From fe05b1dd2368c531bcc1a68f0db967daa7d90ada Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Thu, 21 Nov 2019 20:23:03 +0530 Subject: [PATCH 118/302] Pixel drop complete --- src/components/FullScreenVideoCollection/FullScreenVideoRow.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/FullScreenVideoCollection/FullScreenVideoRow.js b/src/components/FullScreenVideoCollection/FullScreenVideoRow.js index ec233ff1..a177af13 100644 --- a/src/components/FullScreenVideoCollection/FullScreenVideoRow.js +++ b/src/components/FullScreenVideoCollection/FullScreenVideoRow.js @@ -62,7 +62,6 @@ class FullScreeVideoRow extends PureComponent { userId={this.userId} entityId={this.videoId} getPixelDropData={this.getPixelDropData} - getPixelDropData={() => {p_type: 'tag'}} // @todo to confirm this /> From c4afc4d9170ce34dfe6ea916bcf58f0ba90836f0 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Thu, 21 Nov 2019 20:58:35 +0530 Subject: [PATCH 119/302] Minor fix --- src/helpers/cameraHelper.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/cameraHelper.js b/src/helpers/cameraHelper.js index 18a068e2..a773ea50 100644 --- a/src/helpers/cameraHelper.js +++ b/src/helpers/cameraHelper.js @@ -2,10 +2,10 @@ import AppConfig from '../constants/AppConfig' import NavigationService from "../services/NavigationService"; import Utilities from "../services/Utilities"; import CurrentUser from "../models/CurrentUser"; -import { Toast } from "native-base"; import { ostErrors } from "../services/OstErrors"; import Pricer from "../services/Pricer"; import ReduxGetters from "../services/ReduxGetters"; +import Toast from '../theme/components/NotificationToast'; const getVideoReplyObject = (videoId, creatorUserId) => { return { From 39dfa7e69287a9882fb8481b7f3f839145a24c20 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Thu, 21 Nov 2019 21:07:24 +0530 Subject: [PATCH 120/302] ui fix after merge --- .../VideoReplyRow.js | 22 ++++++++++--------- .../UserVideoHistory/UserVideoHistoryRow.js | 6 +++-- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index 334b6cee..d9d15a85 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -123,21 +123,23 @@ class VideoReplyRow extends PureComponent { /> - - - - - - + {this.reportViewRef = ref }} onLayout={()=>{}} > + + + + + + + - + )} diff --git a/src/components/UserVideoHistory/UserVideoHistoryRow.js b/src/components/UserVideoHistory/UserVideoHistoryRow.js index 0ceb0679..711e0ef9 100644 --- a/src/components/UserVideoHistory/UserVideoHistoryRow.js +++ b/src/components/UserVideoHistory/UserVideoHistoryRow.js @@ -123,8 +123,10 @@ class UserVideoHistoryRow extends PureComponent { getPixelDropData={this.getPixelDropData} /> - - + + {this.reportViewRef = ref }} onLayout={()=>{}} > + + Date: Thu, 21 Nov 2019 23:18:10 +0530 Subject: [PATCH 121/302] code complete --- .../InvertedReplyThumbnailList/index.js | 35 ++++++---- .../VideoReplyRow.js | 68 +++++-------------- .../FullScreenVideoRow.js | 20 +++++- .../FullScreenVideoCollection/index.js | 12 +++- src/components/Home/HomeFeedRow.js | 65 ++++-------------- .../UserVideoHistory/UserVideoHistoryRow.js | 66 +++++------------- src/constants/AppConfig.js | 4 +- 7 files changed, 99 insertions(+), 171 deletions(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index 9ff8500c..79a934e9 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -5,6 +5,7 @@ import Pagination from "../../../services/Pagination"; import ReplyThumbnailItem from './ReplyThumbnailItem' import {FlatList} from 'react-native-gesture-handler'; import ReplyHelper from '../../../helpers/ReplyHelper'; +import AppConfig from "../../../constants/AppConfig"; const ITEM_HEIGHT = 55; @@ -190,23 +191,26 @@ class InvertedReplyList extends Component { getItemSeperatorComponent = () => { return - } + }; - getListHeight = () => { + getAvailableHeight = () => { + const area = AppConfig.MaxDescriptionArea; + let height = ( area / Dimensions.get('window').width ) + 20, + availableHeight = Dimensions.get('window').height - height - 50; + return availableHeight; + } - let noOfItems = this.state.list.length ; - if (this.props.availableHeight > 0 && noOfItems > 0){ + getListHeight = () => { + let availableHeight = this.getAvailableHeight(); + let noOfItems = this.state.list.length; + if (noOfItems > 0){ let heightOfElements = noOfItems * 30, heightOfSeparator = (noOfItems - 1 ) * 25, - availableScreenHeight = this.props.availableHeight - 50, heightOfFlatList = heightOfElements + heightOfSeparator; - if (availableScreenHeight < heightOfFlatList ){ - return availableScreenHeight; - } - return heightOfFlatList; + return availableHeight > heightOfFlatList ? heightOfFlatList : availableHeight; } - return 0; + return availableHeight; }; getItemLayout= (data, index) => { @@ -214,12 +218,12 @@ class InvertedReplyList extends Component { } render() { - let height = this.getListHeight(); - return height > 0 ? - : + /> } } InvertedReplyList.defaultProps = { - paginationService : null + paginationService : null, + doRender: true }; //make this component available to the app diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index d9d15a85..37ecaf61 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -1,5 +1,5 @@ import React, { PureComponent } from 'react'; -import { View } from 'react-native'; +import { View , Dimensions} from 'react-native'; import { withNavigation } from 'react-navigation'; import FanVideo from "../VideoWrapper/FanVideo"; import ShareIcon from "../CommonComponents/ShareIcon"; @@ -20,50 +20,19 @@ import CommonStyle from "../../theme/styles/Common"; import assignIn from 'lodash/assignIn'; import InvertedReplyList from "../CommonComponents/InvertedReplyThumbnailList"; +import AppConfig from "../../constants/AppConfig"; + + +const AREA = AppConfig.MaxDescriptionArea; +const height = AREA / Dimensions.get('window').width + 20; + class VideoReplyRow extends PureComponent { constructor(props) { super(props); this.parentVideoId = ReduxGetters.getReplyParentVideoId( this.props.replyDetailId ); this.parentUserId = ReduxGetters.getReplyParentUserId( this.props.replyDetailId ); - this.state = { - yCoordinateOfReportButton : 0 - }; - } - - - componentDidMount() { - setTimeout(()=>{ - this.measureWindow(); - }, 10); - }; - - - componentDidUpdate(prevProps) { - - if (prevProps.isActive !== this.props.isActive){ - this.measureWindow(); } - }; - - measureWindow = () => { - if (this.props.isActive === true){ - console.log('measureWindow:::isActive true', this.videoId); - this.reportViewRef.measureInWindow(this.calculateYCoordinateOfReportButton); - } - }; - - - calculateYCoordinateOfReportButton = (ox, oy, width, height) => { - this.setState({yCoordinateOfReportButton: oy}); - console.log('============== measurePosition ==============' ); - console.log('ox',ox); - console.log('oy',oy); - console.log('width',width); - console.log('height',height); - console.log('============== measurePosition ==============' ); - }; - refetchVideoReply = () => { new PepoApi(`/replies/${this.props.replyDetailId}`) @@ -89,6 +58,17 @@ class VideoReplyRow extends PureComponent { + + + + + - - - - @@ -133,7 +102,6 @@ class VideoReplyRow extends PureComponent { userId={userId} /> - + + + + + + { - return `id_${item}`; + let keyStr = `id_${item.id}`; + console.log("keyStr", keyStr); + return keyStr; }; _renderItem = ({ item, index }) => { @@ -164,8 +166,11 @@ class FullScreenVideoCollection extends PureComponent{ _renderVideoReplyRow(item, index){ let userId = deepGet(item,'payload.user_id'), - replyDetailId = deepGet(item,`payload.${DataContract.replies.replyDetailIdKey}`); + replyDetailId = deepGet(item,`payload.${DataContract.replies.replyDetailIdKey}`), + rowKey = this._keyExtractor(item, index) + ; return {this.props.navigation.getParam("showBalanceFlyer") && } { - this.measureWindow(); - }, 10); - }; - - - componentDidUpdate(prevProps) { - - if (prevProps.isActive !== this.props.isActive){ - this.measureWindow(); - } - - }; - - measureWindow = () => { - if (this.props.isActive === true){ - console.log('measureWindow:::isActive true', this.videoId); - this.reportViewRef.measureInWindow(this.calculateYCoordinateOfReportButton); - } - }; - - - calculateYCoordinateOfReportButton = (ox, oy, width, height) => { - this.setState({yCoordinateOfReportButton: oy}); - console.log('============== measurePosition ==============' ); - console.log('ox',ox); - console.log('oy',oy); - console.log('width',width); - console.log('height',height); - console.log('============== measurePosition ==============' ); - }; - render() { return ( - + + + + + - - - - - - - - - @@ -138,7 +101,7 @@ class HomeFeedRow extends PureComponent { pageName="feed" /> - + diff --git a/src/components/UserVideoHistory/UserVideoHistoryRow.js b/src/components/UserVideoHistory/UserVideoHistoryRow.js index 711e0ef9..de9e7889 100644 --- a/src/components/UserVideoHistory/UserVideoHistoryRow.js +++ b/src/components/UserVideoHistory/UserVideoHistoryRow.js @@ -1,5 +1,5 @@ import React, { PureComponent } from 'react'; -import { View } from 'react-native'; +import { View, Dimensions } from 'react-native'; import { withNavigation } from 'react-navigation'; import FanVideo from '../VideoWrapper/FanVideo'; import ShareIcon from "../CommonComponents/ShareIcon"; @@ -18,6 +18,11 @@ import BottomReplyBar from '../CommonComponents/BottomReplyBar'; import CommonStyle from "../../theme/styles/Common"; import assignIn from 'lodash/assignIn'; import InvertedReplyList from "../CommonComponents/InvertedReplyThumbnailList"; +import AppConfig from "../../constants/AppConfig"; + + +const AREA = AppConfig.MaxDescriptionArea; +const height = AREA / Dimensions.get('window').width + 20; class UserVideoHistoryRow extends PureComponent { constructor(props) { @@ -25,9 +30,6 @@ class UserVideoHistoryRow extends PureComponent { this.isUserNavigate = false; this.pageType = "user_profile"; this.pageInit(); - this.state = { - yCoordinateOfReportButton : 0 - }; } pageInit = () => { @@ -46,40 +48,6 @@ class UserVideoHistoryRow extends PureComponent { return assignIn({}, pixelParams, parentData); } - componentDidMount() { - setTimeout(()=>{ - this.measureWindow(); - }, 10); - }; - - - componentDidUpdate(prevProps) { - - if (prevProps.isActive !== this.props.isActive){ - this.measureWindow(); - } - - }; - - measureWindow = () => { - if (this.props.isActive === true){ - console.log('measureWindow:::isActive true', this.videoId); - this.reportViewRef.measureInWindow(this.calculateYCoordinateOfReportButton); - } - }; - - - calculateYCoordinateOfReportButton = (ox, oy, width, height) => { - this.setState({yCoordinateOfReportButton: oy}); - console.log('============== measurePosition ==============' ); - console.log('ox',ox); - console.log('oy',oy); - console.log('width',width); - console.log('height',height); - console.log('============== measurePosition ==============' ); - }; - - refetchVideo = () => { new PepoApi(`/videos/${this.props.videoId}`) @@ -93,6 +61,14 @@ class UserVideoHistoryRow extends PureComponent { + + + + + - - - - - @@ -124,9 +92,7 @@ class UserVideoHistoryRow extends PureComponent { /> - {this.reportViewRef = ref }} onLayout={()=>{}} > - - + - + Date: Fri, 22 Nov 2019 12:58:24 +0530 Subject: [PATCH 122/302] Minor fix --- src/components/AddEmail/index.js | 2 +- src/components/CustomDrawerContent/index.js | 1 - src/components/PepoTransactionButton/Base.js | 2 +- src/components/SayThanks/index.js | 4 +--- src/components/Transaction/TransactionScreen.js | 1 - src/components/VideoReplies/index.js | 11 +++-------- src/components/VideoWrapper/ReplyVideo.js | 16 ---------------- src/store/index.js | 4 ++-- 8 files changed, 8 insertions(+), 33 deletions(-) delete mode 100644 src/components/VideoWrapper/ReplyVideo.js diff --git a/src/components/AddEmail/index.js b/src/components/AddEmail/index.js index 66eaa5d6..5e60e9f7 100644 --- a/src/components/AddEmail/index.js +++ b/src/components/AddEmail/index.js @@ -114,7 +114,7 @@ class AddEmailScreen extends React.Component { }; onSuccess(res) { - //TODO show success screen + this.setState({ emailSent: true }); diff --git a/src/components/CustomDrawerContent/index.js b/src/components/CustomDrawerContent/index.js index 82cab457..f1ba3109 100644 --- a/src/components/CustomDrawerContent/index.js +++ b/src/components/CustomDrawerContent/index.js @@ -147,7 +147,6 @@ class CustomDrawerContent extends Component { }; initWallet = () => { - //TODO: Navigation should push instead of navigate this.props.navigation.navigate('WalletSettingScreen'); }; diff --git a/src/components/PepoTransactionButton/Base.js b/src/components/PepoTransactionButton/Base.js index 5127d2ca..8df4cff6 100644 --- a/src/components/PepoTransactionButton/Base.js +++ b/src/components/PepoTransactionButton/Base.js @@ -122,7 +122,7 @@ class Base extends PureComponent { } dropPixel() { - //TODO @Ashutosh , confrim from @Akshay + PixelCall(this.getDropPixel()); } diff --git a/src/components/SayThanks/index.js b/src/components/SayThanks/index.js index 1906e718..4bcf31ec 100644 --- a/src/components/SayThanks/index.js +++ b/src/components/SayThanks/index.js @@ -5,8 +5,7 @@ import { Keyboard, BackHandler, ActivityIndicator, - TouchableWithoutFeedback, - Switch + TouchableWithoutFeedback } from 'react-native'; import { connect } from 'react-redux'; import { getBottomSpace, isIphoneX } from 'react-native-iphone-x-helper'; @@ -157,7 +156,6 @@ class SayThanks extends Component { thanksMessage: this.tweeterHandle ? `@${this.tweeterHandle} ${this.state.thanksMessage}`: this.state.thanksMessage }); } else { - //TODO: show error if (resp.err.msg) { Toast.show({ text: resp.err.msg, icon: 'error' }); } diff --git a/src/components/Transaction/TransactionScreen.js b/src/components/Transaction/TransactionScreen.js index e83cfe47..fa327153 100644 --- a/src/components/Transaction/TransactionScreen.js +++ b/src/components/Transaction/TransactionScreen.js @@ -334,7 +334,6 @@ class TransactionScreen extends Component { ); } - //TODO , NOT SURE if bug comes this also will have to connected via redux. onBalance(balance, res) { balance = pricer.getFromDecimal(balance); balance = Number(PriceOracle.toBt(balance)) || 0; diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index c7e5b7a2..909e1e0e 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -41,7 +41,8 @@ class VideoRepliesScreen extends PureComponent { static navigationOptions = ({ navigation, navigationOptions }) => { return { header: null, - headerBackTitle: null + headerBackTitle: null, + gesturesEnabled: false }; }; @@ -171,7 +172,7 @@ class VideoRepliesScreen extends PureComponent { }} ref={c => (this._panel = c)} draggableRange={{ - top: height - topPadding, //TODO check is top expand + top: height - topPadding, bottom: 0 }} showBackdrop={this.state.showBackdrop} @@ -188,16 +189,10 @@ class VideoRepliesScreen extends PureComponent { Replies to {ReduxGetters.getUserName(this.userId)} - {/* {TODO integration pending} */} Send a reply with{' '} { Pricer.getToBT(Pricer.getFromDecimal(this.amount), 2)} - - {/**/} - {/**/} - {/**/} - { - //TODO - return { - videoImgUrl: reduxGetter.getVideoImgUrl(ownProps.videoId, state), - videoUrl: reduxGetter.getVideoUrl(ownProps.videoId, state), - loginPopover: ownProps.isActive && state.login_popover.show - }; -}; - -const ReplyVideo = connect(mapStateToProps)(Base); -export default ReplyVideo; \ No newline at end of file diff --git a/src/store/index.js b/src/store/index.js index eb3ee768..c33e22a4 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -2,7 +2,7 @@ import { createStore, applyMiddleware } from 'redux'; import logger from 'redux-logger'; import { reducer } from '../reducers'; -export const store = __DEV__ === true ? createStore(reducer, applyMiddleware(logger)) : createStore(reducer); -// export const store = createStore(reducer); +//export const store = __DEV__ === true ? createStore(reducer, applyMiddleware(logger)) : createStore(reducer); + export const store = createStore(reducer); export default store; From a0d7858d3492ba2f299be6dc0cf6099f79ec28c7 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Fri, 22 Nov 2019 13:19:40 +0530 Subject: [PATCH 123/302] Minor fix --- RootNavigationContainer.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/RootNavigationContainer.js b/RootNavigationContainer.js index 540cf674..4aaedf47 100644 --- a/RootNavigationContainer.js +++ b/RootNavigationContainer.js @@ -104,11 +104,6 @@ const txModalConfig = { && nextScene.route.routeName === 'FullScreenReplyCollection') { return NavigationAnimation.zoomIn(); } - else if (prevScene - && prevScene.route.routeName === 'FullScreenReplyCollection' - && nextScene.route.routeName === 'VideoReplies') { - return NavigationAnimation.zoomOut(); - } return NavigationAnimation.defaultTransition(); } }; From 9071c75707feb1a9b6973f13b9621bbad22fd8de Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Fri, 22 Nov 2019 13:34:01 +0530 Subject: [PATCH 124/302] Slide up pannel flicker --- src/components/VideoReplies/index.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index 909e1e0e..6749bf10 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -62,6 +62,7 @@ class VideoRepliesScreen extends PureComponent { this.state = { showBackdrop : false, + addRepliesVisible : true, videoUploaderVisible: false, currentHeight : this.initialHeight } @@ -95,7 +96,7 @@ class VideoRepliesScreen extends PureComponent { hideVideoUploader = () => { this.setState({ - videoUploaderVisible: false + videoUploaderVisible: false }); }; @@ -103,6 +104,7 @@ class VideoRepliesScreen extends PureComponent { clearTimeout(this.panelAnimateTimeOut); this.panelAnimateTimeOut = setTimeout(()=> { if( value < 10){ + this.state.addRepliesVisible = false; this.hideVideoUploader(); this.props.navigation.goBack(); } @@ -206,15 +208,16 @@ class VideoRepliesScreen extends PureComponent { )} - - - - - Add a reply... - - - - + {this.state.addRepliesVisible && ( + + + + + Add a reply... + + + + )} ); } From e5c32413f44cc5b753b1f4f6af5b4ab96978a14b Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Fri, 22 Nov 2019 13:40:10 +0530 Subject: [PATCH 125/302] code changes for seen and active state of reply --- .../ReplyThumbnailItem.js | 54 ++++++++++++++++++- .../InvertedReplyThumbnailList/index.js | 16 ++++-- .../FullScreenReplyCollection/index.js | 4 +- src/helpers/ReplyHelper.js | 15 +++++- src/services/ReduxGetters.js | 5 ++ 5 files changed, 84 insertions(+), 10 deletions(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js index 8dd08f6d..60b05311 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js @@ -1,7 +1,18 @@ import React, { Component } from 'react'; +import { View } from 'react-native'; +import { connect } from 'react-redux'; +import deepGet from 'lodash/get'; + import ProfilePicture from "../../ProfilePicture"; import reduxGetters from '../../../services/ReduxGetters'; import { TouchableOpacity } from 'react-native-gesture-handler'; +import ReduxGetters from '../../../services/ReduxGetters'; + +const mapStateToProps = (state, ownProps) => { + return { + seen: ReduxGetters.getReplyEntitySeen( deepGet(ownProps.payload,'reply_detail_id')) + }; +}; class ReplyThumbnailItem extends Component { @@ -14,10 +25,49 @@ class ReplyThumbnailItem extends Component { render() { return - + + + } } +const inlineStyle= { + iconStyle: { + width: 50, + height: 50, + borderRadius: 25 + }, + borderStyle: { + borderWidth: 2, + borderColor: '#fff' + }, + shadowWrapperStyle: { + width: 60, + height: 60, + borderRadius: 30 + }, + active: { + shadowColor: '#fff', + shadowOffset: { + width: -5, + height: 3 + }, + shadowOpacity: 1, + shadowRadius: 15, + borderRadius: 30 + }, + unseen: { + shadowColor: 'red', + shadowOffset: { + width: -5, + height: 3 + }, + shadowOpacity: 1, + shadowRadius: 15, + borderRadius: 30 + } +} + //make this component available to the app -export default ReplyThumbnailItem; +export default connect(mapStateToProps)(ReplyThumbnailItem); diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index 79a934e9..458a08b3 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import { Text, View, ScrollView, ListView, Dimensions} from 'react-native'; import { withNavigation } from 'react-navigation'; + import Pagination from "../../../services/Pagination"; import ReplyThumbnailItem from './ReplyThumbnailItem' import {FlatList} from 'react-native-gesture-handler'; @@ -44,15 +45,15 @@ class InvertedReplyList extends Component { this.setClickHandlers(); } - defaultChildClickHandler = ( index )=> { + defaultChildClickHandler = ( index, item )=> { const parentVideoId = this.props.videoId, parentUserId = this.props.userId, clonedInstance = this.getPagination().fetchServices.cloneInstance(), navigation = this.props.navigation; + ReplyHelper.updateEntitySeen( item );     ReplyHelper.openRepliesList(parentUserId, parentVideoId, clonedInstance, index, navigation);   }; - setPagination() { let fetchUrl = this.getFetchUrl(); this.paginationService = this.props.paginationService; @@ -181,10 +182,14 @@ class InvertedReplyList extends Component { _renderItem = ({item, index}) => { - return {this.onItemClick(index)}} />; - + return {this.onItemClick(index, item)}} isActive={()=>{return this.isActive( index )} }/> + }; + isActive = ( index )=>{ + return this.props.currentIndex == index; + } + setListRef = (ref) => { this.listRef = ref; }; @@ -243,7 +248,8 @@ class InvertedReplyList extends Component { InvertedReplyList.defaultProps = { paginationService : null, - doRender: true + doRender: true, + currentIndex: 0 }; //make this component available to the app diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index 05ec776f..6f3293bb 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -9,6 +9,7 @@ import entityHelper from "../../helpers/EntityHelper"; import DataContract from "../../constants/DataContract"; import CommonStyle from "../../theme/styles/Common"; import { SafeAreaView } from "react-navigation"; +import ReplyHelper from "../../helpers/ReplyHelper"; const maxVideosThreshold = 3; @@ -165,7 +166,8 @@ class FullScreenReplyCollection extends PureComponent{ /> ; } - childClickHandler = ( index )=> { + childClickHandler = ( index, item )=> { + ReplyHelper.updateEntitySeen( item ); this.scrollToIndex( index ); } diff --git a/src/helpers/ReplyHelper.js b/src/helpers/ReplyHelper.js index 46efd4ff..3f928602 100644 --- a/src/helpers/ReplyHelper.js +++ b/src/helpers/ReplyHelper.js @@ -1,6 +1,10 @@ -import { FetchServices } from "../services/FetchServices"; +import deepGet from 'lodash/get'; + +import store from '../store'; import DataContract from "../constants/DataContract"; import ReduxGetters from "../services/ReduxGetters"; +import { upsertReplyDetailEntities } from '../reducers'; +import Utilities from '../services/Utilities'; async function openRepliesList( parentUserId, parentVideoId, fetchServicesClonedInstance, currentIndex, navigation){     navigation.push('FullScreenReplyCollection',{ @@ -12,4 +16,11 @@ async function openRepliesList( parentUserId, parentVideoId, fetchServicesCloned     }); } -export default { openRepliesList } \ No newline at end of file +function updateEntitySeen (item) { + const replyDetailId = deepGet(item,'payload.reply_detail_id'); + let replyEntity = ReduxGetters.getReplyEntity( replyDetailId ); + replyEntity['seen'] = true; + store.dispatch(upsertReplyDetailEntities(Utilities._getEntityFromObj(replyEntity))); + } + +export default { openRepliesList, updateEntitySeen } \ No newline at end of file diff --git a/src/services/ReduxGetters.js b/src/services/ReduxGetters.js index 20259a9b..a3080a13 100644 --- a/src/services/ReduxGetters.js +++ b/src/services/ReduxGetters.js @@ -475,6 +475,11 @@ class ReduxGetters { return deepGet(state, `reply_detail_entities.id_${id}.entity_id`); } + getReplyEntitySeen(id, state){ + state = state || Store.getState(); + return deepGet(state, `reply_detail_entities.id_${id}.seen`, false); + } + getReplyDescriptionId(id, state) { state = state || Store.getState(); return deepGet(state, `reply_detail_entities.id_${id}.description_id`); From 32aabdf895ebdb00ba5282a9448e7f1542300a9c Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Fri, 22 Nov 2019 13:58:21 +0530 Subject: [PATCH 126/302] Minor fix --- RootNavigationContainer.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/RootNavigationContainer.js b/RootNavigationContainer.js index 4aaedf47..218edeba 100644 --- a/RootNavigationContainer.js +++ b/RootNavigationContainer.js @@ -1,5 +1,5 @@ import React from 'react'; -import { View, Dimensions, Easing, Animated , Platform} from 'react-native'; +import { View, Platform} from 'react-native'; import { Root } from 'native-base'; import { createSwitchNavigator, createAppContainer } from 'react-navigation'; import { createStackNavigator , StackViewTransitionConfigs} from 'react-navigation-stack'; @@ -99,10 +99,17 @@ const txModalConfig = { const scenes = transitionProps["scenes"]; const prevScene = scenes[scenes.length - 2]; const nextScene = scenes[scenes.length - 1]; - if (prevScene - && prevScene.route.routeName === 'VideoReplies' - && nextScene.route.routeName === 'FullScreenReplyCollection') { - return NavigationAnimation.zoomIn(); + if(Platform.OS == "ios"){ + if (prevScene + && prevScene.route.routeName === 'VideoReplies' + && nextScene.route.routeName === 'FullScreenReplyCollection') { + return NavigationAnimation.zoomIn(); + } + else if (prevScene + && prevScene.route.routeName === 'FullScreenReplyCollection' + && nextScene.route.routeName === 'VideoReplies') { + return NavigationAnimation.zoomOut(); + } } return NavigationAnimation.defaultTransition(); } From c01114f50401c3bd27c72a29f7227bf47f67dc07 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Fri, 22 Nov 2019 15:48:07 +0530 Subject: [PATCH 127/302] Bug fixes --- .../CommonComponents/VideoPlayer/index.js | 7 +--- .../VideoReplyPlayer/index.js | 9 +++- .../CommonComponents/VideoThumbnail/Base.js | 2 +- .../VideoReplyRow.js | 42 ++++++++++--------- src/helpers/helpers.js | 16 ++++++- src/services/CameraWorker.js | 9 +++- src/services/ReduxGetters.js | 2 +- 7 files changed, 57 insertions(+), 30 deletions(-) diff --git a/src/components/CommonComponents/VideoPlayer/index.js b/src/components/CommonComponents/VideoPlayer/index.js index b07eb911..a55005de 100644 --- a/src/components/CommonComponents/VideoPlayer/index.js +++ b/src/components/CommonComponents/VideoPlayer/index.js @@ -9,7 +9,7 @@ import DeletedVideoInfo from '../DeletedVideoInfo'; import CommonStyles from "../../../theme/styles/Common"; import FlotingBackArrow from "../../CommonComponents/FlotingBackArrow"; import { SafeAreaView } from "react-navigation"; -import Colors from "../../../theme/styles/Colors"; +import { fetchVideo } from '../../../helpers/helpers'; class VideoPlayer extends Component { @@ -53,10 +53,7 @@ class VideoPlayer extends Component { refetchVideo = () => { if (this.state.isDeleted) return; - new PepoApi(`/videos/${this.videoId}`) - .get() - .then((res) => { this.onRefetchVideo(res) }) - .catch((error) => {}); + fetchVideo( this.videoId , this.onRefetchVideo ); }; onRefetchVideo = ( res ) => { diff --git a/src/components/CommonComponents/VideoReplyPlayer/index.js b/src/components/CommonComponents/VideoReplyPlayer/index.js index fbd8897a..5f18a16f 100644 --- a/src/components/CommonComponents/VideoReplyPlayer/index.js +++ b/src/components/CommonComponents/VideoReplyPlayer/index.js @@ -11,6 +11,7 @@ import VideoReplyRow from '../../FullScreenReplyCollection/VideoReplyRow'; import FlotingBackArrow from "../../CommonComponents/FlotingBackArrow"; import CommonStyles from "../../../theme/styles/Common"; import { SafeAreaView } from "react-navigation"; +import { fetchVideo } from '../../../helpers/helpers'; class VideoReplyPlayer extends PureComponent { @@ -58,7 +59,7 @@ class VideoReplyPlayer extends PureComponent { new PepoApi(DataContract.replies.getSingleVideoReplyApi(this.replyDetailId)) .get() .then((res) => { this.onRefetchVideo(res) }) - .catch((error) => {}); + .catch((error) => {}); }; onRefetchVideo = ( res ) => { @@ -66,6 +67,7 @@ class VideoReplyPlayer extends PureComponent { this.setState({isDeleted: true}); return; } + this.fetchParentVideo( res ); const users = deepGet(res , "data.users") || {} , userKeys = Object.keys(users) || [] , userId = userKeys[0] || null; @@ -74,6 +76,11 @@ class VideoReplyPlayer extends PureComponent { } }; + fetchParentVideo = (res) => { + const parentVideoId = deepGet(res, `data.reply_details.${this.replyDetailId}.parent_id` ); + fetchVideo(parentVideoId); + } + getPixelDropData = () => { return pixelParams = { e_entity: 'reply', diff --git a/src/components/CommonComponents/VideoThumbnail/Base.js b/src/components/CommonComponents/VideoThumbnail/Base.js index 57aa116b..0395d6ec 100644 --- a/src/components/CommonComponents/VideoThumbnail/Base.js +++ b/src/components/CommonComponents/VideoThumbnail/Base.js @@ -45,7 +45,7 @@ class Base extends PureComponent { - {this.props.btAmount} + {this.props.btAmount || 0} diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index 2f33bb91..563a4d6e 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -18,12 +18,18 @@ import DataContract from '../../constants/DataContract'; import ReduxGetters from '../../services/ReduxGetters'; import CommonStyle from "../../theme/styles/Common"; import assignIn from 'lodash/assignIn'; +import { connect } from 'react-redux'; + +const mapStateToProps = (state, ownProps) => { + return { + parentVideoId : ReduxGetters.getReplyParentVideoId( ownProps.replyDetailId ,state ), + parentUserId : ReduxGetters.getReplyParentUserId(ownProps.replyDetailId , state ) + }; + }; class VideoReplyRow extends PureComponent { constructor(props) { super(props); - this.parentVideoId = ReduxGetters.getReplyParentVideoId( this.props.replyDetailId ); - this.parentUserId = ReduxGetters.getReplyParentUserId( this.props.replyDetailId ); } refetchVideoReply = () => { @@ -35,59 +41,57 @@ class VideoReplyRow extends PureComponent { getPixelDropData = () => { const parentData = this.props.getPixelDropData(); - const pixelParams = { e_entity: 'reply' , parent_video_id : this.parentVideoId , reply_detail_id :this.props.replyDetailId }; + const pixelParams = { e_entity: 'reply' , parent_video_id : this.props.parentVideoId , reply_detail_id :this.props.replyDetailId }; return assignIn({}, pixelParams, parentData); } render() { - let userId = this.props.userId, - replyDetailId = this.props.replyDetailId, - videoId = ReduxGetters.getReplyEntityId(replyDetailId); + const videoId = ReduxGetters.getReplyEntityId(this.props.replyDetailId); return ( - {!!videoId && !!userId && ( + {!!videoId && !!this.props.userId && ( - - - + + + )} - + ); } @@ -100,4 +104,4 @@ VideoReplyRow.defaultProps = { } }; -export default withNavigation(VideoReplyRow); +export default connect(mapStateToProps)(withNavigation(VideoReplyRow)); diff --git a/src/helpers/helpers.js b/src/helpers/helpers.js index e0e6d203..f915a2f2 100644 --- a/src/helpers/helpers.js +++ b/src/helpers/helpers.js @@ -33,6 +33,20 @@ function fetchUser(userId, onResponse, errorCallback, finallyCallback) { }); } +function fetchVideo( videoId , onResponse, onError, onComplete ){ + new PepoApi(`/videos/${videoId}`) + .get() + .then((res) => { + onResponse && onResponse(res); + }) + .catch((error) => { + onError && onError(error); + }) + .finally(() => { + onComplete && onComplete(); + }); +} + function getSocialIcon(url, screen) { let hostName = url && url.match(/^(?:https?:\/\/)?(?:[^@\/\n]+@)?([^:\/?\n]+)/im); if ( !hostName || hostName.length < 2) { @@ -53,4 +67,4 @@ function getHostName( url ){ return url.match(/^(?:https?:\/\/)?(?:[^@\/\n]+@)?(?:www\.)?([^:\/?\n]+)/im)[1]; } -export { fetchUser, getHostName }; +export { fetchUser, getHostName , fetchVideo}; diff --git a/src/services/CameraWorker.js b/src/services/CameraWorker.js index b2f6ff4e..c75edfbb 100644 --- a/src/services/CameraWorker.js +++ b/src/services/CameraWorker.js @@ -27,6 +27,7 @@ import DataContract from "../constants/DataContract"; import {TransactionExecutor} from './TransactionExecutor'; import { ostSdkErrors } from '../services/OstSdkErrors'; import AppConfig from '../constants/AppConfig'; +import { fetchVideo } from '../helpers/helpers'; const recordedVideoStates = [ 'raw_video', 'compressed_video', @@ -180,8 +181,6 @@ class CameraWorker extends PureComponent { }; videoUploadedSuccessCallback = ( ostWorkflowContext, ostWorkflowEntity ) => { - //todo @ashutosh - let replyDetailId = deepGet(this.props.recorded_video , 'reply_obj.replyDetailId'); console.log('CameraWorker.videoUploadedSuccessCallback'); Toast.show({ text: 'Your video uploaded successfully.', @@ -195,6 +194,12 @@ class CameraWorker extends PureComponent { pepo_api_posting: false }) ); + this.fetchParentVideo(); + }; + + fetchParentVideo = () => { + const videoId = deepGet(this.props.recorded_video , 'reply_obj.replyReceiverVideoId'); + fetchVideo( videoId ); }; onFlowInterrupt = (ostWorkflowContext, error) => { diff --git a/src/services/ReduxGetters.js b/src/services/ReduxGetters.js index 20259a9b..08fc2309 100644 --- a/src/services/ReduxGetters.js +++ b/src/services/ReduxGetters.js @@ -130,7 +130,7 @@ class ReduxGetters { getVideoReplyCount(id, state){ state = state || Store.getState(); - return deepGet(state, `video_stat_entities.id_${id}.total_replies`, 0); + return deepGet(state, `video_stat_entities.id_${id}.total_video_replies`, 0); } getBtAmountForReply(id, state){ From a71d61a28affb40d39b6ca4121f1e1863d55c764 Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Fri, 22 Nov 2019 15:42:58 +0530 Subject: [PATCH 128/302] code changes --- .../ReplyThumbnailItem.js | 8 ++--- .../InvertedReplyThumbnailList/index.js | 21 +++++++----- .../VideoReplyRow.js | 8 +++++ .../FullScreenVideoCollection/styles.js | 5 --- src/constants/AppConfig.js | 32 ++++++++++++++++++- 5 files changed, 56 insertions(+), 18 deletions(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js index 60b05311..44bb0500 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js @@ -7,6 +7,7 @@ import ProfilePicture from "../../ProfilePicture"; import reduxGetters from '../../../services/ReduxGetters'; import { TouchableOpacity } from 'react-native-gesture-handler'; import ReduxGetters from '../../../services/ReduxGetters'; +import AppConfig from '../../../constants/AppConfig'; const mapStateToProps = (state, ownProps) => { return { @@ -33,10 +34,9 @@ class ReplyThumbnailItem extends Component { } const inlineStyle= { - iconStyle: { - width: 50, - height: 50, - borderRadius: 25 + iconStyle: { height: AppConfig.thumbnailListConstants.iconHeight, + width: AppConfig.thumbnailListConstants.iconWidth, + borderRadius: AppConfig.thumbnailListConstants.iconWidth/ 2 }, borderStyle: { borderWidth: 2, diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index 458a08b3..4dd3539e 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -8,7 +8,8 @@ import {FlatList} from 'react-native-gesture-handler'; import ReplyHelper from '../../../helpers/ReplyHelper'; import AppConfig from "../../../constants/AppConfig"; -const ITEM_HEIGHT = 55; +// +const ITEM_HEIGHT = AppConfig.thumbnailListConstants.iconHeight + AppConfig.thumbnailListConstants.iconWidth; class InvertedReplyList extends Component { @@ -182,8 +183,10 @@ class InvertedReplyList extends Component { _renderItem = ({item, index}) => { - return {this.onItemClick(index, item)}} isActive={()=>{return this.isActive( index )} }/> - + return + {this.onItemClick(index, item)}} /> + ; + }; isActive = ( index )=>{ @@ -195,14 +198,15 @@ class InvertedReplyList extends Component { }; getItemSeperatorComponent = () => { - return + return }; getAvailableHeight = () => { const area = AppConfig.MaxDescriptionArea; let height = ( area / Dimensions.get('window').width ) + 20, - availableHeight = Dimensions.get('window').height - height - 50; - return availableHeight; + //70 is height of top section + availableHeight = AppConfig.VideoScreenObject.height - height - 70 ; + return this.props.parentIconHeight ? availableHeight - this.props.parentIconHeight : availableHeight; } @@ -210,8 +214,8 @@ class InvertedReplyList extends Component { let availableHeight = this.getAvailableHeight(); let noOfItems = this.state.list.length; if (noOfItems > 0){ - let heightOfElements = noOfItems * 30, - heightOfSeparator = (noOfItems - 1 ) * 25, + let heightOfElements = noOfItems * AppConfig.thumbnailListConstants.iconHeight, + heightOfSeparator = (noOfItems - 1 ) * AppConfig.thumbnailListConstants.separatorHeight, heightOfFlatList = heightOfElements + heightOfSeparator; return availableHeight > heightOfFlatList ? heightOfFlatList : availableHeight; } @@ -239,6 +243,7 @@ class InvertedReplyList extends Component { numColumns={this.numColumns} key={this.flatListKey} nestedScrollEnabled={true} + showsVerticalScrollIndicator={false} initialScrollIndex={this.props.currentIndex} getItemLayout={this.getItemLayout} onScrollToIndexFailed={this.onScrollToIndexFailed} diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index 37ecaf61..7b7b4a8b 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -21,8 +21,10 @@ import assignIn from 'lodash/assignIn'; import InvertedReplyList from "../CommonComponents/InvertedReplyThumbnailList"; import AppConfig from "../../constants/AppConfig"; +import ProfilePicture from "../ProfilePicture"; +const marginTopForParentIcon = 15; const AREA = AppConfig.MaxDescriptionArea; const height = AREA / Dimensions.get('window').width + 20; @@ -66,6 +68,12 @@ class VideoReplyRow extends PureComponent { paginationService={this.props.paginationService} onChildClickDelegate={this.props.onChildClickDelegate} currentIndex={this.props.currentIndex} + parentIconHeight={AppConfig.thumbnailListConstants.parentIconHeight + marginTopForParentIcon } + /> + diff --git a/src/components/FullScreenVideoCollection/styles.js b/src/components/FullScreenVideoCollection/styles.js index ba4617a9..28f91a92 100644 --- a/src/components/FullScreenVideoCollection/styles.js +++ b/src/components/FullScreenVideoCollection/styles.js @@ -47,11 +47,6 @@ let stylesMap = { txElem: { marginBottom: 20 }, - bottomContainer: { - width: width, - position: 'absolute', - bottom: 0 - }, bottomBg: { backgroundColor: 'rgba(0, 0, 0, 0.6)', borderTopLeftRadius: 20, diff --git a/src/constants/AppConfig.js b/src/constants/AppConfig.js index 7ac4dd2a..0e7534e8 100644 --- a/src/constants/AppConfig.js +++ b/src/constants/AppConfig.js @@ -3,6 +3,16 @@ import balance_header_pepo_icon from '../assets/balance_header_pepo_icon.png'; import twitterDisconnectIcon from '../assets/drawer-twitter-icon.png'; import defaultLinkIcon from '../assets/default_link_icon.png'; import feedLinkIcon from '../assets/Link.png'; +import {getBottomSpace, ifIphoneX} from "react-native-iphone-x-helper"; +import {CUSTOM_TAB_Height} from "../theme/constants"; +import NotchHelper from "../helpers/NotchHelper"; +import {Dimensions, NativeModules, StatusBar} from "react-native"; + +const statusBarHeight = StatusBar.currentHeight; +const {height} = Dimensions.get('window'); +let RNDeviceInfo = NativeModules.RNDeviceInfo; +let modalDeviceName = RNDeviceInfo.model === "Redmi Note 7 Pro" && RNDeviceInfo.brand === "xiaomi"; +let btmSpace = modalDeviceName ? 5 : 0; const PROFILE_TX_SEND_SUCCESS = 'PROFILE_TX_SEND_SUCCESS', PROFILE_TX_RECEIVE_SUCCESS = 'PROFILE_TX_RECEIVE_SUCCESS', @@ -322,6 +332,26 @@ export default { reply: 'reply' }, - MaxDescriptionArea: 35250 + MaxDescriptionArea: 35250, + thumbnailListConstants: { + separatorHeight: 25, + iconHeight:35, + iconWidth: 35, + parentIconHeight: 50, + parentIconWidth: 50 + }, + VideoScreenObject : { + ...ifIphoneX( + { + height: height - CUSTOM_TAB_Height - getBottomSpace([true]) + }, + { + height: + NotchHelper.hasNotch() + ? height + statusBarHeight - CUSTOM_TAB_Height - btmSpace + : height - CUSTOM_TAB_Height + } + ) + } }; From a154cd41b607da579a0248ea59d297b71adc8079 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Fri, 22 Nov 2019 16:02:32 +0530 Subject: [PATCH 129/302] saving current user video relation in redux --- src/actions/constants.js | 2 ++ src/actions/index.js | 5 +++++ .../InvertedReplyThumbnailList/ReplyThumbnailItem.js | 11 ++++------- src/components/FullScreenReplyCollection/index.js | 2 ++ src/helpers/ReplyHelper.js | 12 +++++++----- src/reducers/index.js | 7 +++++++ src/services/ReduxGetters.js | 8 ++++++-- src/services/ReduxSetters.js | 1 + 8 files changed, 34 insertions(+), 14 deletions(-) diff --git a/src/actions/constants.js b/src/actions/constants.js index 1dde20fd..eb3e55ba 100644 --- a/src/actions/constants.js +++ b/src/actions/constants.js @@ -17,6 +17,7 @@ const UPSERT_LINK_ENTITIES = 'UPSERT_LINK_ENTITIES'; const UPSERT_VIDEO_ENTITIES = 'UPSERT_VIDEO_ENTITIES'; const UPSERT_VIDEO_STAT_ENTITIES = 'UPSERT_VIDEO_STAT_ENTITIES'; const UPSERT_REPLY_DETAIL_ENTITIES = 'UPSERT_REPLY_DETAIL_ENTITIES'; +const UPSERT_CURRENT_USER_VIDEO_RELATION_ENTITIES = 'UPSERT_CURRENT_USER_VIDEO_RELATION_ENTITIES'; const UPSERT_HOME_FEED_ENTITIES = 'UPSERT_HOME_FEED_ENTITIES'; const UPSERT_IMAGE_ENTITIES = 'UPSERT_IMAGE_ENTITIES'; const UPDATE_BALANCE = 'UPDATE_BALANCE'; @@ -61,6 +62,7 @@ export { UPSERT_USER_PROFILE_ENTITIES, UPSERT_USER_STAT_ENTITIES, UPSERT_REPLY_DETAIL_ENTITIES, + UPSERT_CURRENT_USER_VIDEO_RELATION_ENTITIES, UPSERT_LINK_ENTITIES, UPSERT_VIDEO_ENTITIES, UPSERT_VIDEO_STAT_ENTITIES, diff --git a/src/actions/index.js b/src/actions/index.js index 7ac35289..9e048252 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -112,6 +112,11 @@ export const upsertReplyDetailEntities = (data) => ({ payload: { reply_detail_entities: data } }); +export const upsertCurrentUserVideoRelationEntities = (data) => ({ + type: types.UPSERT_CURRENT_USER_VIDEO_RELATION_ENTITIES, + payload: { current_user_video_relation_entities: data } +}); + export const upsertHomeFeedEntities = (data) => ({ type: types.UPSERT_HOME_FEED_ENTITIES, payload: { home_feed_entities: data } diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js index 44bb0500..fecc6e6e 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js @@ -6,12 +6,11 @@ import deepGet from 'lodash/get'; import ProfilePicture from "../../ProfilePicture"; import reduxGetters from '../../../services/ReduxGetters'; import { TouchableOpacity } from 'react-native-gesture-handler'; -import ReduxGetters from '../../../services/ReduxGetters'; import AppConfig from '../../../constants/AppConfig'; const mapStateToProps = (state, ownProps) => { return { - seen: ReduxGetters.getReplyEntitySeen( deepGet(ownProps.payload,'reply_detail_id')) + seen: reduxGetters.getReplyEntitySeen( reduxGetters.getReplyEntityId(deepGet(ownProps.payload,'reply_detail_id'))) }; }; @@ -25,10 +24,8 @@ class ReplyThumbnailItem extends Component { } render() { - return - + return - } } @@ -42,10 +39,10 @@ const inlineStyle= { borderWidth: 2, borderColor: '#fff' }, - shadowWrapperStyle: { + wrapperStyle: { width: 60, height: 60, - borderRadius: 30 + backgroundColor: 'transparent' }, active: { shadowColor: '#fff', diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index 6f3293bb..b3945f7b 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -177,6 +177,8 @@ class FullScreenReplyCollection extends PureComponent{ } onViewableItemsChanged = (data) => { + let item = deepGet(data, 'viewableItems[0].item'); + item && ReplyHelper.updateEntitySeen( item ); this.currentIndex = deepGet(data, 'viewableItems[0].index') || 0; } diff --git a/src/helpers/ReplyHelper.js b/src/helpers/ReplyHelper.js index 3f928602..956b9db7 100644 --- a/src/helpers/ReplyHelper.js +++ b/src/helpers/ReplyHelper.js @@ -3,7 +3,7 @@ import deepGet from 'lodash/get'; import store from '../store'; import DataContract from "../constants/DataContract"; import ReduxGetters from "../services/ReduxGetters"; -import { upsertReplyDetailEntities } from '../reducers'; +import { upsertCurrentUserVideoRelationEntities } from '../reducers'; import Utilities from '../services/Utilities'; async function openRepliesList( parentUserId, parentVideoId, fetchServicesClonedInstance, currentIndex, navigation){ @@ -17,10 +17,12 @@ async function openRepliesList( parentUserId, parentVideoId, fetchServicesCloned } function updateEntitySeen (item) { - const replyDetailId = deepGet(item,'payload.reply_detail_id'); - let replyEntity = ReduxGetters.getReplyEntity( replyDetailId ); - replyEntity['seen'] = true; - store.dispatch(upsertReplyDetailEntities(Utilities._getEntityFromObj(replyEntity))); + const entityId = ReduxGetters.getReplyEntityId(deepGet(item,'payload.reply_detail_id')); + let currentUserVideoRelationEntity = ReduxGetters.getCurrentUserVideoRelationEntity( entityId ); + if(currentUserVideoRelationEntity){ + currentUserVideoRelationEntity['has_seen'] = true; + store.dispatch(upsertCurrentUserVideoRelationEntities(Utilities._getEntityFromObj(currentUserVideoRelationEntity))); + } } export default { openRepliesList, updateEntitySeen } \ No newline at end of file diff --git a/src/reducers/index.js b/src/reducers/index.js index 3cff51b0..459b8495 100644 --- a/src/reducers/index.js +++ b/src/reducers/index.js @@ -26,6 +26,7 @@ export const { upsertVideoEntities, upsertVideoStatEntities, upsertReplyDetailEntities, + upsertCurrentUserVideoRelationEntities, upsertImageEntities, upsertHomeFeedEntities, updateBalance, @@ -70,6 +71,7 @@ const defaultState = { video_entities: {}, video_stat_entities: {}, reply_detail_entities: {}, + current_user_video_relation_entities: {}, video_description_entities: {}, image_entities: {}, home_feed_entities: {}, @@ -102,6 +104,7 @@ const logoutDefault = { video_entities: {}, video_stat_entities: {}, reply_detail_entities: {}, + current_user_video_relation_entities: {}, video_description_entities: {}, image_entities: {}, home_feed_entities: {}, @@ -180,6 +183,10 @@ export const reducer = handleActions( ...state, reply_detail_entities: assignIn({}, state.reply_detail_entities, action.payload.reply_detail_entities) }), + [upsertCurrentUserVideoRelationEntities]: (state, action) => ({ + ...state, + current_user_video_relation_entities: assignIn({}, state.current_user_video_relation_entities, action.payload.current_user_video_relation_entities) + }), [upsertVideoDescriptionEntities]: (state, action) => ({ ...state, video_description_entities: assignIn( diff --git a/src/services/ReduxGetters.js b/src/services/ReduxGetters.js index a3080a13..2b73f1b1 100644 --- a/src/services/ReduxGetters.js +++ b/src/services/ReduxGetters.js @@ -454,7 +454,6 @@ class ReduxGetters { return deepGet(state, `tag_entities.id_${id}`); } - getReplyEntity(id, state) { state = state || Store.getState(); return deepGet(state, `reply_detail_entities.id_${id}`); @@ -475,9 +474,14 @@ class ReduxGetters { return deepGet(state, `reply_detail_entities.id_${id}.entity_id`); } + getCurrentUserVideoRelationEntity(id, state){ + state = state || Store.getState(); + return deepGet(state, `current_user_video_relation_entities.id_${id}`); + } + getReplyEntitySeen(id, state){ state = state || Store.getState(); - return deepGet(state, `reply_detail_entities.id_${id}.seen`, false); + return deepGet(state, `current_user_video_relation_entities.id_${id}.has_seen`); } getReplyDescriptionId(id, state) { diff --git a/src/services/ReduxSetters.js b/src/services/ReduxSetters.js index 86d14d8f..f787873b 100644 --- a/src/services/ReduxSetters.js +++ b/src/services/ReduxSetters.js @@ -16,6 +16,7 @@ const knownEntitiesDispatcherMap = { video_details: 'upsertVideoStatEntities', video_replies: 'upsertVideoReplyEntities', reply_details: 'upsertReplyDetailEntities', + current_user_video_relations: 'upsertCurrentUserVideoRelationEntities', images: 'upsertImageEntities', current_user_video_contributions: 'upsertVideoContributionEntities', current_user_user_contributions: 'upsertUserContributionEntities', From d830c0646ea25c16c6e6ccad367a8d2988ebfc8c Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Fri, 22 Nov 2019 16:34:42 +0530 Subject: [PATCH 130/302] Video Share fix --- src/components/UserVideoHistory/UserVideoHistoryRow.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/UserVideoHistory/UserVideoHistoryRow.js b/src/components/UserVideoHistory/UserVideoHistoryRow.js index a21772c7..f09aff6e 100644 --- a/src/components/UserVideoHistory/UserVideoHistoryRow.js +++ b/src/components/UserVideoHistory/UserVideoHistoryRow.js @@ -75,7 +75,7 @@ class UserVideoHistoryRow extends PureComponent { getPixelDropData={this.getPixelDropData} /> - + From d955dcd38135e025cd8ad6ac6e3438b97724beb7 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Fri, 22 Nov 2019 16:47:06 +0530 Subject: [PATCH 131/302] fix --- .../InvertedReplyThumbnailList/ReplyThumbnailItem.js | 5 +++-- .../CommonComponents/InvertedReplyThumbnailList/index.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js index fecc6e6e..581e76bc 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js @@ -1,5 +1,4 @@ import React, { Component } from 'react'; -import { View } from 'react-native'; import { connect } from 'react-redux'; import deepGet from 'lodash/get'; @@ -7,6 +6,7 @@ import ProfilePicture from "../../ProfilePicture"; import reduxGetters from '../../../services/ReduxGetters'; import { TouchableOpacity } from 'react-native-gesture-handler'; import AppConfig from '../../../constants/AppConfig'; +import multipleClickHandler from '../../../services/MultipleClickHandler'; const mapStateToProps = (state, ownProps) => { return { @@ -24,7 +24,8 @@ class ReplyThumbnailItem extends Component { } render() { - return + return { this.props.onClickHandler();})} + style={[inlineStyle.wrapperStyle, !this.props.seen && inlineStyle.unseen, this.props.isActive() && inlineStyle.active]}> } diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index 4dd3539e..b6ca836d 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -184,7 +184,7 @@ class InvertedReplyList extends Component { _renderItem = ({item, index}) => { return - {this.onItemClick(index, item)}} /> + {this.onItemClick(index, item)}} isActive={()=>{return this.isActive( index )} }/> ; }; From 780af04241ccb6b70731bcca71e5c686c9328657 Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Fri, 22 Nov 2019 17:14:44 +0530 Subject: [PATCH 132/302] recent mocks change and shadow changes --- .../ReplyThumbnailItem.js | 44 ++++++++++--------- .../VideoReplyRow.js | 19 +++++--- src/constants/AppConfig.js | 6 ++- 3 files changed, 40 insertions(+), 29 deletions(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js index 581e76bc..abce615c 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js @@ -24,7 +24,7 @@ class ReplyThumbnailItem extends Component { } render() { - return { this.props.onClickHandler();})} + return { this.props.onClickHandler();})} style={[inlineStyle.wrapperStyle, !this.props.seen && inlineStyle.unseen, this.props.isActive() && inlineStyle.active]}> @@ -32,38 +32,42 @@ class ReplyThumbnailItem extends Component { } const inlineStyle= { - iconStyle: { height: AppConfig.thumbnailListConstants.iconHeight, - width: AppConfig.thumbnailListConstants.iconWidth, - borderRadius: AppConfig.thumbnailListConstants.iconWidth/ 2 + iconStyle: { height: AppConfig.thumbnailListConstants.iconHeight - 8, + width: AppConfig.thumbnailListConstants.iconWidth - 8, + borderRadius: (AppConfig.thumbnailListConstants.iconWidth - 8)/ 2 }, borderStyle: { - borderWidth: 2, + borderWidth: 1, borderColor: '#fff' }, wrapperStyle: { - width: 60, - height: 60, - backgroundColor: 'transparent' + width: AppConfig.thumbnailListConstants.iconWidth , + height:AppConfig.thumbnailListConstants.iconHeight , + borderRadius: (AppConfig.thumbnailListConstants.iconWidth )/ 2, + padding: 4 }, active: { shadowColor: '#fff', - shadowOffset: { - width: -5, - height: 3 - }, + shadowOffset: { width: 0, height: 2 }, shadowOpacity: 1, - shadowRadius: 15, - borderRadius: 30 + shadowRadius: 4, + elevation: 5 }, unseen: { + shadowColor: 'red', - shadowOffset: { - width: -5, - height: 3 - }, + shadowOffset: { width: 0, height: 2 }, shadowOpacity: 1, - shadowRadius: 15, - borderRadius: 30 + shadowRadius: 4, + elevation: 5 + // shadowColor: 'red', + // shadowOffset: { + // width: 1, + // height: 1 + // }, + // shadowOpacity: 1, + // shadowRadius: 15, + // borderRadius: 30 } } diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index 7b7b4a8b..8814f194 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -68,13 +68,9 @@ class VideoReplyRow extends PureComponent { paginationService={this.props.paginationService} onChildClickDelegate={this.props.onChildClickDelegate} currentIndex={this.props.currentIndex} - parentIconHeight={AppConfig.thumbnailListConstants.parentIconHeight + marginTopForParentIcon } - /> - + - + + + + + {/**/} {this.reportViewRef = ref }} onLayout={()=>{}} > diff --git a/src/constants/AppConfig.js b/src/constants/AppConfig.js index 0e7534e8..7b861429 100644 --- a/src/constants/AppConfig.js +++ b/src/constants/AppConfig.js @@ -335,8 +335,10 @@ export default { MaxDescriptionArea: 35250, thumbnailListConstants: { separatorHeight: 25, - iconHeight:35, - iconWidth: 35, + // this is height of profile icon + shadow around it. + iconHeight:44, + // this is width of profile icon + shadow around it. + iconWidth: 44, parentIconHeight: 50, parentIconWidth: 50 }, From 0662f17494fe78f56821e4333eadc9ae96dcca59 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Fri, 22 Nov 2019 17:34:47 +0530 Subject: [PATCH 133/302] code changes --- .../InvertedReplyThumbnailList/index.js | 20 +++++++++++-------- .../VideoReplyRow.js | 2 +- .../FullScreenReplyCollection/index.js | 2 ++ src/helpers/ReplyHelper.js | 12 +---------- 4 files changed, 16 insertions(+), 20 deletions(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index b6ca836d..a531948f 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -7,6 +7,7 @@ import ReplyThumbnailItem from './ReplyThumbnailItem' import {FlatList} from 'react-native-gesture-handler'; import ReplyHelper from '../../../helpers/ReplyHelper'; import AppConfig from "../../../constants/AppConfig"; +import DataContract from '../../../constants/DataContract'; // const ITEM_HEIGHT = AppConfig.thumbnailListConstants.iconHeight + AppConfig.thumbnailListConstants.iconWidth; @@ -47,12 +48,14 @@ class InvertedReplyList extends Component { } defaultChildClickHandler = ( index, item )=> { - const parentVideoId = this.props.videoId, - parentUserId = this.props.userId, - clonedInstance = this.getPagination().fetchServices.cloneInstance(), - navigation = this.props.navigation; + const baseUrl = DataContract.replies.getReplyListApi(this.props.videoId), + clonedInstance = this.getPagination().fetchServices.cloneInstance(); ReplyHelper.updateEntitySeen( item ); -    ReplyHelper.openRepliesList(parentUserId, parentVideoId, clonedInstance, index, navigation); +    this.props.navigation.push('FullScreenReplyCollection',{ +      "fetchServices": clonedInstance, +      "currentIndex":index, +      "baseUrl": baseUrl +    });   }; setPagination() { @@ -79,7 +82,7 @@ class InvertedReplyList extends Component { this.initPagination(); } if(this.props.currentIndex != prevProps.currentIndex){ - this.listRef && this.listRef.scrollToIndex({index : this.props.currentIndex}); + this.listRef && this.listRef.scrollToIndex({index : this.props.currentIndex, viewOffset: 50, viewPosition: 0}); } } @@ -190,7 +193,7 @@ class InvertedReplyList extends Component { }; isActive = ( index )=>{ - return this.props.currentIndex == index; + return this.props.showActiveIndicator && this.props.currentIndex == index; } setListRef = (ref) => { @@ -254,7 +257,8 @@ class InvertedReplyList extends Component { InvertedReplyList.defaultProps = { paginationService : null, doRender: true, - currentIndex: 0 + currentIndex: 0, + showActiveIndicator: false }; //make this component available to the app diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index 8814f194..009d81ea 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -35,7 +35,6 @@ class VideoReplyRow extends PureComponent { this.parentUserId = ReduxGetters.getReplyParentUserId( this.props.replyDetailId ); } - refetchVideoReply = () => { new PepoApi(`/replies/${this.props.replyDetailId}`) .get() @@ -69,6 +68,7 @@ class VideoReplyRow extends PureComponent { onChildClickDelegate={this.props.onChildClickDelegate} currentIndex={this.props.currentIndex} // parentIconHeight={AppConfig.thumbnailListConstants.parentIconHeight + marginTopForParentIcon } + showActiveIndicator={true} /> diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index b3945f7b..a830c455 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -27,6 +27,7 @@ class FullScreenReplyCollection extends PureComponent{ this.setVideoPagination(); this.paginationEvent = this.getVideoPagination().event; this.currentIndex = this.props.navigation.getParam("currentIndex"); + this.parentClickHandler = this.props.navigation.getParam("parentClickHandler"); this.isScrolled = false ; this.willFocusSubscription = null ; this.flatlistRef = null; @@ -162,6 +163,7 @@ class FullScreenReplyCollection extends PureComponent{ replyDetailId={replyDetailId} paginationService ={this.getVideoPagination()} onChildClickDelegate={this.childClickHandler} + onParentClickDelegate={this.parentClickHandler} currentIndex={this.state.activeIndex} /> ; } diff --git a/src/helpers/ReplyHelper.js b/src/helpers/ReplyHelper.js index 956b9db7..091dd92b 100644 --- a/src/helpers/ReplyHelper.js +++ b/src/helpers/ReplyHelper.js @@ -1,20 +1,10 @@ import deepGet from 'lodash/get'; import store from '../store'; -import DataContract from "../constants/DataContract"; import ReduxGetters from "../services/ReduxGetters"; import { upsertCurrentUserVideoRelationEntities } from '../reducers'; import Utilities from '../services/Utilities'; -async function openRepliesList( parentUserId, parentVideoId, fetchServicesClonedInstance, currentIndex, navigation){ -    navigation.push('FullScreenReplyCollection',{ -      "fetchServices": fetchServicesClonedInstance, -      "currentIndex": currentIndex, -      "baseUrl": DataContract.replies.getReplyListApi(parentVideoId), -      'userId': parentUserId, -      'videoId': parentVideoId -    }); -} function updateEntitySeen (item) { const entityId = ReduxGetters.getReplyEntityId(deepGet(item,'payload.reply_detail_id')); @@ -25,4 +15,4 @@ function updateEntitySeen (item) { } } -export default { openRepliesList, updateEntitySeen } \ No newline at end of file +export default { updateEntitySeen } \ No newline at end of file From 754d77137ec836ab58e2f4a8082185c5a37209ab Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Fri, 22 Nov 2019 17:41:27 +0530 Subject: [PATCH 134/302] code changes --- .../InvertedReplyThumbnailList/ReplyThumbnailItem.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js index abce615c..cd050148 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js @@ -25,10 +25,15 @@ class ReplyThumbnailItem extends Component { render() { return { this.props.onClickHandler();})} - style={[inlineStyle.wrapperStyle, !this.props.seen && inlineStyle.unseen, this.props.isActive() && inlineStyle.active]}> + style={[ this.isActiveOrUnseen() && inlineStyle.wrapperStyle, !this.props.seen && inlineStyle.unseen, this.props.isActive() && inlineStyle.active]}> } + + isActiveOrUnseen = () => { + return ! this.props.seen || this.props.isActive(); + } + } const inlineStyle= { From cee0ebec8559882c4120ce86a6d327eccf9e3fbf Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Fri, 22 Nov 2019 18:20:57 +0530 Subject: [PATCH 135/302] Mentions --- src/components/BottomStatus/Base.js | 124 ++++++++++++------- src/components/FanVideoDetails/index.js | 6 +- src/components/FanVideoReplyDetails/index.js | 3 +- 3 files changed, 84 insertions(+), 49 deletions(-) diff --git a/src/components/BottomStatus/Base.js b/src/components/BottomStatus/Base.js index a4238d06..57cc193f 100644 --- a/src/components/BottomStatus/Base.js +++ b/src/components/BottomStatus/Base.js @@ -13,22 +13,13 @@ import CurrentUser from '../../models/CurrentUser'; class BottomStatus extends PureComponent { constructor(props) { super(props); + this.videoDescriptionId = reduxGetter.getVideoDescriptionId(this.props.entityId); } onLinkClick = () => { InAppBrowser.openBrowser(this.props.link); }; - onTagPressed = (tag) => { - let entity = reduxGetter.getTappedIncludesEntity(this.props.entityDescriptionId, tag); - this.onDescriptionClick(entity, tag); - }; - - isValidTag(descriptionId, tappedText) { - let entity = reduxGetter.getTappedIncludesEntity(descriptionId, tappedText); - return !!entity - } - navigateToUserProfile = () => { if(!this.props.isUserNavigate) return; if (Utilities.checkActiveUser()) { @@ -40,21 +31,83 @@ class BottomStatus extends PureComponent { } }; - onDescriptionClick = ( tapEntity ) => { + isValidTag(descriptionId, tappedText) { + if(tappedText.indexOf('#') != 0 ) return false; + return this.isValidIncludes( descriptionId, tappedText ); + } + + isValidMention(descriptionId, tappedText) { + if(tappedText.indexOf('@') != 0 ) return false; + return this.isValidIncludes( descriptionId, tappedText ); + } + + isValidIncludes(descriptionId, tappedText){ + return !!reduxGetter.getTappedIncludesEntity(descriptionId, tappedText); + } + + getHashTagMarkup( item , prevText ){ + const tagText = item.replace("#", ""); + return ( + + {prevText} + { + this.onIncludesPressed(item) + }}> + # + {tagText} + + + ); + } + + getMentionMarkup( item , prevText ){ + const mentionText = item.replace("@", ""); + return ( + + {prevText} + { + this.onIncludesPressed(item) + }}> + @ + {mentionText} + + + ); + } + + onIncludesPressed = (tag) => { + let tapEntity = reduxGetter.getTappedIncludesEntity(this.props.entityDescriptionId, tag); if (!tapEntity) { return; } + if( tapEntity.kind === 'tags'){ - this.props.navigation.push('VideoTags', { - "tagId": tapEntity.id - }); + this.props.navigation.push('VideoTags', { "tagId": tapEntity.id }); + return; } + + if( tapEntity.kind === 'users'){ + this.props.navigation.push('UsersProfileScreen', { userId: tapEntity.id }); + return; + } + }; + + getTextMarkup( item , prevText){ + return ( + + {prevText + item} + + ) } render() { let processingString = this.props.description; - let hasTagArray = processingString.match(/#\w+/g) || []; + let includesArray = processingString.match(/(#|@)\w+/g) || []; return ( @@ -72,38 +125,19 @@ class BottomStatus extends PureComponent { numberOfLines={3} > - {(hasTagArray.map((hashTag) => { - - let tagLocation = processingString.search(hashTag); + {(includesArray.map((item) => { + let tagLocation = processingString.search(item); let prevText = processingString.slice(0, tagLocation); - - processingString = processingString.slice(tagLocation + hashTag.length); - - if (this.isValidTag(this.videoDescriptionId, hashTag)) { - let tagText = hashTag.replace("#", ""); - return ( - - {prevText} - { - this.onTagPressed(hashTag) - }}> - # - {tagText} - - - - ); - } else { - return ( - - {prevText + hashTag} - - ) + processingString = processingString.slice(tagLocation + item.length); + if (this.isValidTag(this.videoDescriptionId, item)) { + return this.getHashTagMarkup(item, prevText); + } if( this.isValidMention(this.videoDescriptionId , item) ){ + return this.getMentionMarkup(item, prevText); + }else { + return this.getHashTagMarkup(item, prevText); } - })) - } + }))} + {processingString} diff --git a/src/components/FanVideoDetails/index.js b/src/components/FanVideoDetails/index.js index d704250f..3082e21e 100644 --- a/src/components/FanVideoDetails/index.js +++ b/src/components/FanVideoDetails/index.js @@ -6,8 +6,7 @@ import { View, Text, Keyboard, - ScrollView, - TextInput + ScrollView } from 'react-native'; import deepGet from 'lodash/get'; import utilities from '../../services/Utilities'; @@ -34,9 +33,10 @@ import NumberInput from "../CommonComponents/NumberInput"; import NumberFormatter from "../../helpers/NumberFormatter"; import pricer from '../../services/Pricer'; import PepoPinkIcon from '../../assets/pepo-tx-icon.png'; -import { ostErrors } from '../../services/OstErrors'; import AppConfig from '../../constants/AppConfig' +//TODO setParams dont use + const mapStateToProps = (state, ownProps) => { return { balance : state.balance, diff --git a/src/components/FanVideoReplyDetails/index.js b/src/components/FanVideoReplyDetails/index.js index 0163b773..8e074e78 100644 --- a/src/components/FanVideoReplyDetails/index.js +++ b/src/components/FanVideoReplyDetails/index.js @@ -9,7 +9,6 @@ import { ScrollView } from 'react-native'; import deepGet from 'lodash/get'; -import utilities from '../../services/Utilities'; import CurrentUser from '../../models/CurrentUser'; import styles from './styles'; import VideoDescription from '../FanVideoDetails/VideoDescription'; @@ -33,6 +32,8 @@ import pricer from "../../services/Pricer"; import {ensureDeivceAndSession} from "../../helpers/TransactionHelper"; import Toast from "../../theme/components/NotificationToast"; +//TODO setParams dont use + const mapStateToProps = (state, ownProps) => { return { recordedVideo: reduxGetter.getRecordedVideo() From 335f724173391be1fbd9de54da1a9615daa0c988 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Fri, 22 Nov 2019 19:31:16 +0530 Subject: [PATCH 136/302] Minor fix --- src/components/BottomStatus/Base.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/BottomStatus/Base.js b/src/components/BottomStatus/Base.js index 57cc193f..b130abc8 100644 --- a/src/components/BottomStatus/Base.js +++ b/src/components/BottomStatus/Base.js @@ -134,7 +134,7 @@ class BottomStatus extends PureComponent { } if( this.isValidMention(this.videoDescriptionId , item) ){ return this.getMentionMarkup(item, prevText); }else { - return this.getHashTagMarkup(item, prevText); + return this.getTextMarkup(item, prevText); } }))} From de1ca0bed6f4a0af16c4cccd4b44227ac3e71c38 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Fri, 22 Nov 2019 19:34:25 +0530 Subject: [PATCH 137/302] code change --- src/components/FanVideoReplyDetails/index.js | 3 ++ .../VideoReplyRow.js | 31 ++++++++++++------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/components/FanVideoReplyDetails/index.js b/src/components/FanVideoReplyDetails/index.js index a05e2f26..0406955c 100644 --- a/src/components/FanVideoReplyDetails/index.js +++ b/src/components/FanVideoReplyDetails/index.js @@ -140,6 +140,9 @@ class FanVideoReplyDetails extends Component { return new Promise((resolve, reject)=> { let btAmount = this.getAmountToSend(); const btInDecimal = pricer.getToDecimal(btAmount); + if (btAmount === '0'){ + return resolve(); + } ensureDeivceAndSession(CurrentUser.getOstUserId(), btInDecimal, (device) => { this._deviceUnauthorizedCallback(device); reject(); diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index 009d81ea..55fc66b4 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -1,11 +1,10 @@ import React, { PureComponent } from 'react'; -import { View , Dimensions} from 'react-native'; +import { View , Dimensions, TouchableOpacity} from 'react-native'; import { withNavigation } from 'react-navigation'; import FanVideo from "../VideoWrapper/FanVideo"; import ShareIcon from "../CommonComponents/ShareIcon"; import ReportVideo from "../CommonComponents/ReportVideo"; import BottomReplyBar from "../CommonComponents/BottomReplyBar"; -import ReplyIcon from "../CommonComponents/ReplyIcon"; import PepoApi from '../../services/PepoApi'; import inlineStyles from './styles'; @@ -22,6 +21,7 @@ import InvertedReplyList from "../CommonComponents/InvertedReplyThumbnailList"; import AppConfig from "../../constants/AppConfig"; import ProfilePicture from "../ProfilePicture"; +import multipleClickHandler from '../../services/MultipleClickHandler'; const marginTopForParentIcon = 15; @@ -33,6 +33,7 @@ class VideoReplyRow extends PureComponent { super(props); this.parentVideoId = ReduxGetters.getReplyParentVideoId( this.props.replyDetailId ); this.parentUserId = ReduxGetters.getReplyParentUserId( this.props.replyDetailId ); + this.onParentClickDelegate = this.props.onParentClickDelegate || this.defaultParentClickHandler; } refetchVideoReply = () => { @@ -48,11 +49,17 @@ class VideoReplyRow extends PureComponent { return assignIn({}, pixelParams, parentData); } + defaultParentClickHandler(){ + this.props.navigation.push('VideoPlayer', { + userId: this.parentUserId, + videoId: this.parentVideoId + }) + } + render() { let userId = this.props.userId, replyDetailId = this.props.replyDetailId, videoId = ReduxGetters.getReplyEntityId(replyDetailId), - parentVideoId = ReduxGetters.getReplyEntity( replyDetailId )[DataContract.replies.parentVideoIdKey], parentUserId = ReduxGetters.getReplyEntity(replyDetailId)[DataContract.replies.creatorUserIdKey]; ; return ( @@ -61,7 +68,7 @@ class VideoReplyRow extends PureComponent { - - - - + {this.onParentClickDelegate()})}> + + {/**/} From fdd926c572d3b3e28990a79e780fe3f78b26e700 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Fri, 22 Nov 2019 19:47:53 +0530 Subject: [PATCH 138/302] Minor fix --- src/components/FullScreenReplyCollection/VideoReplyRow.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index a66f193e..e9e6f2ac 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -62,8 +62,8 @@ class VideoReplyRow extends PureComponent { - Date: Fri, 22 Nov 2019 20:24:46 +0530 Subject: [PATCH 139/302] Minor fix --- .../FullScreenReplyCollection/VideoReplyRow.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index 0491344e..bda63b4a 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -57,8 +57,8 @@ class VideoReplyRow extends PureComponent { defaultParentClickHandler(){ this.props.navigation.push('VideoPlayer', { - userId: this.parentUserId, - videoId: this.parentVideoId + userId: this.props.parentUserId, + videoId: this.props.parentVideoId }) } @@ -104,15 +104,15 @@ class VideoReplyRow extends PureComponent { getPixelDropData={this.getPixelDropData} /> {this.onParentClickDelegate()})}> - - - + + Date: Fri, 22 Nov 2019 20:29:22 +0530 Subject: [PATCH 140/302] parent back handling for sliding panel --- src/components/ReplyCollection/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/ReplyCollection/index.js b/src/components/ReplyCollection/index.js index 5f6462df..a39de57e 100644 --- a/src/components/ReplyCollection/index.js +++ b/src/components/ReplyCollection/index.js @@ -215,10 +215,14 @@ class ReplyCollection extends PureComponent { this.props.navigation.push("FullScreenReplyCollection", { "fetchServices" : clonedInstance, "currentIndex": index, - "baseUrl": this.props.fetchUrl + "baseUrl": this.props.fetchUrl, + "parentClickHandler": this.parentClickHandler }); } + parentClickHandler(){ + this.props.navigation.goBack(null); + } renderFooter = () => { if (!this.state.loadingNext) return null; From 69c41b21553a4ffb02c54106657f795562949ca2 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Fri, 22 Nov 2019 20:41:09 +0530 Subject: [PATCH 141/302] add single video player to all push stacks --- RootNavigationContainer.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/RootNavigationContainer.js b/RootNavigationContainer.js index 218edeba..b26b41c6 100644 --- a/RootNavigationContainer.js +++ b/RootNavigationContainer.js @@ -159,6 +159,8 @@ const HomePushStack = createStackNavigator( UserVideoHistory: UserVideoHistory, SupportingListScreen: SupportingListScreen, SupportersListScreen: SupportersListScreen, + VideoPlayer: VideoPlayer, + VideoReplyPlayer: VideoReplyPlayer, VideoTags: VideoTags, FullScreenVideoCollection: FullScreenVideoCollection }, @@ -230,6 +232,8 @@ const ProfilePushStack = createStackNavigator( BioScreen: BioScreen, EmailScreen: EmailScreen, ReferAndEarn: ReferAndEarn, + VideoPlayer: VideoPlayer, + VideoReplyPlayer: VideoReplyPlayer, Invites: Invites, WalletSettingScreen: WalletSettingScreen, WalletDetails: WalletDetails, @@ -275,6 +279,8 @@ const SearchPushStack = createStackNavigator( SupportingListScreen: SupportingListScreen, SupportersListScreen: SupportersListScreen, UserVideoHistory: UserVideoHistory, + VideoPlayer: VideoPlayer, + VideoReplyPlayer: VideoReplyPlayer, VideoTags: VideoTags, FullScreenVideoCollection: FullScreenVideoCollection }, From ccbdf54f6bd6e19f3299fa8a52ca8d8fde46709d Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Fri, 22 Nov 2019 20:42:56 +0530 Subject: [PATCH 142/302] Delete video fix --- .../InvertedReplyThumbnailList/ReplyThumbnailItem.js | 2 +- src/components/ReplyCollection/index.js | 4 +--- src/services/ReduxGetters.js | 8 +++++++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js index cd050148..3e7b724c 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js @@ -10,7 +10,7 @@ import multipleClickHandler from '../../../services/MultipleClickHandler'; const mapStateToProps = (state, ownProps) => { return { - seen: reduxGetters.getReplyEntitySeen( reduxGetters.getReplyEntityId(deepGet(ownProps.payload,'reply_detail_id'))) + seen: reduxGetters.isVideoSeen( reduxGetters.getReplyEntityId(deepGet(ownProps.payload,'reply_detail_id'))) }; }; diff --git a/src/components/ReplyCollection/index.js b/src/components/ReplyCollection/index.js index 5f6462df..361728c6 100644 --- a/src/components/ReplyCollection/index.js +++ b/src/components/ReplyCollection/index.js @@ -178,11 +178,10 @@ class ReplyCollection extends PureComponent { } _renderVideoReplyThumbnail( item, index ) { - const userId = deepGet(item, "payload.user_id"); const reply_detail_id = deepGet(item,`payload.${DataContract.replies.replyDetailIdKey}`); const videoId = ReduxGetters.getReplyEntityId(reply_detail_id); return ( - {this.isCurrentUser( userId ) && { if (!this.state.loadingNext) return null; return ; diff --git a/src/services/ReduxGetters.js b/src/services/ReduxGetters.js index 514b12e1..fb76e18b 100644 --- a/src/services/ReduxGetters.js +++ b/src/services/ReduxGetters.js @@ -479,11 +479,16 @@ class ReduxGetters { return deepGet(state, `current_user_video_relation_entities.id_${id}`); } - getReplyEntitySeen(id, state){ + isVideoSeen(id, state){ state = state || Store.getState(); return deepGet(state, `current_user_video_relation_entities.id_${id}.has_seen`); } + getCanDeleteVideo(id, state){ + state = state || Store.getState(); + return !!Number( deepGet(state, `current_user_video_relation_entities.id_${id}.can_delete` , 0) ); + } + getReplyDescriptionId(id, state) { state = state || Store.getState(); return deepGet(state, `reply_detail_entities.id_${id}.description_id`); @@ -525,6 +530,7 @@ class ReduxGetters { state = state || Store.getState(); return deepGet(state, `reply_detail_entities.id_${id}.creator_user_id`); } + } export default new ReduxGetters(); From 01eb2f8a36cef25ac61cf47ea915ce146ba89f0a Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Fri, 22 Nov 2019 20:52:52 +0530 Subject: [PATCH 143/302] minor fix --- RootNavigationContainer.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RootNavigationContainer.js b/RootNavigationContainer.js index b26b41c6..42ba83c2 100644 --- a/RootNavigationContainer.js +++ b/RootNavigationContainer.js @@ -144,6 +144,8 @@ const FullScreenReplyStack = createStackNavigator( UserVideoHistory: UserVideoHistory, SupportingListScreen: SupportingListScreen, SupportersListScreen: SupportersListScreen, + VideoPlayer: VideoPlayer, + VideoReplyPlayer: VideoReplyPlayer, VideoTags: VideoTags, }, { From 46ad452d7c0f692b2a3bbd0bf7ad90a928c0146b Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Fri, 22 Nov 2019 21:02:25 +0530 Subject: [PATCH 144/302] Minor fix --- RootNavigationContainer.js | 1 + 1 file changed, 1 insertion(+) diff --git a/RootNavigationContainer.js b/RootNavigationContainer.js index 42ba83c2..974756b8 100644 --- a/RootNavigationContainer.js +++ b/RootNavigationContainer.js @@ -140,6 +140,7 @@ const InAppBrowserStack = createStackNavigator( const FullScreenReplyStack = createStackNavigator( { FullScreenReplyCollection: FullScreenReplyCollection, + FullScreenVideoCollection: FullScreenVideoCollection, UsersProfileScreen: UsersProfileScreen, UserVideoHistory: UserVideoHistory, SupportingListScreen: SupportingListScreen, From 9d597b8bb0e3287bcba85264bc5b2d4081548a08 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Mon, 25 Nov 2019 12:32:57 +0530 Subject: [PATCH 145/302] minor change --- .../CommonComponents/InvertedReplyThumbnailList/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index a531948f..cf59ac14 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -82,7 +82,7 @@ class InvertedReplyList extends Component { this.initPagination(); } if(this.props.currentIndex != prevProps.currentIndex){ - this.listRef && this.listRef.scrollToIndex({index : this.props.currentIndex, viewOffset: 50, viewPosition: 0}); + this.listRef && this.listRef.scrollToIndex({index : this.props.currentIndex, viewOffset: 100, viewPosition: 0}); } } From 5d39142acec6c8d286bfb9aa90e54b6b3c100878 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Mon, 25 Nov 2019 12:43:07 +0530 Subject: [PATCH 146/302] zoom in animation commented --- RootNavigationContainer.js | 24 ++++++++++++------------ src/helpers/NavigationAnimation.js | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/RootNavigationContainer.js b/RootNavigationContainer.js index 974756b8..61ec2d83 100644 --- a/RootNavigationContainer.js +++ b/RootNavigationContainer.js @@ -99,18 +99,18 @@ const txModalConfig = { const scenes = transitionProps["scenes"]; const prevScene = scenes[scenes.length - 2]; const nextScene = scenes[scenes.length - 1]; - if(Platform.OS == "ios"){ - if (prevScene - && prevScene.route.routeName === 'VideoReplies' - && nextScene.route.routeName === 'FullScreenReplyCollection') { - return NavigationAnimation.zoomIn(); - } - else if (prevScene - && prevScene.route.routeName === 'FullScreenReplyCollection' - && nextScene.route.routeName === 'VideoReplies') { - return NavigationAnimation.zoomOut(); - } - } + // if(Platform.OS == "ios"){ + // if (prevScene + // && prevScene.route.routeName === 'VideoReplies' + // && nextScene.route.routeName === 'FullScreenReplyCollection') { + // return NavigationAnimation.zoomIn(); + // } + // else if (prevScene + // && prevScene.route.routeName === 'FullScreenReplyCollection' + // && nextScene.route.routeName === 'VideoReplies') { + // return NavigationAnimation.zoomOut(); + // } + // } return NavigationAnimation.defaultTransition(); } }; diff --git a/src/helpers/NavigationAnimation.js b/src/helpers/NavigationAnimation.js index 00461374..6bf04a41 100644 --- a/src/helpers/NavigationAnimation.js +++ b/src/helpers/NavigationAnimation.js @@ -19,8 +19,8 @@ export default { } const scale = position.interpolate({ - inputRange: [index - 1, index], - outputRange: [start, 1], + inputRange: [index - 1, index , index + 1], + outputRange: [start, 1 , 1], }); return { transform: [{ scale }] }; From 48455e1401177a7f744f97c7874b16d1bb8a7f72 Mon Sep 17 00:00:00 2001 From: Akshay Raje Date: Mon, 25 Nov 2019 13:10:13 +0530 Subject: [PATCH 147/302] Fix in statusbar whitelist --- package-lock.json | 6 +++--- src/services/NavigationStateHandler.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 00a32626..59699d96 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2946,9 +2946,9 @@ } }, "@ostdotcom/ost-wallet-sdk-react-native": { - "version": "2.3.7-alpha.3", - "resolved": "https://registry.npmjs.org/@ostdotcom/ost-wallet-sdk-react-native/-/ost-wallet-sdk-react-native-2.3.7-alpha.3.tgz", - "integrity": "sha512-GAshH+6nO/gC7ToKNCscuamos3Vbhhpo8UtjjIz5seKYNWVRMJnHuD4VEvisgJXJ0ARZnm8v2vFWCGW7467f8w==" + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/@ostdotcom/ost-wallet-sdk-react-native/-/ost-wallet-sdk-react-native-2.3.9.tgz", + "integrity": "sha512-Vmny29NomNBY20u7Q09FGx6B7QFbomGXpi0gFEpN6e82MxNFv+Gew3PdBiSoD/pOLfD54cTMv2FCA5heVS+MpA==" }, "@protobufjs/aspromise": { "version": "1.1.2", diff --git a/src/services/NavigationStateHandler.js b/src/services/NavigationStateHandler.js index 307b5dc6..bed6c78e 100644 --- a/src/services/NavigationStateHandler.js +++ b/src/services/NavigationStateHandler.js @@ -5,7 +5,7 @@ import Colors from "../theme/styles/Colors"; import NavigationService from './NavigationService'; import AppConfig from '../constants/AppConfig'; -const routesWithoutStatusBar = ['Home', 'HomeScreen', 'VideoPlayer', 'CaptureVideo', 'CaptureImageScreen', 'ImageGalleryScreen', 'UserVideoHistory', "VideoReplies", 'FullScreenVideoCollection']; +const routesWithoutStatusBar = ['Home', 'HomeScreen', 'VideoPlayer', 'CaptureVideo', 'CaptureImageScreen', 'ImageGalleryScreen', 'UserVideoHistory', 'VideoReplies', 'FullScreenReplyCollection']; const typesToIgnore = ['Navigation/COMPLETE_TRANSITION', 'Navigation/MARK_DRAWER_SETTLING', 'Navigation/MARK_DRAWER_IDLE', 'Navigation/DRAWER_CLOSED']; const routesAnalyticsMap = AppConfig.routesAnalyticsMap; From 40ccf7fec065efc675f72598b4272ae3ac9556a9 Mon Sep 17 00:00:00 2001 From: Akshay Raje Date: Mon, 25 Nov 2019 13:14:10 +0530 Subject: [PATCH 148/302] Fix in statusbar whitelist --- src/services/NavigationStateHandler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/NavigationStateHandler.js b/src/services/NavigationStateHandler.js index bed6c78e..04a1a74f 100644 --- a/src/services/NavigationStateHandler.js +++ b/src/services/NavigationStateHandler.js @@ -16,7 +16,7 @@ const StatusBarShow = () => { StatusBar.setTranslucent(false); } - if(Platform.OS == "ios"){ + if(Platform.OS === "ios"){ StatusBar.setBarStyle("dark-content") } From febd0abbafcf1acdd95df1c31e3fd34e90626e88 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Mon, 25 Nov 2019 13:28:51 +0530 Subject: [PATCH 149/302] minor fix on notification for replies --- src/components/CommonComponents/VideoReplyPlayer/index.js | 1 - src/components/FullScreenReplyCollection/VideoReplyRow.js | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/CommonComponents/VideoReplyPlayer/index.js b/src/components/CommonComponents/VideoReplyPlayer/index.js index 33a43336..291152db 100644 --- a/src/components/CommonComponents/VideoReplyPlayer/index.js +++ b/src/components/CommonComponents/VideoReplyPlayer/index.js @@ -101,7 +101,6 @@ class VideoReplyPlayer extends PureComponent { doRender={true} userId={this.state.userId} replyDetailId={this.replyDetailId} - currentIndex={0}//Set it in default props getPixelDropData={this.getPixelDropData} /> diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index bda63b4a..04f25665 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -69,19 +69,19 @@ class VideoReplyRow extends PureComponent { - + {this.props.parentVideoId && ( + - + )} + Date: Mon, 25 Nov 2019 13:55:23 +0530 Subject: [PATCH 150/302] Minor fix --- src/components/FanVideoReplyDetails/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/FanVideoReplyDetails/index.js b/src/components/FanVideoReplyDetails/index.js index 1930cff9..20f97732 100644 --- a/src/components/FanVideoReplyDetails/index.js +++ b/src/components/FanVideoReplyDetails/index.js @@ -174,9 +174,9 @@ class FanVideoReplyDetails extends Component { Store.dispatch( upsertRecordedVideo({ video_desc: this.videoDesc, video_link: this.videoLink, do_upload: true }) ); - this.props.navigation.dispatch(StackActions.popToTop()); - this.props.navigation.dispatch(StackActions.popToTop()); - this.props.navigation.navigate('HomeScreen'); + const popAction = StackActions.pop(1); + this.props.navigation.dispatch(popAction); + this.props.navigation.dispatch(popAction); }; From 592f25f1cdb55d3e5688cb5e0c94b34b09a0f41b Mon Sep 17 00:00:00 2001 From: rachinkapoor Date: Mon, 25 Nov 2019 16:19:29 +0530 Subject: [PATCH 151/302] Twitter Login Popup Fix. --- src/actions/constants.js | 2 + src/actions/index.js | 32 ++++++++++++---- src/components/LoginPopover/index.js | 57 ++++++++++++++++++---------- src/reducers/index.js | 7 +++- src/services/ReduxGetters.js | 5 +++ src/services/TwitterAuthService.js | 6 ++- 6 files changed, 78 insertions(+), 31 deletions(-) diff --git a/src/actions/constants.js b/src/actions/constants.js index eb3e55ba..e6075c36 100644 --- a/src/actions/constants.js +++ b/src/actions/constants.js @@ -4,6 +4,7 @@ const SHOW_MODAL_COVER = 'SHOW_MODAL_COVER'; const HIDE_MODAL_COVER = 'HIDE_MODAL_COVER'; const SHOW_LOGIN_POPOVER = 'SHOW_LOGIN_POPOVER'; const HIDE_LOGIN_POPOVER = 'HIDE_LOGIN_POPOVER'; +const SHOW_CONNECTING_LOGIN_POPOVER = 'SHOW_CONNECTING_LOGIN_POPOVER'; const UPSERT_USER_ENTITIES = 'UPSERT_USER_ENTITIES'; const LOGOUT_USER = 'LOGOUT_USER'; const UPSERT_ACTIVITIES_ENTITIES = 'UPSERT_ACTIVITIES_ENTITIES'; @@ -52,6 +53,7 @@ export { SHOW_MODAL_COVER, HIDE_MODAL_COVER, SHOW_LOGIN_POPOVER, + SHOW_CONNECTING_LOGIN_POPOVER, HIDE_LOGIN_POPOVER, UPSERT_USER_ENTITIES, UPSERT_ACTIVITIES_ENTITIES, diff --git a/src/actions/index.js b/src/actions/index.js index 9e048252..419c81bd 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -27,19 +27,35 @@ export const showLoginPopover = () => ({ type: types.SHOW_LOGIN_POPOVER, payload: { login_popover: { - show: true + show: true, + isTwitterConnecting: false } } }); -export const hideLoginPopover = () => ({ - type: types.HIDE_LOGIN_POPOVER, - payload: { - login_popover: { - show: false +export const hideLoginPopover = () => { + return { + type: types.HIDE_LOGIN_POPOVER, + payload: { + login_popover: { + show: false, + isTwitterConnecting: false + } } - } -}); + }; +}; + +export const showConnectingLoginPopover = () => { + return { + type: types.SHOW_CONNECTING_LOGIN_POPOVER, + payload: { + login_popover: { + show: true, + isTwitterConnecting: true + } + } + }; +}; export const updateCurrentUser = (current_user) => ({ type: types.UPDATE_CURRENT_USER, diff --git a/src/components/LoginPopover/index.js b/src/components/LoginPopover/index.js index 13528271..c65cd885 100644 --- a/src/components/LoginPopover/index.js +++ b/src/components/LoginPopover/index.js @@ -7,10 +7,11 @@ import TouchableButton from '../../theme/components/TouchableButton'; import inlineStyles from './styles'; import Theme from '../../theme/styles'; import Store from '../../store'; -import { showLoginPopover, hideLoginPopover } from '../../actions'; +import { showLoginPopover, hideLoginPopover, showConnectingLoginPopover } from '../../actions'; import loggedOutLogo from '../../assets/logged-out-logo.png'; import twitterBird from '../../assets/twitter-bird.png'; import modalCross from '../../assets/modal-cross-icon.png'; +import ReduxGetter from "../../services/ReduxGetters"; import multipleClickHandler from '../../services/MultipleClickHandler'; import InAppBrowser from '../../services/InAppBrowser'; import { WEB_ROOT } from '../../constants/index'; @@ -21,9 +22,12 @@ import('../../services/TwitterAuthService').then((imports) => { TwitterAuthService = imports.default; }); -const mapStateToProps = ({ login_popover }) => ({ - show: login_popover.show -}); +const mapStateToProps = ({ login_popover }) => { + return { + show: login_popover.show, + isTwitterConnecting: login_popover.isTwitterConnecting + } +}; const btnPreText = 'Connect with Twitter'; const btnPostText = 'Connecting...'; @@ -32,39 +36,43 @@ class loginPopover extends React.Component { constructor(props) { super(props); this.state = { - disableLoginBtn: false, - btnText: btnPreText + disableLoginBtn: false }; - this.isTwitterConnecting = false; } componentWillUnmount() { this.state.disableLoginBtn = false; - this.state.btnText = btnPreText; - this.isTwitterConnecting = false; + } componentDidUpdate(prevProps) { - if (this.props.show && this.props.show !== prevProps.show) { - this.setState({ disableLoginBtn: false, btnText: btnPreText }); - this.isTwitterConnecting = false; + if ( this.props.isTwitterConnecting && this.props.isTwitterConnecting !== prevProps.isTwitterConnecting ) { + this.setState({ disableLoginBtn: true }); + } else if (this.props.show && this.props.show !== prevProps.show) { + this.setState({ disableLoginBtn: false }); } } onSignUp = () => { - this.setState({ disableLoginBtn: true, btnText: btnPostText }); - this.isTwitterConnecting = true; + this.setState({ disableLoginBtn: true }); TwitterAuthService.signUp(); }; //Use this function if needed to handle hardware back handling for android. closeModal = () => { - if (!this.isTwitterConnecting) { + if (!this.props.isTwitterConnecting) { Store.dispatch(hideLoginPopover()); } return true; }; + getConnectBtnText = () => { + if ( this.props.isTwitterConnecting || this.state.disableLoginBtn) { + return btnPostText; + } + return btnPreText; + } + render() { return ( @@ -75,7 +83,6 @@ class loginPopover extends React.Component { visible={this.props.show} coverScreen={false} hasBackdrop={true} - onRequestClose={() => console.log('onRequestClose')} > @@ -132,7 +139,7 @@ class loginPopover extends React.Component { this.state.disableLoginBtn ? Theme.Button.disabled : null ]} TextStyles={[Theme.Button.btnPinkText, { fontSize: 18 }]} - text={this.state.btnText} + text={this.getConnectBtnText()} onPress={this.onSignUp} source={twitterBird} imgDimension={{ width: 28, height: 22.5, marginRight: 8 }} @@ -170,11 +177,21 @@ class loginPopover extends React.Component { export const LoginPopover = connect(mapStateToProps)(loginPopover); export const LoginPopoverActions = { + _track: () => { + let analyticsAction = AppConfig.routesAnalyticsMap.TwitterLogin; + firebase.analytics().setCurrentScreen(analyticsAction, analyticsAction); + }, show: () => { Store.dispatch(showLoginPopover()); - let analyticsAction = AppConfig.routesAnalyticsMap.TwitterLogin; - console.log('firebase.analytics().setCurrentScreen() ::', analyticsAction); - firebase.analytics().setCurrentScreen(analyticsAction, analyticsAction); + LoginPopoverActions._track(); + }, + showConnecting: () => { + let loginPopoverProps = ReduxGetter.getLoginPopOverProps(); + if ( !loginPopoverProps || !loginPopoverProps.show ) { + //Track. + LoginPopoverActions._track(); + } + Store.dispatch(showConnectingLoginPopover()); }, hide: () => { Store.dispatch(hideLoginPopover()); diff --git a/src/reducers/index.js b/src/reducers/index.js index 459b8495..535e6543 100644 --- a/src/reducers/index.js +++ b/src/reducers/index.js @@ -10,6 +10,7 @@ export const { hideModalCover, showLoginPopover, hideLoginPopover, + showConnectingLoginPopover, showToast, hideToast, upsertUserEntities, @@ -125,10 +126,14 @@ export const reducer = handleActions( { [showModal]: (state, action) => ({ ...state, modal: action.payload.modal }), [showModalCover]: (state, action) => ({ ...state, modal_cover: action.payload.modal_cover }), + [showLoginPopover]: (state, action) => ({ ...state, login_popover: action.payload.login_popover }), + [showConnectingLoginPopover]: (state, action) => ({ ...state, login_popover: action.payload.login_popover }), + [hideLoginPopover]: (state, action) => ({ ...state, login_popover: action.payload.login_popover }), + [hideModal]: (state, action) => ({ ...state, modal: action.payload.modal }), [hideModalCover]: (state, action) => ({ ...state, modal_cover: action.payload.modal_cover }), - [hideLoginPopover]: (state, action) => ({ ...state, login_popover: action.payload.login_popover }), + [showToast]: (state, action) => ({ ...state, toast: action.payload.toast }), [hideToast]: (state, action) => ({ ...state, toast: action.payload.toast }), [upsertUserEntities]: (state, action) => ({ diff --git a/src/services/ReduxGetters.js b/src/services/ReduxGetters.js index fb76e18b..fced8b06 100644 --- a/src/services/ReduxGetters.js +++ b/src/services/ReduxGetters.js @@ -531,6 +531,11 @@ class ReduxGetters { return deepGet(state, `reply_detail_entities.id_${id}.creator_user_id`); } + getLoginPopOverProps(state) { + state = state || Store.getState(); + return deepGet(state, `login_popover`); + } + } export default new ReduxGetters(); diff --git a/src/services/TwitterAuthService.js b/src/services/TwitterAuthService.js index dde3dd2f..1cb1a96f 100644 --- a/src/services/TwitterAuthService.js +++ b/src/services/TwitterAuthService.js @@ -1,5 +1,5 @@ import deepGet from 'lodash/get'; - +import ReduxGetter from "./ReduxGetters"; import Toast from '../theme/components/NotificationToast'; import { upsertInviteCode } from '../actions'; import Store from '../store'; @@ -29,6 +29,9 @@ class TwitterAuthService { signUp() { TwitterAuth.signIn() .then(async (params) => { + // Disable the Pop-Up. + LoginPopoverActions.showConnecting(); + if (params) { let inviteCode = await Utilities.getItem(AppConfig.appInstallInviteCodeASKey); if (inviteCode) { @@ -50,7 +53,6 @@ class TwitterAuthService { }); } else { LoginPopoverActions.hide(); - console.log('No user data!'); } }) .catch((error) => { From 0cb7dddd08000db18f4f9a935691894debc89372 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Mon, 25 Nov 2019 16:47:22 +0530 Subject: [PATCH 152/302] fixes --- src/components/CommonComponents/BottomReplyBar/index.js | 1 + src/services/ReduxGetters.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/CommonComponents/BottomReplyBar/index.js b/src/components/CommonComponents/BottomReplyBar/index.js index ac286ebb..bc932db3 100644 --- a/src/components/CommonComponents/BottomReplyBar/index.js +++ b/src/components/CommonComponents/BottomReplyBar/index.js @@ -15,6 +15,7 @@ class BottomReplyBar extends PureComponent { } replyVideo =( ) => { + if(!this.props.videoId || !this.props.userId) return; if( replyPreValidationAndMessage( this.props.videoId , this.props.userId) ) { navigateToCamera( this.props.videoId , this.props.userId , this.props.navigation ) ; } diff --git a/src/services/ReduxGetters.js b/src/services/ReduxGetters.js index fb76e18b..5019a752 100644 --- a/src/services/ReduxGetters.js +++ b/src/services/ReduxGetters.js @@ -528,7 +528,8 @@ class ReduxGetters { getReplyParentUserId(id , state){ state = state || Store.getState(); - return deepGet(state, `reply_detail_entities.id_${id}.creator_user_id`); + let parentId = deepGet(state, `reply_detail_entities.id_${id}.parent_id`); + return deepGet(state, `video_stat_entities.id_${parentId}.creator_user_id`); } } From b46185cc96825e603c6ef234f785fd94bd6126be Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Mon, 25 Nov 2019 17:28:41 +0530 Subject: [PATCH 153/302] fixes --- package-lock.json | 889 +++++++++--------- .../InvertedReplyThumbnailList/index.js | 20 +- 2 files changed, 458 insertions(+), 451 deletions(-) diff --git a/package-lock.json b/package-lock.json index 59699d96..105c9edf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,11 +35,11 @@ } }, "@babel/generator": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.2.tgz", - "integrity": "sha512-WthSArvAjYLz4TcbKOi88me+KmDJdKSlfwwN8CnUYn9jBkzhq0ZEPuBfkAWIvjJ3AdEV1Cf/+eSQTnp3IDJKlQ==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.4.tgz", + "integrity": "sha512-m5qo2WgdOJeyYngKImbkyQrnUN1mPceaG5BV+G0E3gWsa4l/jCSryWJdM2x8OuGAOyh+3d5pVYfZWCiNFtynxg==", "requires": { - "@babel/types": "^7.7.2", + "@babel/types": "^7.7.4", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.5.0" @@ -53,70 +53,70 @@ } }, "@babel/helper-annotate-as-pure": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.7.0.tgz", - "integrity": "sha512-k50CQxMlYTYo+GGyUGFwpxKVtxVJi9yh61sXZji3zYHccK9RYliZGSTOgci85T+r+0VFN2nWbGM04PIqwfrpMg==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.7.4.tgz", + "integrity": "sha512-2BQmQgECKzYKFPpiycoF9tlb5HA4lrVyAmLLVK177EcQAqjVLciUb2/R+n1boQ9y5ENV3uz2ZqiNw7QMBBw1Og==", "requires": { - "@babel/types": "^7.7.0" + "@babel/types": "^7.7.4" } }, "@babel/helper-builder-binary-assignment-operator-visitor": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.7.0.tgz", - "integrity": "sha512-Cd8r8zs4RKDwMG/92lpZcnn5WPQ3LAMQbCw42oqUh4s7vsSN5ANUZjMel0OOnxDLq57hoDDbai+ryygYfCTOsw==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.7.4.tgz", + "integrity": "sha512-Biq/d/WtvfftWZ9Uf39hbPBYDUo986m5Bb4zhkeYDGUllF43D+nUe5M6Vuo6/8JDK/0YX/uBdeoQpyaNhNugZQ==", "requires": { - "@babel/helper-explode-assignable-expression": "^7.7.0", - "@babel/types": "^7.7.0" + "@babel/helper-explode-assignable-expression": "^7.7.4", + "@babel/types": "^7.7.4" } }, "@babel/helper-builder-react-jsx": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-react-jsx/-/helper-builder-react-jsx-7.7.0.tgz", - "integrity": "sha512-LSln3cexwInTMYYoFeVLKnYPPMfWNJ8PubTBs3hkh7wCu9iBaqq1OOyW+xGmEdLxT1nhsl+9SJ+h2oUDYz0l2A==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-react-jsx/-/helper-builder-react-jsx-7.7.4.tgz", + "integrity": "sha512-kvbfHJNN9dg4rkEM4xn1s8d1/h6TYNvajy9L1wx4qLn9HFg0IkTsQi4rfBe92nxrPUFcMsHoMV+8rU7MJb3fCA==", "requires": { - "@babel/types": "^7.7.0", + "@babel/types": "^7.7.4", "esutils": "^2.0.0" } }, "@babel/helper-call-delegate": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/helper-call-delegate/-/helper-call-delegate-7.7.0.tgz", - "integrity": "sha512-Su0Mdq7uSSWGZayGMMQ+z6lnL00mMCnGAbO/R0ZO9odIdB/WNU/VfQKqMQU0fdIsxQYbRjDM4BixIa93SQIpvw==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-call-delegate/-/helper-call-delegate-7.7.4.tgz", + "integrity": "sha512-8JH9/B7J7tCYJ2PpWVpw9JhPuEVHztagNVuQAFBVFYluRMlpG7F1CgKEgGeL6KFqcsIa92ZYVj6DSc0XwmN1ZA==", "requires": { - "@babel/helper-hoist-variables": "^7.7.0", - "@babel/traverse": "^7.7.0", - "@babel/types": "^7.7.0" + "@babel/helper-hoist-variables": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4" } }, "@babel/helper-create-class-features-plugin": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.7.0.tgz", - "integrity": "sha512-MZiB5qvTWoyiFOgootmRSDV1udjIqJW/8lmxgzKq6oDqxdmHUjeP2ZUOmgHdYjmUVNABqRrHjYAYRvj8Eox/UA==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.7.4.tgz", + "integrity": "sha512-l+OnKACG4uiDHQ/aJT8dwpR+LhCJALxL0mJ6nzjB25e5IPwqV1VOsY7ah6UB1DG+VOXAIMtuC54rFJGiHkxjgA==", "requires": { - "@babel/helper-function-name": "^7.7.0", - "@babel/helper-member-expression-to-functions": "^7.7.0", - "@babel/helper-optimise-call-expression": "^7.7.0", + "@babel/helper-function-name": "^7.7.4", + "@babel/helper-member-expression-to-functions": "^7.7.4", + "@babel/helper-optimise-call-expression": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-replace-supers": "^7.7.0", - "@babel/helper-split-export-declaration": "^7.7.0" + "@babel/helper-replace-supers": "^7.7.4", + "@babel/helper-split-export-declaration": "^7.7.4" } }, "@babel/helper-create-regexp-features-plugin": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.7.2.tgz", - "integrity": "sha512-pAil/ZixjTlrzNpjx+l/C/wJk002Wo7XbbZ8oujH/AoJ3Juv0iN/UTcPUHXKMFLqsfS0Hy6Aow8M31brUYBlQQ==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.7.4.tgz", + "integrity": "sha512-Mt+jBKaxL0zfOIWrfQpnfYCN7/rS6GKx6CCCfuoqVVd+17R8zNDlzVYmIi9qyb2wOk002NsmSTDymkIygDUH7A==", "requires": { "@babel/helper-regex": "^7.4.4", "regexpu-core": "^4.6.0" } }, "@babel/helper-define-map": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.7.0.tgz", - "integrity": "sha512-kPKWPb0dMpZi+ov1hJiwse9dWweZsz3V9rP4KdytnX1E7z3cTNmFGglwklzFPuqIcHLIY3bgKSs4vkwXXdflQA==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.7.4.tgz", + "integrity": "sha512-v5LorqOa0nVQUvAUTUF3KPastvUt/HzByXNamKQ6RdJRTV7j8rLL+WB5C/MzzWAwOomxDhYFb1wLLxHqox86lg==", "requires": { - "@babel/helper-function-name": "^7.7.0", - "@babel/types": "^7.7.0", + "@babel/helper-function-name": "^7.7.4", + "@babel/types": "^7.7.4", "lodash": "^4.17.13" }, "dependencies": { @@ -128,66 +128,66 @@ } }, "@babel/helper-explode-assignable-expression": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.7.0.tgz", - "integrity": "sha512-CDs26w2shdD1urNUAji2RJXyBFCaR+iBEGnFz3l7maizMkQe3saVw9WtjG1tz8CwbjvlFnaSLVhgnu1SWaherg==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.7.4.tgz", + "integrity": "sha512-2/SicuFrNSXsZNBxe5UGdLr+HZg+raWBLE9vC98bdYOKX/U6PY0mdGlYUJdtTDPSU0Lw0PNbKKDpwYHJLn2jLg==", "requires": { - "@babel/traverse": "^7.7.0", - "@babel/types": "^7.7.0" + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4" } }, "@babel/helper-function-name": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.0.tgz", - "integrity": "sha512-tDsJgMUAP00Ugv8O2aGEua5I2apkaQO7lBGUq1ocwN3G23JE5Dcq0uh3GvFTChPa4b40AWiAsLvCZOA2rdnQ7Q==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.4.tgz", + "integrity": "sha512-AnkGIdiBhEuiwdoMnKm7jfPfqItZhgRaZfMg1XX3bS25INOnLPjPG1Ppnajh8eqgt5kPJnfqrRHqFqmjKDZLzQ==", "requires": { - "@babel/helper-get-function-arity": "^7.7.0", - "@babel/template": "^7.7.0", - "@babel/types": "^7.7.0" + "@babel/helper-get-function-arity": "^7.7.4", + "@babel/template": "^7.7.4", + "@babel/types": "^7.7.4" } }, "@babel/helper-get-function-arity": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.0.tgz", - "integrity": "sha512-tLdojOTz4vWcEnHWHCuPN5P85JLZWbm5Fx5ZsMEMPhF3Uoe3O7awrbM2nQ04bDOUToH/2tH/ezKEOR8zEYzqyw==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.4.tgz", + "integrity": "sha512-QTGKEdCkjgzgfJ3bAyRwF4yyT3pg+vDgan8DSivq1eS0gwi+KGKE5x8kRcbeFTb/673mkO5SN1IZfmCfA5o+EA==", "requires": { - "@babel/types": "^7.7.0" + "@babel/types": "^7.7.4" } }, "@babel/helper-hoist-variables": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.7.0.tgz", - "integrity": "sha512-LUe/92NqsDAkJjjCEWkNe+/PcpnisvnqdlRe19FahVapa4jndeuJ+FBiTX1rcAKWKcJGE+C3Q3tuEuxkSmCEiQ==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.7.4.tgz", + "integrity": "sha512-wQC4xyvc1Jo/FnLirL6CEgPgPCa8M74tOdjWpRhQYapz5JC7u3NYU1zCVoVAGCE3EaIP9T1A3iW0WLJ+reZlpQ==", "requires": { - "@babel/types": "^7.7.0" + "@babel/types": "^7.7.4" } }, "@babel/helper-member-expression-to-functions": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.7.0.tgz", - "integrity": "sha512-QaCZLO2RtBcmvO/ekOLp8p7R5X2JriKRizeDpm5ChATAFWrrYDcDxPuCIBXKyBjY+i1vYSdcUTMIb8psfxHDPA==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.7.4.tgz", + "integrity": "sha512-9KcA1X2E3OjXl/ykfMMInBK+uVdfIVakVe7W7Lg3wfXUNyS3Q1HWLFRwZIjhqiCGbslummPDnmb7vIekS0C1vw==", "requires": { - "@babel/types": "^7.7.0" + "@babel/types": "^7.7.4" } }, "@babel/helper-module-imports": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.7.0.tgz", - "integrity": "sha512-Dv3hLKIC1jyfTkClvyEkYP2OlkzNvWs5+Q8WgPbxM5LMeorons7iPP91JM+DU7tRbhqA1ZeooPaMFvQrn23RHw==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.7.4.tgz", + "integrity": "sha512-dGcrX6K9l8258WFjyDLJwuVKxR4XZfU0/vTUgOQYWEnRD8mgr+p4d6fCUMq/ys0h4CCt/S5JhbvtyErjWouAUQ==", "requires": { - "@babel/types": "^7.7.0" + "@babel/types": "^7.7.4" } }, "@babel/helper-module-transforms": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.7.0.tgz", - "integrity": "sha512-rXEefBuheUYQyX4WjV19tuknrJFwyKw0HgzRwbkyTbB+Dshlq7eqkWbyjzToLrMZk/5wKVKdWFluiAsVkHXvuQ==", - "requires": { - "@babel/helper-module-imports": "^7.7.0", - "@babel/helper-simple-access": "^7.7.0", - "@babel/helper-split-export-declaration": "^7.7.0", - "@babel/template": "^7.7.0", - "@babel/types": "^7.7.0", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.7.4.tgz", + "integrity": "sha512-ehGBu4mXrhs0FxAqN8tWkzF8GSIGAiEumu4ONZ/hD9M88uHcD+Yu2ttKfOCgwzoesJOJrtQh7trI5YPbRtMmnA==", + "requires": { + "@babel/helper-module-imports": "^7.7.4", + "@babel/helper-simple-access": "^7.7.4", + "@babel/helper-split-export-declaration": "^7.7.4", + "@babel/template": "^7.7.4", + "@babel/types": "^7.7.4", "lodash": "^4.17.13" }, "dependencies": { @@ -199,11 +199,11 @@ } }, "@babel/helper-optimise-call-expression": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.7.0.tgz", - "integrity": "sha512-48TeqmbazjNU/65niiiJIJRc5JozB8acui1OS7bSd6PgxfuovWsvjfWSzlgx+gPFdVveNzUdpdIg5l56Pl5jqg==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.7.4.tgz", + "integrity": "sha512-VB7gWZ2fDkSuqW6b1AKXkJWO5NyNI3bFL/kK79/30moK57blr6NbH8xcl2XcKCwOmJosftWunZqfO84IGq3ZZg==", "requires": { - "@babel/types": "^7.7.0" + "@babel/types": "^7.7.4" } }, "@babel/helper-plugin-utils": { @@ -227,64 +227,64 @@ } }, "@babel/helper-remap-async-to-generator": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.7.0.tgz", - "integrity": "sha512-pHx7RN8X0UNHPB/fnuDnRXVZ316ZigkO8y8D835JlZ2SSdFKb6yH9MIYRU4fy/KPe5sPHDFOPvf8QLdbAGGiyw==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.7.4.tgz", + "integrity": "sha512-Sk4xmtVdM9sA/jCI80f+KS+Md+ZHIpjuqmYPk1M7F/upHou5e4ReYmExAiu6PVe65BhJPZA2CY9x9k4BqE5klw==", "requires": { - "@babel/helper-annotate-as-pure": "^7.7.0", - "@babel/helper-wrap-function": "^7.7.0", - "@babel/template": "^7.7.0", - "@babel/traverse": "^7.7.0", - "@babel/types": "^7.7.0" + "@babel/helper-annotate-as-pure": "^7.7.4", + "@babel/helper-wrap-function": "^7.7.4", + "@babel/template": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4" } }, "@babel/helper-replace-supers": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.7.0.tgz", - "integrity": "sha512-5ALYEul5V8xNdxEeWvRsBzLMxQksT7MaStpxjJf9KsnLxpAKBtfw5NeMKZJSYDa0lKdOcy0g+JT/f5mPSulUgg==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.7.4.tgz", + "integrity": "sha512-pP0tfgg9hsZWo5ZboYGuBn/bbYT/hdLPVSS4NMmiRJdwWhP0IznPwN9AE1JwyGsjSPLC364I0Qh5p+EPkGPNpg==", "requires": { - "@babel/helper-member-expression-to-functions": "^7.7.0", - "@babel/helper-optimise-call-expression": "^7.7.0", - "@babel/traverse": "^7.7.0", - "@babel/types": "^7.7.0" + "@babel/helper-member-expression-to-functions": "^7.7.4", + "@babel/helper-optimise-call-expression": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4" } }, "@babel/helper-simple-access": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.7.0.tgz", - "integrity": "sha512-AJ7IZD7Eem3zZRuj5JtzFAptBw7pMlS3y8Qv09vaBWoFsle0d1kAn5Wq6Q9MyBXITPOKnxwkZKoAm4bopmv26g==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.7.4.tgz", + "integrity": "sha512-zK7THeEXfan7UlWsG2A6CI/L9jVnI5+xxKZOdej39Y0YtDYKx9raHk5F2EtK9K8DHRTihYwg20ADt9S36GR78A==", "requires": { - "@babel/template": "^7.7.0", - "@babel/types": "^7.7.0" + "@babel/template": "^7.7.4", + "@babel/types": "^7.7.4" } }, "@babel/helper-split-export-declaration": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.0.tgz", - "integrity": "sha512-HgYSI8rH08neWlAH3CcdkFg9qX9YsZysZI5GD8LjhQib/mM0jGOZOVkoUiiV2Hu978fRtjtsGsW6w0pKHUWtqA==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.4.tgz", + "integrity": "sha512-guAg1SXFcVr04Guk9eq0S4/rWS++sbmyqosJzVs8+1fH5NI+ZcmkaSkc7dmtAFbHFva6yRJnjW3yAcGxjueDug==", "requires": { - "@babel/types": "^7.7.0" + "@babel/types": "^7.7.4" } }, "@babel/helper-wrap-function": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.7.0.tgz", - "integrity": "sha512-sd4QjeMgQqzshSjecZjOp8uKfUtnpmCyQhKQrVJBBgeHAB/0FPi33h3AbVlVp07qQtMD4QgYSzaMI7VwncNK/w==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.7.4.tgz", + "integrity": "sha512-VsfzZt6wmsocOaVU0OokwrIytHND55yvyT4BPB9AIIgwr8+x7617hetdJTsuGwygN5RC6mxA9EJztTjuwm2ofg==", "requires": { - "@babel/helper-function-name": "^7.7.0", - "@babel/template": "^7.7.0", - "@babel/traverse": "^7.7.0", - "@babel/types": "^7.7.0" + "@babel/helper-function-name": "^7.7.4", + "@babel/template": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4" } }, "@babel/helpers": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.7.0.tgz", - "integrity": "sha512-VnNwL4YOhbejHb7x/b5F39Zdg5vIQpUUNzJwx0ww1EcVRt41bbGRZWhAURrfY32T5zTT3qwNOQFWpn+P0i0a2g==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.7.4.tgz", + "integrity": "sha512-ak5NGZGJ6LV85Q1Zc9gn2n+ayXOizryhjSUBTdu5ih1tlVCJeuQENzc4ItyCVhINVXvIT/ZQ4mheGIsfBkpskg==", "requires": { - "@babel/template": "^7.7.0", - "@babel/traverse": "^7.7.0", - "@babel/types": "^7.7.0" + "@babel/template": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4" } }, "@babel/highlight": { @@ -298,182 +298,182 @@ } }, "@babel/parser": { - "version": "7.7.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.3.tgz", - "integrity": "sha512-bqv+iCo9i+uLVbI0ILzKkvMorqxouI+GbV13ivcARXn9NNEabi2IEz912IgNpT/60BNXac5dgcfjb94NjsF33A==" + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.4.tgz", + "integrity": "sha512-jIwvLO0zCL+O/LmEJQjWA75MQTWwx3c3u2JOTDK5D3/9egrWRRA0/0hk9XXywYnXZVVpzrBYeIQTmhwUaePI9g==" }, "@babel/plugin-external-helpers": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-external-helpers/-/plugin-external-helpers-7.2.0.tgz", - "integrity": "sha512-QFmtcCShFkyAsNtdCM3lJPmRe1iB+vPZymlB4LnDIKEBj2yKQLQKtoxXxJ8ePT5fwMl4QGg303p4mB0UsSI2/g==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-external-helpers/-/plugin-external-helpers-7.7.4.tgz", + "integrity": "sha512-RVGNajLaFlknbZLutaP/uv7Q+xmVs2LMlEWFXbcjLnwtBdPqAVpV3nzYIAJqri/VjJCUrhG5nALijtg0aND+XA==", "requires": { "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-proposal-class-properties": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.7.0.tgz", - "integrity": "sha512-tufDcFA1Vj+eWvwHN+jvMN6QsV5o+vUlytNKrbMiCeDL0F2j92RURzUsUMWE5EJkLyWxjdUslCsMQa9FWth16A==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.7.4.tgz", + "integrity": "sha512-EcuXeV4Hv1X3+Q1TsuOmyyxeTRiSqurGJ26+I/FW1WbymmRRapVORm6x1Zl3iDIHyRxEs+VXWp6qnlcfcJSbbw==", "requires": { - "@babel/helper-create-class-features-plugin": "^7.7.0", + "@babel/helper-create-class-features-plugin": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-proposal-export-default-from": { - "version": "7.5.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-default-from/-/plugin-proposal-export-default-from-7.5.2.tgz", - "integrity": "sha512-wr9Itk05L1/wyyZKVEmXWCdcsp/e185WUNl6AfYZeEKYaUPPvHXRDqO5K1VH7/UamYqGJowFRuCv30aDYZawsg==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-default-from/-/plugin-proposal-export-default-from-7.7.4.tgz", + "integrity": "sha512-1t6dh7BHYUz4zD1m4pozYYEZy/3m8dgOr9owx3r0mPPI3iGKRUKUbIxfYmcJ4hwljs/dhd0qOTr1ZDUp43ix+w==", "requires": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-export-default-from": "^7.2.0" + "@babel/plugin-syntax-export-default-from": "^7.7.4" } }, "@babel/plugin-proposal-nullish-coalescing-operator": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.4.4.tgz", - "integrity": "sha512-Amph7Epui1Dh/xxUxS2+K22/MUi6+6JVTvy3P58tja3B6yKTSjwwx0/d83rF7551D6PVSSoplQb8GCwqec7HRw==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.7.4.tgz", + "integrity": "sha512-TbYHmr1Gl1UC7Vo2HVuj/Naci5BEGNZ0AJhzqD2Vpr6QPFWpUmBRLrIDjedzx7/CShq0bRDS2gI4FIs77VHLVQ==", "requires": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.2.0" + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.7.4" } }, "@babel/plugin-proposal-object-rest-spread": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.6.2.tgz", - "integrity": "sha512-LDBXlmADCsMZV1Y9OQwMc0MyGZ8Ta/zlD9N67BfQT8uYwkRswiu2hU6nJKrjrt/58aH/vqfQlR/9yId/7A2gWw==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.7.4.tgz", + "integrity": "sha512-rnpnZR3/iWKmiQyJ3LKJpSwLDcX/nSXhdLk4Aq/tXOApIvyu7qoabrige0ylsAJffaUC51WiBu209Q0U+86OWQ==", "requires": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-object-rest-spread": "^7.2.0" + "@babel/plugin-syntax-object-rest-spread": "^7.7.4" } }, "@babel/plugin-proposal-optional-catch-binding": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.2.0.tgz", - "integrity": "sha512-mgYj3jCcxug6KUcX4OBoOJz3CMrwRfQELPQ5560F70YQUBZB7uac9fqaWamKR1iWUzGiK2t0ygzjTScZnVz75g==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.7.4.tgz", + "integrity": "sha512-DyM7U2bnsQerCQ+sejcTNZh8KQEUuC3ufzdnVnSiUv/qoGJp2Z3hanKL18KDhsBT5Wj6a7CMT5mdyCNJsEaA9w==", "requires": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-optional-catch-binding": "^7.2.0" + "@babel/plugin-syntax-optional-catch-binding": "^7.7.4" } }, "@babel/plugin-proposal-optional-chaining": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.6.0.tgz", - "integrity": "sha512-kj4gkZ6qUggkprRq3Uh5KP8XnE1MdIO0J7MhdDX8+rAbB6dJ2UrensGIS+0NPZAaaJ1Vr0PN6oLUgXMU1uMcSg==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.7.4.tgz", + "integrity": "sha512-JmgaS+ygAWDR/STPe3/7y0lNlHgS+19qZ9aC06nYLwQ/XB7c0q5Xs+ksFU3EDnp9EiEsO0dnRAOKeyLHTZuW3A==", "requires": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-optional-chaining": "^7.2.0" + "@babel/plugin-syntax-optional-chaining": "^7.7.4" } }, "@babel/plugin-syntax-class-properties": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.2.0.tgz", - "integrity": "sha512-UxYaGXYQ7rrKJS/PxIKRkv3exi05oH7rokBAsmCSsCxz1sVPZ7Fu6FzKoGgUvmY+0YgSkYHgUoCh5R5bCNBQlw==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.7.4.tgz", + "integrity": "sha512-JH3v5ZOeKT0qqdJ9BeBcZTFQiJOMax8RopSr1bH6ASkZKo2qWsvBML7W1mp89sszBRDBBRO8snqcByGdrMTdMg==", "requires": { "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-syntax-dynamic-import": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.2.0.tgz", - "integrity": "sha512-mVxuJ0YroI/h/tbFTPGZR8cv6ai+STMKNBq0f8hFxsxWjl94qqhsb+wXbpNMDPU3cfR1TIsVFzU3nXyZMqyK4w==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.7.4.tgz", + "integrity": "sha512-jHQW0vbRGvwQNgyVxwDh4yuXu4bH1f5/EICJLAhl1SblLs2CDhrsmCk+v5XLdE9wxtAFRyxx+P//Iw+a5L/tTg==", "requires": { "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-syntax-export-default-from": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-default-from/-/plugin-syntax-export-default-from-7.2.0.tgz", - "integrity": "sha512-c7nqUnNST97BWPtoe+Ssi+fJukc9P9/JMZ71IOMNQWza2E+Psrd46N6AEvtw6pqK+gt7ChjXyrw4SPDO79f3Lw==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-default-from/-/plugin-syntax-export-default-from-7.7.4.tgz", + "integrity": "sha512-j888jpjATLEzOWhKawq46UrpXnCRDbdhBd5io4jgwjJ3+CHHGCRb6PNAVEgs+BXIb+dNRAmnkv36zfB992PRVw==", "requires": { "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-syntax-flow": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.7.0.tgz", - "integrity": "sha512-vQMV07p+L+jZeUnvX3pEJ9EiXGCjB5CTTvsirFD9rpEuATnoAvLBLoYbw1v5tyn3d2XxSuvEKi8cV3KqYUa0vQ==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.7.4.tgz", + "integrity": "sha512-2AMAWl5PsmM5KPkB22cvOkUyWk6MjUaqhHNU5nSPUl/ns3j5qLfw2SuYP5RbVZ0tfLvePr4zUScbICtDP2CUNw==", "requires": { "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-syntax-jsx": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.2.0.tgz", - "integrity": "sha512-VyN4QANJkRW6lDBmENzRszvZf3/4AXaj9YR7GwrWeeN9tEBPuXbmDYVU9bYBN0D70zCWVwUy0HWq2553VCb6Hw==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.7.4.tgz", + "integrity": "sha512-wuy6fiMe9y7HeZBWXYCGt2RGxZOj0BImZ9EyXJVnVGBKO/Br592rbR3rtIQn0eQhAk9vqaKP5n8tVqEFBQMfLg==", "requires": { "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-syntax-nullish-coalescing-operator": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.2.0.tgz", - "integrity": "sha512-lRCEaKE+LTxDQtgbYajI04ddt6WW0WJq57xqkAZ+s11h4YgfRHhVA/Y2VhfPzzFD4qeLHWg32DMp9HooY4Kqlg==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.7.4.tgz", + "integrity": "sha512-XKh/yIRPiQTOeBg0QJjEus5qiSKucKAiApNtO1psqG7D17xmE+X2i5ZqBEuSvo0HRuyPaKaSN/Gy+Ha9KFQolw==", "requires": { "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-syntax-object-rest-spread": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz", - "integrity": "sha512-t0JKGgqk2We+9may3t0xDdmneaXmyxq0xieYcKHxIsrJO64n1OiMWNUtc5gQK1PA0NpdCRrtZp4z+IUaKugrSA==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.7.4.tgz", + "integrity": "sha512-mObR+r+KZq0XhRVS2BrBKBpr5jqrqzlPvS9C9vuOf5ilSwzloAl7RPWLrgKdWS6IreaVrjHxTjtyqFiOisaCwg==", "requires": { "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-syntax-optional-catch-binding": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.2.0.tgz", - "integrity": "sha512-bDe4xKNhb0LI7IvZHiA13kff0KEfaGX/Hv4lMA9+7TEc63hMNvfKo6ZFpXhKuEp+II/q35Gc4NoMeDZyaUbj9w==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.7.4.tgz", + "integrity": "sha512-4ZSuzWgFxqHRE31Glu+fEr/MirNZOMYmD/0BhBWyLyOOQz/gTAl7QmWm2hX1QxEIXsr2vkdlwxIzTyiYRC4xcQ==", "requires": { "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-syntax-optional-chaining": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.2.0.tgz", - "integrity": "sha512-HtGCtvp5Uq/jH/WNUPkK6b7rufnCPLLlDAFN7cmACoIjaOOiXxUt3SswU5loHqrhtqTsa/WoLQ1OQ1AGuZqaWA==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.7.4.tgz", + "integrity": "sha512-2MqYD5WjZSbJdUagnJvIdSfkb/ucOC9/1fRJxm7GAxY6YQLWlUvkfxoNbUPcPLHJyetKUDQ4+yyuUyAoc0HriA==", "requires": { "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-syntax-typescript": { - "version": "7.3.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.3.3.tgz", - "integrity": "sha512-dGwbSMA1YhVS8+31CnPR7LB4pcbrzcV99wQzby4uAfrkZPYZlQ7ImwdpzLqi6Z6IL02b8IAL379CaMwo0x5Lag==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.7.4.tgz", + "integrity": "sha512-77blgY18Hud4NM1ggTA8xVT/dBENQf17OpiToSa2jSmEY3fWXD2jwrdVlO4kq5yzUTeF15WSQ6b4fByNvJcjpQ==", "requires": { "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-transform-arrow-functions": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.2.0.tgz", - "integrity": "sha512-ER77Cax1+8/8jCB9fo4Ud161OZzWN5qawi4GusDuRLcDbDG+bIGYY20zb2dfAFdTRGzrfq2xZPvF0R64EHnimg==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.7.4.tgz", + "integrity": "sha512-zUXy3e8jBNPiffmqkHRNDdZM2r8DWhCB7HhcoyZjiK1TxYEluLHAvQuYnTT+ARqRpabWqy/NHkO6e3MsYB5YfA==", "requires": { "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-transform-async-to-generator": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.7.0.tgz", - "integrity": "sha512-vLI2EFLVvRBL3d8roAMqtVY0Bm9C1QzLkdS57hiKrjUBSqsQYrBsMCeOg/0KK7B0eK9V71J5mWcha9yyoI2tZw==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.7.4.tgz", + "integrity": "sha512-zpUTZphp5nHokuy8yLlyafxCJ0rSlFoSHypTUWgpdwoDXWQcseaect7cJ8Ppk6nunOM6+5rPMkod4OYKPR5MUg==", "requires": { - "@babel/helper-module-imports": "^7.7.0", + "@babel/helper-module-imports": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-remap-async-to-generator": "^7.7.0" + "@babel/helper-remap-async-to-generator": "^7.7.4" } }, "@babel/plugin-transform-block-scoped-functions": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.2.0.tgz", - "integrity": "sha512-ntQPR6q1/NKuphly49+QiQiTN0O63uOwjdD6dhIjSWBI5xlrbUFh720TIpzBhpnrLfv2tNH/BXvLIab1+BAI0w==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.7.4.tgz", + "integrity": "sha512-kqtQzwtKcpPclHYjLK//3lH8OFsCDuDJBaFhVwf8kqdnF6MN4l618UDlcA7TfRs3FayrHj+svYnSX8MC9zmUyQ==", "requires": { "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-transform-block-scoping": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.6.3.tgz", - "integrity": "sha512-7hvrg75dubcO3ZI2rjYTzUrEuh1E9IyDEhhB6qfcooxhDA33xx2MasuLVgdxzcP6R/lipAC6n9ub9maNW6RKdw==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.7.4.tgz", + "integrity": "sha512-2VBe9u0G+fDt9B5OV5DQH4KBf5DoiNkwFKOz0TCvBWvdAN2rOykCTkrL+jTLxfCAm76l9Qo5OqL7HBOx2dWggg==", "requires": { "@babel/helper-plugin-utils": "^7.0.0", "lodash": "^4.17.13" @@ -487,236 +487,236 @@ } }, "@babel/plugin-transform-classes": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.7.0.tgz", - "integrity": "sha512-/b3cKIZwGeUesZheU9jNYcwrEA7f/Bo4IdPmvp7oHgvks2majB5BoT5byAql44fiNQYOPzhk2w8DbgfuafkMoA==", - "requires": { - "@babel/helper-annotate-as-pure": "^7.7.0", - "@babel/helper-define-map": "^7.7.0", - "@babel/helper-function-name": "^7.7.0", - "@babel/helper-optimise-call-expression": "^7.7.0", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.7.4.tgz", + "integrity": "sha512-sK1mjWat7K+buWRuImEzjNf68qrKcrddtpQo3swi9j7dUcG6y6R6+Di039QN2bD1dykeswlagupEmpOatFHHUg==", + "requires": { + "@babel/helper-annotate-as-pure": "^7.7.4", + "@babel/helper-define-map": "^7.7.4", + "@babel/helper-function-name": "^7.7.4", + "@babel/helper-optimise-call-expression": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-replace-supers": "^7.7.0", - "@babel/helper-split-export-declaration": "^7.7.0", + "@babel/helper-replace-supers": "^7.7.4", + "@babel/helper-split-export-declaration": "^7.7.4", "globals": "^11.1.0" } }, "@babel/plugin-transform-computed-properties": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.2.0.tgz", - "integrity": "sha512-kP/drqTxY6Xt3NNpKiMomfgkNn4o7+vKxK2DDKcBG9sHj51vHqMBGy8wbDS/J4lMxnqs153/T3+DmCEAkC5cpA==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.7.4.tgz", + "integrity": "sha512-bSNsOsZnlpLLyQew35rl4Fma3yKWqK3ImWMSC/Nc+6nGjC9s5NFWAer1YQ899/6s9HxO2zQC1WoFNfkOqRkqRQ==", "requires": { "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-transform-destructuring": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.6.0.tgz", - "integrity": "sha512-2bGIS5P1v4+sWTCnKNDZDxbGvEqi0ijeqM/YqHtVGrvG2y0ySgnEEhXErvE9dA0bnIzY9bIzdFK0jFA46ASIIQ==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.7.4.tgz", + "integrity": "sha512-4jFMXI1Cu2aXbcXXl8Lr6YubCn6Oc7k9lLsu8v61TZh+1jny2BWmdtvY9zSUlLdGUvcy9DMAWyZEOqjsbeg/wA==", "requires": { "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-transform-exponentiation-operator": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.2.0.tgz", - "integrity": "sha512-umh4hR6N7mu4Elq9GG8TOu9M0bakvlsREEC+ialrQN6ABS4oDQ69qJv1VtR3uxlKMCQMCvzk7vr17RHKcjx68A==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.7.4.tgz", + "integrity": "sha512-MCqiLfCKm6KEA1dglf6Uqq1ElDIZwFuzz1WH5mTf8k2uQSxEJMbOIEh7IZv7uichr7PMfi5YVSrr1vz+ipp7AQ==", "requires": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.1.0", + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-transform-flow-strip-types": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.6.3.tgz", - "integrity": "sha512-l0ETkyEofkqFJ9LS6HChNIKtVJw2ylKbhYMlJ5C6df+ldxxaLIyXY4yOdDQQspfFpV8/vDiaWoJlvflstlYNxg==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.7.4.tgz", + "integrity": "sha512-w9dRNlHY5ElNimyMYy0oQowvQpwt/PRHI0QS98ZJCTZU2bvSnKXo5zEiD5u76FBPigTm8TkqzmnUTg16T7qbkA==", "requires": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-flow": "^7.2.0" + "@babel/plugin-syntax-flow": "^7.7.4" } }, "@babel/plugin-transform-for-of": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.4.4.tgz", - "integrity": "sha512-9T/5Dlr14Z9TIEXLXkt8T1DU7F24cbhwhMNUziN3hB1AXoZcdzPcTiKGRn/6iOymDqtTKWnr/BtRKN9JwbKtdQ==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.7.4.tgz", + "integrity": "sha512-zZ1fD1B8keYtEcKF+M1TROfeHTKnijcVQm0yO/Yu1f7qoDoxEIc/+GX6Go430Bg84eM/xwPFp0+h4EbZg7epAA==", "requires": { "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-transform-function-name": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.7.0.tgz", - "integrity": "sha512-P5HKu0d9+CzZxP5jcrWdpe7ZlFDe24bmqP6a6X8BHEBl/eizAsY8K6LX8LASZL0Jxdjm5eEfzp+FIrxCm/p8bA==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.7.4.tgz", + "integrity": "sha512-E/x09TvjHNhsULs2IusN+aJNRV5zKwxu1cpirZyRPw+FyyIKEHPXTsadj48bVpc1R5Qq1B5ZkzumuFLytnbT6g==", "requires": { - "@babel/helper-function-name": "^7.7.0", + "@babel/helper-function-name": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-transform-literals": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.2.0.tgz", - "integrity": "sha512-2ThDhm4lI4oV7fVQ6pNNK+sx+c/GM5/SaML0w/r4ZB7sAneD/piDJtwdKlNckXeyGK7wlwg2E2w33C/Hh+VFCg==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.7.4.tgz", + "integrity": "sha512-X2MSV7LfJFm4aZfxd0yLVFrEXAgPqYoDG53Br/tCKiKYfX0MjVjQeWPIhPHHsCqzwQANq+FLN786fF5rgLS+gw==", "requires": { "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-transform-member-expression-literals": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.2.0.tgz", - "integrity": "sha512-HiU3zKkSU6scTidmnFJ0bMX8hz5ixC93b4MHMiYebmk2lUVNGOboPsqQvx5LzooihijUoLR/v7Nc1rbBtnc7FA==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.7.4.tgz", + "integrity": "sha512-9VMwMO7i69LHTesL0RdGy93JU6a+qOPuvB4F4d0kR0zyVjJRVJRaoaGjhtki6SzQUu8yen/vxPKN6CWnCUw6bA==", "requires": { "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-transform-modules-commonjs": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.7.0.tgz", - "integrity": "sha512-KEMyWNNWnjOom8vR/1+d+Ocz/mILZG/eyHHO06OuBQ2aNhxT62fr4y6fGOplRx+CxCSp3IFwesL8WdINfY/3kg==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.7.4.tgz", + "integrity": "sha512-k8iVS7Jhc367IcNF53KCwIXtKAH7czev866ThsTgy8CwlXjnKZna2VHwChglzLleYrcHz1eQEIJlGRQxB53nqA==", "requires": { - "@babel/helper-module-transforms": "^7.7.0", + "@babel/helper-module-transforms": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-simple-access": "^7.7.0", + "@babel/helper-simple-access": "^7.7.4", "babel-plugin-dynamic-import-node": "^2.3.0" } }, "@babel/plugin-transform-object-assign": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-assign/-/plugin-transform-object-assign-7.2.0.tgz", - "integrity": "sha512-nmE55cZBPFgUktbF2OuoZgPRadfxosLOpSgzEPYotKSls9J4pEPcembi8r78RU37Rph6UApCpNmsQA4QMWK9Ng==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-assign/-/plugin-transform-object-assign-7.7.4.tgz", + "integrity": "sha512-0TpeUlnhQDwKxPLTIckdaWt46L2s61c/5w5snw1OUod5ehOJywZD98Ha3dFHVjeqkfOFtOTH7cqxddjxUuvcmg==", "requires": { "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-transform-object-super": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.5.5.tgz", - "integrity": "sha512-un1zJQAhSosGFBduPgN/YFNvWVpRuHKU7IHBglLoLZsGmruJPOo6pbInneflUdmq7YvSVqhpPs5zdBvLnteltQ==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.7.4.tgz", + "integrity": "sha512-ho+dAEhC2aRnff2JCA0SAK7V2R62zJd/7dmtoe7MHcso4C2mS+vZjn1Pb1pCVZvJs1mgsvv5+7sT+m3Bysb6eg==", "requires": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-replace-supers": "^7.5.5" + "@babel/helper-replace-supers": "^7.7.4" } }, "@babel/plugin-transform-parameters": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.4.4.tgz", - "integrity": "sha512-oMh5DUO1V63nZcu/ZVLQFqiihBGo4OpxJxR1otF50GMeCLiRx5nUdtokd+u9SuVJrvvuIh9OosRFPP4pIPnwmw==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.7.4.tgz", + "integrity": "sha512-VJwhVePWPa0DqE9vcfptaJSzNDKrWU/4FbYCjZERtmqEs05g3UMXnYMZoXja7JAJ7Y7sPZipwm/pGApZt7wHlw==", "requires": { - "@babel/helper-call-delegate": "^7.4.4", - "@babel/helper-get-function-arity": "^7.0.0", + "@babel/helper-call-delegate": "^7.7.4", + "@babel/helper-get-function-arity": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-transform-property-literals": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.2.0.tgz", - "integrity": "sha512-9q7Dbk4RhgcLp8ebduOpCbtjh7C0itoLYHXd9ueASKAG/is5PQtMR5VJGka9NKqGhYEGn5ITahd4h9QeBMylWQ==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.7.4.tgz", + "integrity": "sha512-MatJhlC4iHsIskWYyawl53KuHrt+kALSADLQQ/HkhTjX954fkxIEh4q5slL4oRAnsm/eDoZ4q0CIZpcqBuxhJQ==", "requires": { "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-transform-react-display-name": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.2.0.tgz", - "integrity": "sha512-Htf/tPa5haZvRMiNSQSFifK12gtr/8vwfr+A9y69uF0QcU77AVu4K7MiHEkTxF7lQoHOL0F9ErqgfNEAKgXj7A==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.7.4.tgz", + "integrity": "sha512-sBbIvqYkthai0X0vkD2xsAwluBp+LtNHH+/V4a5ydifmTtb8KOVOlrMIk/MYmIc4uTYDnjZUHQildYNo36SRJw==", "requires": { "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-transform-react-jsx": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.7.0.tgz", - "integrity": "sha512-mXhBtyVB1Ujfy+0L6934jeJcSXj/VCg6whZzEcgiiZHNS0PGC7vUCsZDQCxxztkpIdF+dY1fUMcjAgEOC3ZOMQ==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.7.4.tgz", + "integrity": "sha512-LixU4BS95ZTEAZdPaIuyg/k8FiiqN9laQ0dMHB4MlpydHY53uQdWCUrwjLr5o6ilS6fAgZey4Q14XBjl5tL6xw==", "requires": { - "@babel/helper-builder-react-jsx": "^7.7.0", + "@babel/helper-builder-react-jsx": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-jsx": "^7.2.0" + "@babel/plugin-syntax-jsx": "^7.7.4" } }, "@babel/plugin-transform-react-jsx-source": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.5.0.tgz", - "integrity": "sha512-58Q+Jsy4IDCZx7kqEZuSDdam/1oW8OdDX8f+Loo6xyxdfg1yF0GE2XNJQSTZCaMol93+FBzpWiPEwtbMloAcPg==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.7.4.tgz", + "integrity": "sha512-5ZU9FnPhqtHsOXxutRtXZAzoEJwDaP32QcobbMP1/qt7NYcsCNK8XgzJcJfoEr/ZnzVvUNInNjIW22Z6I8p9mg==", "requires": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-jsx": "^7.2.0" + "@babel/plugin-syntax-jsx": "^7.7.4" } }, "@babel/plugin-transform-regenerator": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.7.0.tgz", - "integrity": "sha512-AXmvnC+0wuj/cFkkS/HFHIojxH3ffSXE+ttulrqWjZZRaUOonfJc60e1wSNT4rV8tIunvu/R3wCp71/tLAa9xg==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.7.4.tgz", + "integrity": "sha512-e7MWl5UJvmPEwFJTwkBlPmqixCtr9yAASBqff4ggXTNicZiwbF8Eefzm6NVgfiBp7JdAGItecnctKTgH44q2Jw==", "requires": { "regenerator-transform": "^0.14.0" } }, "@babel/plugin-transform-runtime": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.6.2.tgz", - "integrity": "sha512-cqULw/QB4yl73cS5Y0TZlQSjDvNkzDbu0FurTZyHlJpWE5T3PCMdnyV+xXoH1opr1ldyHODe3QAX3OMAii5NxA==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.7.4.tgz", + "integrity": "sha512-O8kSkS5fP74Ad/8pfsCMGa8sBRdLxYoSReaARRNSz3FbFQj3z/QUvoUmJ28gn9BO93YfnXc3j+Xyaqe8cKDNBQ==", "requires": { - "@babel/helper-module-imports": "^7.0.0", + "@babel/helper-module-imports": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0", "resolve": "^1.8.1", "semver": "^5.5.1" } }, "@babel/plugin-transform-shorthand-properties": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.2.0.tgz", - "integrity": "sha512-QP4eUM83ha9zmYtpbnyjTLAGKQritA5XW/iG9cjtuOI8s1RuL/3V6a3DeSHfKutJQ+ayUfeZJPcnCYEQzaPQqg==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.7.4.tgz", + "integrity": "sha512-q+suddWRfIcnyG5YiDP58sT65AJDZSUhXQDZE3r04AuqD6d/XLaQPPXSBzP2zGerkgBivqtQm9XKGLuHqBID6Q==", "requires": { "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-transform-spread": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.6.2.tgz", - "integrity": "sha512-DpSvPFryKdK1x+EDJYCy28nmAaIMdxmhot62jAXF/o99iA33Zj2Lmcp3vDmz+MUh0LNYVPvfj5iC3feb3/+PFg==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.7.4.tgz", + "integrity": "sha512-8OSs0FLe5/80cndziPlg4R0K6HcWSM0zyNhHhLsmw/Nc5MaA49cAsnoJ/t/YZf8qkG7fD+UjTRaApVDB526d7Q==", "requires": { "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-transform-sticky-regex": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.2.0.tgz", - "integrity": "sha512-KKYCoGaRAf+ckH8gEL3JHUaFVyNHKe3ASNsZ+AlktgHevvxGigoIttrEJb8iKN03Q7Eazlv1s6cx2B2cQ3Jabw==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.7.4.tgz", + "integrity": "sha512-Ls2NASyL6qtVe1H1hXts9yuEeONV2TJZmplLONkMPUG158CtmnrzW5Q5teibM5UVOFjG0D3IC5mzXR6pPpUY7A==", "requires": { "@babel/helper-plugin-utils": "^7.0.0", "@babel/helper-regex": "^7.0.0" } }, "@babel/plugin-transform-template-literals": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.4.4.tgz", - "integrity": "sha512-mQrEC4TWkhLN0z8ygIvEL9ZEToPhG5K7KDW3pzGqOfIGZ28Jb0POUkeWcoz8HnHvhFy6dwAT1j8OzqN8s804+g==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.7.4.tgz", + "integrity": "sha512-sA+KxLwF3QwGj5abMHkHgshp9+rRz+oY9uoRil4CyLtgEuE/88dpkeWgNk5qKVsJE9iSfly3nvHapdRiIS2wnQ==", "requires": { - "@babel/helper-annotate-as-pure": "^7.0.0", + "@babel/helper-annotate-as-pure": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-transform-typescript": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.7.2.tgz", - "integrity": "sha512-UWhDaJRqdPUtdK1s0sKYdoRuqK0NepjZto2UZltvuCgMoMZmdjhgz5hcRokie/3aYEaSz3xvusyoayVaq4PjRg==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.7.4.tgz", + "integrity": "sha512-X8e3tcPEKnwwPVG+vP/vSqEShkwODOEeyQGod82qrIuidwIrfnsGn11qPM1jBLF4MqguTXXYzm58d0dY+/wdpg==", "requires": { - "@babel/helper-create-class-features-plugin": "^7.7.0", + "@babel/helper-create-class-features-plugin": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-typescript": "^7.2.0" + "@babel/plugin-syntax-typescript": "^7.7.4" } }, "@babel/plugin-transform-unicode-regex": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.7.0.tgz", - "integrity": "sha512-RrThb0gdrNwFAqEAAx9OWgtx6ICK69x7i9tCnMdVrxQwSDp/Abu9DXFU5Hh16VP33Rmxh04+NGW28NsIkFvFKA==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.7.4.tgz", + "integrity": "sha512-N77UUIV+WCvE+5yHw+oks3m18/umd7y392Zv7mYTpFqHtkpcc+QUz+gLJNTWVlWROIWeLqY0f3OjZxV5TcXnRw==", "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.7.0", + "@babel/helper-create-regexp-features-plugin": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/register": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/register/-/register-7.7.0.tgz", - "integrity": "sha512-HV3GJzTvSoyOMWGYn2TAh6uL6g+gqKTgEZ99Q3+X9UURT1VPT/WcU46R61XftIc5rXytcOHZ4Z0doDlsjPomIg==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/register/-/register-7.7.4.tgz", + "integrity": "sha512-/fmONZqL6ZMl9KJUYajetCrID6m0xmL4odX7v+Xvoxcv0DdbP/oO0TWIeLUCHqczQ6L6njDMqmqHFy2cp3FFsA==", "requires": { "find-cache-dir": "^2.0.0", "lodash": "^4.17.13", @@ -750,26 +750,26 @@ } }, "@babel/template": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.0.tgz", - "integrity": "sha512-OKcwSYOW1mhWbnTBgQY5lvg1Fxg+VyfQGjcBduZFljfc044J5iDlnDSfhQ867O17XHiSCxYHUxHg2b7ryitbUQ==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.4.tgz", + "integrity": "sha512-qUzihgVPguAzXCK7WXw8pqs6cEwi54s3E+HrejlkuWO6ivMKx9hZl3Y2fSXp9i5HgyWmj7RKP+ulaYnKM4yYxw==", "requires": { "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.7.0", - "@babel/types": "^7.7.0" + "@babel/parser": "^7.7.4", + "@babel/types": "^7.7.4" } }, "@babel/traverse": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.7.2.tgz", - "integrity": "sha512-TM01cXib2+rgIZrGJOLaHV/iZUAxf4A0dt5auY6KNZ+cm6aschuJGqKJM3ROTt3raPUdIDk9siAufIFEleRwtw==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.7.4.tgz", + "integrity": "sha512-P1L58hQyupn8+ezVA2z5KBm4/Zr4lCC8dwKCMYzsa5jFMDMQAzaBNy9W5VjB+KAmBjb40U7a/H6ao+Xo+9saIw==", "requires": { "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.7.2", - "@babel/helper-function-name": "^7.7.0", - "@babel/helper-split-export-declaration": "^7.7.0", - "@babel/parser": "^7.7.2", - "@babel/types": "^7.7.2", + "@babel/generator": "^7.7.4", + "@babel/helper-function-name": "^7.7.4", + "@babel/helper-split-export-declaration": "^7.7.4", + "@babel/parser": "^7.7.4", + "@babel/types": "^7.7.4", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" @@ -783,9 +783,9 @@ } }, "@babel/types": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", - "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", + "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", "requires": { "esutils": "^2.0.2", "lodash": "^4.17.13", @@ -878,9 +878,9 @@ } }, "@google-cloud/paginator": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@google-cloud/paginator/-/paginator-2.0.1.tgz", - "integrity": "sha512-HZ6UTGY/gHGNriD7OCikYWL/Eu0sTEur2qqse2w6OVsz+57se3nTkqH14JIPxtf0vlEJ8IJN5w3BdZ22pjCB8g==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@google-cloud/paginator/-/paginator-2.0.2.tgz", + "integrity": "sha512-PCddVtZWvw0iZ3BLIsCXMBQvxUcS9O5CgfHBu8Zd8T3DCiML+oQED1odsbl3CQ9d3RrvBaj+eIh7Dv12D15PbA==", "dev": true, "optional": true, "requires": { @@ -889,16 +889,16 @@ } }, "@google-cloud/projectify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@google-cloud/projectify/-/projectify-1.0.1.tgz", - "integrity": "sha512-xknDOmsMgOYHksKc1GPbwDLsdej8aRNIA17SlSZgQdyrcC0lx0OGo4VZgYfwoEU1YS8oUxF9Y+6EzDOb0eB7Xg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@google-cloud/projectify/-/projectify-1.0.2.tgz", + "integrity": "sha512-WnkGxvk4U1kAJpoS/Ehk+3MZXVW+XHHhwc/QyD6G8Za4xml3Fv+NRn/bYffl1TxSg+gE0N0mj9Shgc7e8+fl8A==", "dev": true, "optional": true }, "@google-cloud/promisify": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-1.0.2.tgz", - "integrity": "sha512-7WfV4R/3YV5T30WRZW0lqmvZy9hE2/p9MvpI34WuKa2Wz62mLu5XplGTFEMK6uTbJCLWUxTcZ4J4IyClKucE5g==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-1.0.3.tgz", + "integrity": "sha512-Rufgfl3TnkIil3CjsH33Q6093zeoVqyqCdvtvgHuCqRJxCZYfaVPIyr8JViMeLTD4Ja630pRKKZVSjKggoVbNg==", "dev": true, "optional": true }, @@ -3035,9 +3035,9 @@ "integrity": "sha512-cvJewReV2l65exdsccveqnqXHGFuTgwdbjr+0MASxq6zQ+eeHLx9g/wYk8YrXHWXJqf5B/jZnNDpcg/y23atmw==" }, "@react-native-community/cli": { - "version": "1.11.2", - "resolved": "https://registry.npmjs.org/@react-native-community/cli/-/cli-1.11.2.tgz", - "integrity": "sha512-5NuYd30f5PCTrGUbZLnusZKv5nfTWvTDTRa/3Q4vwdMnUQrhm9sZXWGQ5CnFoQ7cE58EAqhj6/ShXeJF3DZ9uQ==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/@react-native-community/cli/-/cli-1.12.0.tgz", + "integrity": "sha512-GAs4JgVP8QkEYeZks/T7cCrBuwFJKxd9ksBLRdQ058uvLGkOEeS4g3y4GsVM/9C1zat5h6Z6QwU0h/hj7G3tzg==", "requires": { "chalk": "^1.1.1", "commander": "^2.19.0", @@ -3168,9 +3168,9 @@ }, "dependencies": { "hoist-non-react-statics": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.0.tgz", - "integrity": "sha512-0XsbTXxgiaCDYDIWFcwkmerZPSwywfUqYmwT4jzewKTQSWoE6FCMoUVOeBJWK3E/CrWbxRG3m5GzY4lnIwGRBA==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz", + "integrity": "sha512-wbg3bpgA/ZqWrZuMOeJi8+SKMhr7X9TesL/rXMjTzh0p0JUBo3II8DHboYbuIXWRlttrUFxwcu/5kygrCw8fJw==", "requires": { "react-is": "^16.7.0" } @@ -3188,9 +3188,9 @@ }, "dependencies": { "hoist-non-react-statics": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.0.tgz", - "integrity": "sha512-0XsbTXxgiaCDYDIWFcwkmerZPSwywfUqYmwT4jzewKTQSWoE6FCMoUVOeBJWK3E/CrWbxRG3m5GzY4lnIwGRBA==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz", + "integrity": "sha512-wbg3bpgA/ZqWrZuMOeJi8+SKMhr7X9TesL/rXMjTzh0p0JUBo3II8DHboYbuIXWRlttrUFxwcu/5kygrCw8fJw==", "requires": { "react-is": "^16.7.0" } @@ -3230,9 +3230,9 @@ } }, "@types/babel__traverse": { - "version": "7.0.7", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.7.tgz", - "integrity": "sha512-CeBpmX1J8kWLcDEnI3Cl2Eo6RfbGvzUctA+CjZUhOKDFbLfcr7fc4usEqLNWetrlJd7RhAkyYe2czXop4fICpw==", + "version": "7.0.8", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.8.tgz", + "integrity": "sha512-yGeB2dHEdvxjP0y4UbRtQaSkXJ9649fYCmIdRoul5kfAoGCwxuCbMhag0k3RPfnuh9kPGm8x89btcfDEXdVWGw==", "dev": true, "requires": { "@babel/types": "^7.3.0" @@ -3298,9 +3298,9 @@ "dev": true }, "abab": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.2.tgz", - "integrity": "sha512-2scffjvioEmNz0OyDSLGWDfKCVwaKc6l9Pm9kOIREU13ClXZvHpg/nRL5xyjSSSLhOnXqft2HpsAzNEEA8cFFg==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.3.tgz", + "integrity": "sha512-tsFzPpcttalNjFBCFMqsKYQcWxxen1pgJR56by//QwvJc4/OUS3kPOOttx2tSIfjsylB0pYu7f5D3K1RCxUnUg==", "dev": true }, "abort-controller": { @@ -4131,9 +4131,9 @@ } }, "big-integer": { - "version": "1.6.47", - "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.47.tgz", - "integrity": "sha512-9t9f7X3as2XGX8b52GqG6ox0GvIdM86LyIXASJnDCFhYNgt+A+MByQZ3W2PyMRZjEvG5f8TEbSPfEotVuMJnQg==" + "version": "1.6.48", + "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.48.tgz", + "integrity": "sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w==" }, "bignumber.js": { "version": "8.1.1", @@ -4824,9 +4824,9 @@ "integrity": "sha1-wB3mPvsO7JeYgB1Ax+Da4ltYLIQ=" }, "deep-equal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.0.tgz", - "integrity": "sha512-ZbfWJq/wN1Z273o7mUSjILYqehAktR2NVoSrOukDkU9kg2v/Uv89yU4Cvz8seJeAmtN5oqiefKq8FPuXOboqLw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", + "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", "dev": true, "optional": true, "requires": { @@ -5134,18 +5134,18 @@ } }, "es-abstract": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.16.0.tgz", - "integrity": "sha512-xdQnfykZ9JMEiasTAJZJdMWCQ1Vm00NBw79/AWi7ELfZuuPCSOMDZbT9mkOfSctVtfhb+sAAzrm+j//GjjLHLg==", + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.16.2.tgz", + "integrity": "sha512-jYo/J8XU2emLXl3OLwfwtuFfuF2w6DYPs+xy9ZfVyPkDcrauu6LYrw/q2TyCtrbc/KUdCiC5e9UajRhgNkVopA==", "dev": true, "requires": { - "es-to-primitive": "^1.2.0", + "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", - "has-symbols": "^1.0.0", + "has-symbols": "^1.0.1", "is-callable": "^1.1.4", "is-regex": "^1.0.4", - "object-inspect": "^1.6.0", + "object-inspect": "^1.7.0", "object-keys": "^1.1.1", "string.prototype.trimleft": "^2.1.0", "string.prototype.trimright": "^2.1.0" @@ -5446,17 +5446,17 @@ }, "dependencies": { "@babel/core": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.7.2.tgz", - "integrity": "sha512-eeD7VEZKfhK1KUXGiyPFettgF3m513f8FoBSWiQ1xTvl1RAopLs42Wp9+Ze911I6H0N9lNqJMDgoZT7gHsipeQ==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.7.4.tgz", + "integrity": "sha512-+bYbx56j4nYBmpsWtnPUsKW3NdnYxbqyfrP2w9wILBuHzdfIKz9prieZK0DFPyIzkjYVUe4QkusGL07r5pXznQ==", "requires": { "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.7.2", - "@babel/helpers": "^7.7.0", - "@babel/parser": "^7.7.2", - "@babel/template": "^7.7.0", - "@babel/traverse": "^7.7.2", - "@babel/types": "^7.7.2", + "@babel/generator": "^7.7.4", + "@babel/helpers": "^7.7.4", + "@babel/parser": "^7.7.4", + "@babel/template": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "json5": "^2.1.0", @@ -6146,9 +6146,9 @@ } }, "gcp-metadata": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-3.2.1.tgz", - "integrity": "sha512-JjDedBWnbXVXWwTpjBdpb9RpVLiowXG4/50rra4hPH8REXAi2si6Xbb48B2SwkQBLz9Wu6+o32GDTvVy2kkLoQ==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-3.2.2.tgz", + "integrity": "sha512-vR7kcJMCYJG/mYWp/a1OszdOqnLB/XW1GorWW1hc1lWVNL26L497zypWb9cG0CYDQ4Bl1Wk0+fSZFFjwJlTQgQ==", "dev": true, "optional": true, "requires": { @@ -6157,9 +6157,9 @@ } }, "gcs-resumable-upload": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/gcs-resumable-upload/-/gcs-resumable-upload-2.3.0.tgz", - "integrity": "sha512-PclXJiEngrVx0c4K0LfE1XOxhmOkBEy39Rrhspdn6jAbbwe4OQMZfjo7Z1LHBrh57+bNZeIN4M+BooYppCoHSg==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/gcs-resumable-upload/-/gcs-resumable-upload-2.3.1.tgz", + "integrity": "sha512-zEO7L+jz99VznQsbsF7vFTnIFbSu+CjdJqt5htnjIrfsp5j+QCVBvbbKdqpaTfCPzpUPYj1Q9O9DhIh/8newfA==", "dev": true, "optional": true, "requires": { @@ -6276,14 +6276,15 @@ } }, "google-gax": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-1.8.0.tgz", - "integrity": "sha512-gDlL1mcyMSde7guPVzwpWi9V8XP+4F8UwFKoUiINEGRDNDbEj18OorL016XU0Kyt8Aizcf5dgb3q8UKegYAOmQ==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-1.11.1.tgz", + "integrity": "sha512-v/APF2G5h2nS5R/1DW2vsgloaMu2/B3xjHdAptR1yUwZpEd9rxPTlhqosrjl/VRu+gWGr9JZN19ZgJTXQ/Db6Q==", "dev": true, "optional": true, "requires": { "@grpc/grpc-js": "0.6.9", "@grpc/proto-loader": "^0.5.1", + "@types/long": "^4.0.0", "abort-controller": "^3.0.0", "duplexify": "^3.6.0", "google-auth-library": "^5.0.0", @@ -6307,9 +6308,9 @@ } }, "google-p12-pem": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-2.0.2.tgz", - "integrity": "sha512-UfnEARfJKI6pbmC1hfFFm+UAcZxeIwTiEcHfqKe/drMsXD/ilnVjF7zgOGpHXyhuvX6jNJK3S8A0hOQjwtFxEw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-2.0.3.tgz", + "integrity": "sha512-Tq2kBCANxYYPxaBpTgCpRfdoPs9+/lNzc/Iaee4kuMVW5ascD+HwhpBsTLwH85C9Ev4qfB8KKHmpPQYyD2vg2w==", "dev": true, "optional": true, "requires": { @@ -6336,9 +6337,9 @@ "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=" }, "gtoken": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-4.1.1.tgz", - "integrity": "sha512-2FEmEDGi4NdM6u+mtaLjSDDtHiw5wT+nBsI+yrSeFO6fVqPEytYVF6uiIpRaOaZhRP+ozjYWuwwtMlrjAyTcYA==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-4.1.3.tgz", + "integrity": "sha512-ofW+FiXjswyKdkjMcDbe6E4K7cDDdE82dGDhZIc++kUECqaE7MSErf6arJPAjcnYn1qxE1/Ti06qQuqgVusovQ==", "dev": true, "optional": true, "requires": { @@ -6358,9 +6359,9 @@ } }, "handlebars": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.1.tgz", - "integrity": "sha512-C29UoFzHe9yM61lOsIlCE5/mQVGrnIOrOq7maQl76L7tYPCgC1og0Ajt6uWnX4ZTxBPnjw+CUvawphwCfJgUnA==", + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.3.tgz", + "integrity": "sha512-3yPecJoJHK/4c6aZhSvxOyG4vJKDshV36VHp0iVCDVh7o9w2vwi3NSnL2MMPj3YdduqaBcu7cGbggJQM0br9xA==", "dev": true, "requires": { "neo-async": "^2.6.0", @@ -6376,9 +6377,9 @@ "dev": true }, "uglify-js": { - "version": "3.6.8", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.8.tgz", - "integrity": "sha512-XhHJ3S3ZyMwP8kY1Gkugqx3CJh2C3O0y8NPiSxtm1tyD/pktLAkFZsFGpuNfTZddKDQ/bbDBLAd2YyA1pbi8HQ==", + "version": "3.6.9", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.9.tgz", + "integrity": "sha512-pcnnhaoG6RtrvHJ1dFncAe8Od6Nuy30oaJ82ts6//sGSXOP5UjBMEthiProjXmMNHOfd93sqlkztifFMcb+4yw==", "dev": true, "optional": true, "requires": { @@ -6447,9 +6448,9 @@ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" }, "has-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", - "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" }, "has-unicode": { "version": "2.0.1", @@ -6914,12 +6915,12 @@ "optional": true }, "is-symbol": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", - "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", "dev": true, "requires": { - "has-symbols": "^1.0.0" + "has-symbols": "^1.0.1" } }, "is-typedarray": { @@ -9946,17 +9947,17 @@ }, "dependencies": { "@babel/core": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.7.2.tgz", - "integrity": "sha512-eeD7VEZKfhK1KUXGiyPFettgF3m513f8FoBSWiQ1xTvl1RAopLs42Wp9+Ze911I6H0N9lNqJMDgoZT7gHsipeQ==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.7.4.tgz", + "integrity": "sha512-+bYbx56j4nYBmpsWtnPUsKW3NdnYxbqyfrP2w9wILBuHzdfIKz9prieZK0DFPyIzkjYVUe4QkusGL07r5pXznQ==", "requires": { "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.7.2", - "@babel/helpers": "^7.7.0", - "@babel/parser": "^7.7.2", - "@babel/template": "^7.7.0", - "@babel/traverse": "^7.7.2", - "@babel/types": "^7.7.2", + "@babel/generator": "^7.7.4", + "@babel/helpers": "^7.7.4", + "@babel/parser": "^7.7.4", + "@babel/template": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "json5": "^2.1.0", @@ -10116,17 +10117,17 @@ }, "dependencies": { "@babel/core": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.7.2.tgz", - "integrity": "sha512-eeD7VEZKfhK1KUXGiyPFettgF3m513f8FoBSWiQ1xTvl1RAopLs42Wp9+Ze911I6H0N9lNqJMDgoZT7gHsipeQ==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.7.4.tgz", + "integrity": "sha512-+bYbx56j4nYBmpsWtnPUsKW3NdnYxbqyfrP2w9wILBuHzdfIKz9prieZK0DFPyIzkjYVUe4QkusGL07r5pXznQ==", "requires": { "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.7.2", - "@babel/helpers": "^7.7.0", - "@babel/parser": "^7.7.2", - "@babel/template": "^7.7.0", - "@babel/traverse": "^7.7.2", - "@babel/types": "^7.7.2", + "@babel/generator": "^7.7.4", + "@babel/helpers": "^7.7.4", + "@babel/parser": "^7.7.4", + "@babel/template": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "json5": "^2.1.0", @@ -10152,17 +10153,17 @@ }, "dependencies": { "@babel/core": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.7.2.tgz", - "integrity": "sha512-eeD7VEZKfhK1KUXGiyPFettgF3m513f8FoBSWiQ1xTvl1RAopLs42Wp9+Ze911I6H0N9lNqJMDgoZT7gHsipeQ==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.7.4.tgz", + "integrity": "sha512-+bYbx56j4nYBmpsWtnPUsKW3NdnYxbqyfrP2w9wILBuHzdfIKz9prieZK0DFPyIzkjYVUe4QkusGL07r5pXznQ==", "requires": { "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.7.2", - "@babel/helpers": "^7.7.0", - "@babel/parser": "^7.7.2", - "@babel/template": "^7.7.0", - "@babel/traverse": "^7.7.2", - "@babel/types": "^7.7.2", + "@babel/generator": "^7.7.4", + "@babel/helpers": "^7.7.4", + "@babel/parser": "^7.7.4", + "@babel/template": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "json5": "^2.1.0", @@ -10296,17 +10297,17 @@ }, "dependencies": { "@babel/core": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.7.2.tgz", - "integrity": "sha512-eeD7VEZKfhK1KUXGiyPFettgF3m513f8FoBSWiQ1xTvl1RAopLs42Wp9+Ze911I6H0N9lNqJMDgoZT7gHsipeQ==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.7.4.tgz", + "integrity": "sha512-+bYbx56j4nYBmpsWtnPUsKW3NdnYxbqyfrP2w9wILBuHzdfIKz9prieZK0DFPyIzkjYVUe4QkusGL07r5pXznQ==", "requires": { "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.7.2", - "@babel/helpers": "^7.7.0", - "@babel/parser": "^7.7.2", - "@babel/template": "^7.7.0", - "@babel/traverse": "^7.7.2", - "@babel/types": "^7.7.2", + "@babel/generator": "^7.7.4", + "@babel/helpers": "^7.7.4", + "@babel/parser": "^7.7.4", + "@babel/template": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "json5": "^2.1.0", @@ -10423,16 +10424,16 @@ "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" }, "mime-db": { - "version": "1.40.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", - "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" + "version": "1.42.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.42.0.tgz", + "integrity": "sha512-UbfJCR4UAVRNgMpfImz05smAXK7+c+ZntjaA26ANtkXLlOe947Aag5zdIcKQULAiF9Cq4WxBi9jUs5zkA84bYQ==" }, "mime-types": { - "version": "2.1.24", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", - "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", + "version": "2.1.25", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.25.tgz", + "integrity": "sha512-5KhStqB5xpTAeGqKBAMgwaYMnQik7teQN4IAzC7npDv6kzeU6prfkR67bc87J1kWMPGkoaZSq1npmexMgkmEVg==", "requires": { - "mime-db": "1.40.0" + "mime-db": "1.42.0" } }, "mimic-fn": { @@ -10769,9 +10770,9 @@ } }, "object-inspect": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.6.0.tgz", - "integrity": "sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", + "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==", "dev": true }, "object-is": { @@ -11421,9 +11422,9 @@ "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" }, "query-string": { - "version": "6.8.3", - "resolved": "https://registry.npmjs.org/query-string/-/query-string-6.8.3.tgz", - "integrity": "sha512-llcxWccnyaWlODe7A9hRjkvdCKamEKTh+wH8ITdTc3OhchaqUZteiSCX/2ablWHVrkVIe04dntnaZJ7BdyW0lQ==", + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-6.9.0.tgz", + "integrity": "sha512-KG4bhCFYapExLsUHrFt+kQVEegF2agm4cpF/VNc6pZVthIfCc/GK8t8VyNIE3nyXG9DK3Tf2EGkxjR6/uRdYsA==", "requires": { "decode-uri-component": "^0.2.0", "split-on-first": "^1.0.0", @@ -11513,9 +11514,9 @@ } }, "react-is": { - "version": "16.11.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.11.0.tgz", - "integrity": "sha512-gbBVYR2p8mnriqAwWx9LbuUrShnAuSCNnuPGyc7GJrMVQtPDAh8iLpv7FRuMPFb56KkaVZIYSz1PrjI9q0QPCw==" + "version": "16.12.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.12.0.tgz", + "integrity": "sha512-rPCkf/mWBtKc97aLL9/txD8DZdemK0vkA3JMLShjlJB3Pj3s+lpf1KaBzMfQrAmhMQB0n1cU/SUGgKKBCe837Q==" }, "react-native": { "version": "0.59.9", @@ -11575,9 +11576,9 @@ }, "dependencies": { "@babel/runtime": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.7.2.tgz", - "integrity": "sha512-JONRbXbTXc9WQE2mAZd1p0Z3DZ/6vaQIkgYMSTP3KjRCyd7rCZCcfhCyX+YjwcKxcZ82UrxbRD358bpExNgrjw==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.7.4.tgz", + "integrity": "sha512-r24eVUUr0QqNZa+qrImUk8fn5SPhHq+IfYvIoIMg0do3GdK9sMdiLKP3GYVVaxpPKORgm8KRKaNTEhAjgIpLMw==", "requires": { "regenerator-runtime": "^0.13.2" }, @@ -11925,17 +11926,17 @@ }, "dependencies": { "@babel/runtime": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.7.2.tgz", - "integrity": "sha512-JONRbXbTXc9WQE2mAZd1p0Z3DZ/6vaQIkgYMSTP3KjRCyd7rCZCcfhCyX+YjwcKxcZ82UrxbRD358bpExNgrjw==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.7.4.tgz", + "integrity": "sha512-r24eVUUr0QqNZa+qrImUk8fn5SPhHq+IfYvIoIMg0do3GdK9sMdiLKP3GYVVaxpPKORgm8KRKaNTEhAjgIpLMw==", "requires": { "regenerator-runtime": "^0.13.2" } }, "hoist-non-react-statics": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.0.tgz", - "integrity": "sha512-0XsbTXxgiaCDYDIWFcwkmerZPSwywfUqYmwT4jzewKTQSWoE6FCMoUVOeBJWK3E/CrWbxRG3m5GzY4lnIwGRBA==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz", + "integrity": "sha512-wbg3bpgA/ZqWrZuMOeJi8+SKMhr7X9TesL/rXMjTzh0p0JUBo3II8DHboYbuIXWRlttrUFxwcu/5kygrCw8fJw==", "requires": { "react-is": "^16.7.0" } @@ -12249,9 +12250,9 @@ "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" }, "resolve": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz", - "integrity": "sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==", + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.2.tgz", + "integrity": "sha512-cAVTI2VLHWYsGOirfeYVVQ7ZDejtQ9fp4YhYckWDEkFfqbVjaT11iM8k6xSAfGFMM+gDpZjMnFssPu8we+mqFw==", "requires": { "path-parse": "^1.0.6" } diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index cf59ac14..15f599c2 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -1,4 +1,4 @@ -import React, { Component } from 'react'; +import React, { PureComponent } from 'react'; import { Text, View, ScrollView, ListView, Dimensions} from 'react-native'; import { withNavigation } from 'react-navigation'; @@ -12,7 +12,7 @@ import DataContract from '../../../constants/DataContract'; // const ITEM_HEIGHT = AppConfig.thumbnailListConstants.iconHeight + AppConfig.thumbnailListConstants.iconWidth; -class InvertedReplyList extends Component { +class InvertedReplyList extends PureComponent { static navigationOptions = { header: null @@ -25,7 +25,7 @@ class InvertedReplyList extends Component { this.setPagination(); this.state = { - list: this.paginationService.getResults(), + list: this.getInitialList(), refreshing : false, loadingNext: false }; @@ -34,9 +34,16 @@ class InvertedReplyList extends Component { this.onItemClick = null; } + getInitialList = () => { + if (this.props.paginationService){ + return this.paginationService.getResults(); + } + return []; + }; + setClickHandlers = ()=> { this.onItemClick = this.props.onChildClickDelegate || this.defaultChildClickHandler; - } + }; getPagination = () => { return this.paginationService; @@ -140,6 +147,7 @@ class InvertedReplyList extends Component { } beforeRefresh = ( ) => { + console.log('beforeRefresh') this.props.beforeRefresh && this.props.beforeRefresh(); let stateObject = {refreshing : true}; if (this.state.loadingNext) { @@ -222,7 +230,7 @@ class InvertedReplyList extends Component { heightOfFlatList = heightOfElements + heightOfSeparator; return availableHeight > heightOfFlatList ? heightOfFlatList : availableHeight; } - return availableHeight; + return 0; }; getItemLayout= (data, index) => { @@ -243,9 +251,7 @@ class InvertedReplyList extends Component { onEndReachedThreshold={4} renderItem={this._renderItem} ListFooterComponent={this.renderFooter} - numColumns={this.numColumns} key={this.flatListKey} - nestedScrollEnabled={true} showsVerticalScrollIndicator={false} initialScrollIndex={this.props.currentIndex} getItemLayout={this.getItemLayout} From 63f3007191ae94026ed914410f5cf18a56ae2010 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Mon, 25 Nov 2019 18:02:40 +0530 Subject: [PATCH 154/302] small fix --- src/components/FanVideoDetails/VideoDescription.js | 2 +- src/components/VideoRecorder/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/FanVideoDetails/VideoDescription.js b/src/components/FanVideoDetails/VideoDescription.js index 5c5eace2..53b3be1c 100644 --- a/src/components/FanVideoDetails/VideoDescription.js +++ b/src/components/FanVideoDetails/VideoDescription.js @@ -23,7 +23,7 @@ class VideoDescription extends PureComponent { horizontal={false} initialValue={this.value} onChangeVal={this.onChangeValue} - placeholderText="Write something about your video" + placeholderText="Write something about your video" submitEvent={this.submitEvent} textInputStyles={inlineStyles.videoDescription} dropdownStyle={inlineStyles.dropDownStyle} diff --git a/src/components/VideoRecorder/index.js b/src/components/VideoRecorder/index.js index 5fb8aac0..90c4729b 100644 --- a/src/components/VideoRecorder/index.js +++ b/src/components/VideoRecorder/index.js @@ -192,7 +192,7 @@ class VideoRecorder extends Component { - Be the first one to reply to @{this.getUserName()}’s video, once you post the reply you will pay {this.getPepoAmount()} Pepo Coins + Be the first one to reply to @{this.getUserName()}’s video. Once you post the reply, you will pay {this.getPepoAmount()} Pepo Coins Date: Mon, 25 Nov 2019 18:36:41 +0530 Subject: [PATCH 155/302] Case in-sensitive support for getter --- src/services/ReduxGetters.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/ReduxGetters.js b/src/services/ReduxGetters.js index 5019a752..8d3a50c4 100644 --- a/src/services/ReduxGetters.js +++ b/src/services/ReduxGetters.js @@ -151,7 +151,7 @@ class ReduxGetters { getTappedIncludesEntity(videoId, tappedText) { let lowercasedText = tappedText.toLowerCase(); let state = Store.getState(); - return deepGet(state, `video_description_entities.id_${videoId}.includes.${lowercasedText}`); + return deepGet(state, `video_description_entities.id_${videoId}.includes.${lowercasedText}`) || deepGet(state, `video_description_entities.id_${videoId}.includes.${tappedText}`); } getVideoLink(id, state) { From 96b9b35baa305b259cbc355e40a98b6c034287f8 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Mon, 25 Nov 2019 18:44:28 +0530 Subject: [PATCH 156/302] Share and report issue bug fix --- .../InvertedReplyThumbnailList/index.js | 6 +++--- .../CommonComponents/ShareIcon/index.js | 16 +++++++++------- .../FullScreenReplyCollection/VideoReplyRow.js | 4 +++- .../FullScreenVideoRow.js | 2 +- src/components/Home/HomeFeedRow.js | 5 +---- src/components/Search/index.js | 10 ++++++---- .../UserVideoHistory/UserVideoHistoryRow.js | 2 +- src/services/shareVideo.js | 8 +++----- 8 files changed, 27 insertions(+), 26 deletions(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index cf59ac14..fefbffb2 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -1,5 +1,5 @@ -import React, { Component } from 'react'; -import { Text, View, ScrollView, ListView, Dimensions} from 'react-native'; +import React, { PureComponent } from 'react'; +import {View, Dimensions} from 'react-native'; import { withNavigation } from 'react-navigation'; import Pagination from "../../../services/Pagination"; @@ -12,7 +12,7 @@ import DataContract from '../../../constants/DataContract'; // const ITEM_HEIGHT = AppConfig.thumbnailListConstants.iconHeight + AppConfig.thumbnailListConstants.iconWidth; -class InvertedReplyList extends Component { +class InvertedReplyList extends PureComponent { static navigationOptions = { header: null diff --git a/src/components/CommonComponents/ShareIcon/index.js b/src/components/CommonComponents/ShareIcon/index.js index 54d885eb..6dc52b88 100644 --- a/src/components/CommonComponents/ShareIcon/index.js +++ b/src/components/CommonComponents/ShareIcon/index.js @@ -21,23 +21,25 @@ class ShareIcon extends PureComponent { }; shareVideo = () => { - let shareVideo = new ShareVideo(this.props.entityId, this.props.url); + let shareVideo = new ShareVideo(this.props.url); shareVideo.perform(); }; - isDisabled = () => { - return this.props.isCreatorApproved != 1; - }; - render(){ return ( this.shareVideo())} > - + ); } }; +ShareIcon.defaultProps = { + isDisabled: function() { + return this.props.isCreatorApproved != 1; + } +} + export default connect(mapStateToProps)(ShareIcon); diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index 04f25665..e39fd9cc 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -111,7 +111,9 @@ class VideoReplyRow extends PureComponent { }} /> - + {return false}} + /> diff --git a/src/components/FullScreenVideoCollection/FullScreenVideoRow.js b/src/components/FullScreenVideoCollection/FullScreenVideoRow.js index 6bf207d6..650c085f 100644 --- a/src/components/FullScreenVideoCollection/FullScreenVideoRow.js +++ b/src/components/FullScreenVideoCollection/FullScreenVideoRow.js @@ -80,7 +80,7 @@ class FullScreeVideoRow extends PureComponent { getPixelDropData={this.getPixelDropData} /> - + diff --git a/src/components/Home/HomeFeedRow.js b/src/components/Home/HomeFeedRow.js index 5fb1db4f..987270ae 100644 --- a/src/components/Home/HomeFeedRow.js +++ b/src/components/Home/HomeFeedRow.js @@ -86,10 +86,7 @@ class HomeFeedRow extends PureComponent { /> - + {this.reportViewRef = ref }} onLayout={()=>{}} > diff --git a/src/components/Search/index.js b/src/components/Search/index.js index 755321ab..cd4c25a9 100644 --- a/src/components/Search/index.js +++ b/src/components/Search/index.js @@ -136,10 +136,9 @@ class SearchScreen extends PureComponent { return prevProps.userId !== this.props.userId; } - componentDidUpdate(prevProps){ if(this.isUserUpdated(prevProps)) { - this.initReferences(); + //this.initReferences(); } } @@ -164,8 +163,9 @@ class SearchScreen extends PureComponent { let tabData = TabsArray[ tabIndx]; let newTabUrl = this.getUrlForTab( tabData ); let tabFlatList = this.getTabFlatList( tabIndx ); + if(!tabFlatList) return; tabFlatList.forcedRefresh(newTabUrl); - tabFlatList.scrollToTop(); + tabFlatList && tabFlatList.scrollToTop(); }; initReferences = () =>{ @@ -201,6 +201,7 @@ class SearchScreen extends PureComponent { if ( !currentTabUrl || currentTabUrl !== newTabUrl ) { // Force refresh let tabFlatList = this.getTabFlatList( tabIndx ); + if(!tabFlatList) return; tabFlatList.scrollToTop(); tabFlatList.forcedRefresh(newTabUrl); } else { @@ -319,12 +320,13 @@ class SearchScreen extends PureComponent { if (this.isUserLoggedIn()){ return this.renderLoggedInView(); } else { + this.initReferences(); return this.renderLoggedOutView() } } renderLoggedOutView = () => { - return + return }; renderTabBar = () => { diff --git a/src/components/UserVideoHistory/UserVideoHistoryRow.js b/src/components/UserVideoHistory/UserVideoHistoryRow.js index 78a7885f..9c906c9d 100644 --- a/src/components/UserVideoHistory/UserVideoHistoryRow.js +++ b/src/components/UserVideoHistory/UserVideoHistoryRow.js @@ -91,7 +91,7 @@ class UserVideoHistoryRow extends PureComponent { getPixelDropData={this.getPixelDropData} /> - + diff --git a/src/services/shareVideo.js b/src/services/shareVideo.js index 43bf494f..226a6cbd 100644 --- a/src/services/shareVideo.js +++ b/src/services/shareVideo.js @@ -1,12 +1,10 @@ import PepoApi from './PepoApi'; - -import { Share, Platform } from 'react-native'; -import DataContract from '../constants/DataContract'; +import { Share } from 'react-native'; class ShareVideo { - constructor(entityId, url) { - this.entityId = entityId; + constructor(url , entityId) { this.url = url; + this.entityId = entityId; } perform() { From 80b2376c2f598752632216973ca173551aa27596 Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Mon, 25 Nov 2019 18:51:30 +0530 Subject: [PATCH 157/302] Inverted List UI and few bug fixes --- RootNavigationContainer.js | 12 +----- .../ReplyThumbnailItem.js | 3 +- .../InvertedReplyThumbnailList/index.js | 2 +- .../CommonComponents/ReportVideo/index.js | 2 +- .../VideoReplyRow.js | 32 ++++++++------- .../FullScreenReplyCollection/styles.js | 17 ++++---- .../FullScreenVideoRow.js | 18 ++++---- .../FullScreenVideoCollection/styles.js | 12 ++++-- src/components/Home/HomeFeedRow.js | 41 +++++++++++-------- src/components/Home/styles.js | 16 ++++---- .../UserVideoHistory/UserVideoHistoryRow.js | 18 ++++---- src/components/UserVideoHistory/styles.js | 17 ++++---- 12 files changed, 101 insertions(+), 89 deletions(-) diff --git a/RootNavigationContainer.js b/RootNavigationContainer.js index 61ec2d83..d41df3d1 100644 --- a/RootNavigationContainer.js +++ b/RootNavigationContainer.js @@ -262,17 +262,7 @@ const ProfileStack = createStackNavigator( FullScreenReplyCollection: FullScreenReplyStack, RedemptiomScreen: RedemptiomScreen }, - { - headerLayoutPreset: 'center', - headerMode: 'none', - mode: 'modal', - navigationOptions: ({ navigation }) => { - return { - tabBarVisible: deepGet(navigation, 'state.index') === 0 - }; - }, - ...txModalConfig - } + { ...modalStackConfig, ...txModalConfig } ); const SearchPushStack = createStackNavigator( diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js index 3e7b724c..c04dc57e 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js @@ -64,7 +64,8 @@ const inlineStyle= { shadowOffset: { width: 0, height: 2 }, shadowOpacity: 1, shadowRadius: 4, - elevation: 5 + elevation: 5, + overflow: 'hidden' // shadowColor: 'red', // shadowOffset: { // width: 1, diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index 15f599c2..c4096c89 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -239,7 +239,7 @@ class InvertedReplyList extends PureComponent { render() { console.log("InvertedReplyList :: this.props.listKey", this.props.listKey); - return this.showActionSheet())} > ) diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index e39fd9cc..a4389d3b 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -68,19 +68,6 @@ class VideoReplyRow extends PureComponent { - - {this.props.parentVideoId && ( - - - - - )} - + + + {this.props.parentVideoId && ( + + + + + )} - + + + - - - - - + + + + + + + - - - - + - + + + + + + {this.reportViewRef = ref }} onLayout={()=>{}} > - + - + + + diff --git a/src/components/Home/styles.js b/src/components/Home/styles.js index caf31452..242352f5 100644 --- a/src/components/Home/styles.js +++ b/src/components/Home/styles.js @@ -33,14 +33,16 @@ let stylesMap = { height: "100%" }, touchablesBtns: { - alignSelf: 'flex-end', - marginBottom: -15, - zIndex: 1 + alignItems: 'flex-end', + marginBottom: -10, + zIndex: 1, + flexDirection: 'row' + }, + invertedList: { + marginRight: 'auto', + minWidth: '20%', + marginBottom: 40 }, - invertedList: { - - // marginBottom: -15, - }, pepoTxCount: { fontSize: 18, color: Colors.white, diff --git a/src/components/UserVideoHistory/UserVideoHistoryRow.js b/src/components/UserVideoHistory/UserVideoHistoryRow.js index 9c906c9d..9f15d0f3 100644 --- a/src/components/UserVideoHistory/UserVideoHistoryRow.js +++ b/src/components/UserVideoHistory/UserVideoHistoryRow.js @@ -62,13 +62,6 @@ class UserVideoHistoryRow extends PureComponent { - - - - - + + + + + + + Date: Mon, 25 Nov 2019 19:24:03 +0530 Subject: [PATCH 158/302] bubblelist --- .../CommonComponents/BubbleList/index.js | 92 +++++++++++++++++++ .../CommonComponents/BubbleList/styles.js | 0 src/components/Home/HomeFeedRow.js | 12 ++- 3 files changed, 99 insertions(+), 5 deletions(-) create mode 100644 src/components/CommonComponents/BubbleList/index.js create mode 100644 src/components/CommonComponents/BubbleList/styles.js diff --git a/src/components/CommonComponents/BubbleList/index.js b/src/components/CommonComponents/BubbleList/index.js new file mode 100644 index 00000000..e9095b7c --- /dev/null +++ b/src/components/CommonComponents/BubbleList/index.js @@ -0,0 +1,92 @@ +import React, { PureComponent } from 'react'; +import { Text, View, ScrollView, ListView, Dimensions} from 'react-native'; +import { withNavigation } from 'react-navigation'; + +import Pagination from "../../../services/Pagination"; +import {FlatList} from 'react-native-gesture-handler'; +import ReplyHelper from '../../../helpers/ReplyHelper'; +import AppConfig from "../../../constants/AppConfig"; +import DataContract from '../../../constants/DataContract'; +import PepoApi from "../../../services/PepoApi"; +import deepGet from "lodash/get"; +import ProfilePicture from "../../ProfilePicture"; + +// +const NO_OF_ITEMS_TO_SHOW = 3; + +class BubbleList extends PureComponent { + + static navigationOptions = { + header: null + }; + + constructor(props) { + super(props); + this.state = { + list: [] + } + this.hasInitialData = true; + this.getDataWhileLoading() + } + + componentDidUpdate(prevProps, prevState ) { + if( this.props.doRender && this.props.doRender !== prevProps.doRender && !this.hasInitialData ){ + this.getListData(); + } + + } + + getDataWhileLoading(){ + if (this.props.doRender){ + this.getListData() + this.hasInitialData = false; + } + }; + + getListData = () => { + return new PepoApi(this.getFetchUrl()) + .get() + .then((apiResponse) => { + if (apiResponse.success ){ + let result_type = deepGet(apiResponse, DataContract.common.resultType), + list = deepGet(apiResponse, `data.${result_type}` ); + this.setState({ list : list.reverse()}); + } + + }) + .catch((err) => { + console.log(err); + }); + + }; + + + getFetchUrl = () => { + return `/videos/${4266}/replies`; + return `/videos/${this.props.videoId}/replies`; + }; + + componentDidMount () {} + + getBubbleListJSX = () => { + let listToRender = this.state.list.slice(0,NO_OF_ITEMS_TO_SHOW); + return listToRender.length?listToRender.map((item) => { + return + }): <> ; + }; + + render() { + console.log('getBubbleListJSX: render'); + return {this.getBubbleListJSX()} + } +} + + +//make this component available to the app +export default BubbleList; diff --git a/src/components/CommonComponents/BubbleList/styles.js b/src/components/CommonComponents/BubbleList/styles.js new file mode 100644 index 00000000..e69de29b diff --git a/src/components/Home/HomeFeedRow.js b/src/components/Home/HomeFeedRow.js index f082d090..2db714ab 100644 --- a/src/components/Home/HomeFeedRow.js +++ b/src/components/Home/HomeFeedRow.js @@ -19,6 +19,7 @@ import DataContract from '../../constants/DataContract'; import InvertedReplyList from '../CommonComponents/InvertedReplyThumbnailList'; import AppConfig from "../../constants/AppConfig"; +import BubbleList from "../CommonComponents/BubbleList"; const AREA = AppConfig.MaxDescriptionArea; const height = AREA / Dimensions.get('window').width + 20; @@ -72,11 +73,12 @@ class HomeFeedRow extends PureComponent { - + {/**/} + From 6f64cf4897fe62316041fbfa0ed83b8995f428b4 Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Mon, 25 Nov 2019 19:33:54 +0530 Subject: [PATCH 159/302] fix get next data --- src/components/CommonComponents/BubbleList/index.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/CommonComponents/BubbleList/index.js b/src/components/CommonComponents/BubbleList/index.js index e9095b7c..06f884e9 100644 --- a/src/components/CommonComponents/BubbleList/index.js +++ b/src/components/CommonComponents/BubbleList/index.js @@ -24,8 +24,8 @@ class BubbleList extends PureComponent { super(props); this.state = { list: [] - } - this.hasInitialData = true; + }; + this.hasInitialData = false; this.getDataWhileLoading() } @@ -38,8 +38,8 @@ class BubbleList extends PureComponent { getDataWhileLoading(){ if (this.props.doRender){ - this.getListData() - this.hasInitialData = false; + this.getListData(); + this.hasInitialData = true; } }; @@ -82,7 +82,6 @@ class BubbleList extends PureComponent { }; render() { - console.log('getBubbleListJSX: render'); return {this.getBubbleListJSX()} } } From f01cdc9202ee2b572a53cae1937177ac82e7862a Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Mon, 25 Nov 2019 19:46:08 +0530 Subject: [PATCH 160/302] Bug fixes --- src/components/FanVideoReplyDetails/index.js | 1 + src/components/FullScreenReplyCollection/index.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/components/FanVideoReplyDetails/index.js b/src/components/FanVideoReplyDetails/index.js index 20f97732..81dfdace 100644 --- a/src/components/FanVideoReplyDetails/index.js +++ b/src/components/FanVideoReplyDetails/index.js @@ -44,6 +44,7 @@ class FanVideoReplyDetails extends Component { static navigationOptions = ({ navigation }) => { return { title: 'Post', + headerBackTitle: null, headerStyle: { backgroundColor: Colors.white, borderBottomWidth: 0, diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index a830c455..3ae52174 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -10,6 +10,7 @@ import DataContract from "../../constants/DataContract"; import CommonStyle from "../../theme/styles/Common"; import { SafeAreaView } from "react-navigation"; import ReplyHelper from "../../helpers/ReplyHelper"; +import TopStatus from "../Home/TopStatus"; const maxVideosThreshold = 3; @@ -220,6 +221,7 @@ class FullScreenReplyCollection extends PureComponent{ return ( + Date: Mon, 25 Nov 2019 19:52:05 +0530 Subject: [PATCH 161/302] Bug fix --- src/services/NavigationStateHandler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/NavigationStateHandler.js b/src/services/NavigationStateHandler.js index 04a1a74f..40122bfd 100644 --- a/src/services/NavigationStateHandler.js +++ b/src/services/NavigationStateHandler.js @@ -5,7 +5,7 @@ import Colors from "../theme/styles/Colors"; import NavigationService from './NavigationService'; import AppConfig from '../constants/AppConfig'; -const routesWithoutStatusBar = ['Home', 'HomeScreen', 'VideoPlayer', 'CaptureVideo', 'CaptureImageScreen', 'ImageGalleryScreen', 'UserVideoHistory', 'VideoReplies', 'FullScreenReplyCollection']; +const routesWithoutStatusBar = ['Home', 'HomeScreen', 'VideoPlayer', 'CaptureVideo', 'CaptureImageScreen', 'ImageGalleryScreen', 'UserVideoHistory', 'VideoReplies', 'FullScreenReplyCollection', 'VideoReplyPlayer']; const typesToIgnore = ['Navigation/COMPLETE_TRANSITION', 'Navigation/MARK_DRAWER_SETTLING', 'Navigation/MARK_DRAWER_IDLE', 'Navigation/DRAWER_CLOSED']; const routesAnalyticsMap = AppConfig.routesAnalyticsMap; From e210a77a87d1f5cfa3219e9959fc4f92dae2c742 Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Mon, 25 Nov 2019 20:04:40 +0530 Subject: [PATCH 162/302] extra text --- .../CommonComponents/BubbleList/index.js | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/src/components/CommonComponents/BubbleList/index.js b/src/components/CommonComponents/BubbleList/index.js index 06f884e9..cacc42a1 100644 --- a/src/components/CommonComponents/BubbleList/index.js +++ b/src/components/CommonComponents/BubbleList/index.js @@ -10,6 +10,7 @@ import DataContract from '../../../constants/DataContract'; import PepoApi from "../../../services/PepoApi"; import deepGet from "lodash/get"; import ProfilePicture from "../../ProfilePicture"; +import reduxGetter from "../../../services/ReduxGetters"; // const NO_OF_ITEMS_TO_SHOW = 3; @@ -25,12 +26,12 @@ class BubbleList extends PureComponent { this.state = { list: [] }; - this.hasInitialData = false; - this.getDataWhileLoading() + this.getDataWhileLoading(); + this.replyCount = reduxGetter.getVideoReplyCount(this.props.videoId) } componentDidUpdate(prevProps, prevState ) { - if( this.props.doRender && this.props.doRender !== prevProps.doRender && !this.hasInitialData ){ + if( this.props.doRender && this.props.doRender !== prevProps.doRender ){ this.getListData(); } @@ -39,7 +40,6 @@ class BubbleList extends PureComponent { getDataWhileLoading(){ if (this.props.doRender){ this.getListData(); - this.hasInitialData = true; } }; @@ -49,8 +49,9 @@ class BubbleList extends PureComponent { .then((apiResponse) => { if (apiResponse.success ){ let result_type = deepGet(apiResponse, DataContract.common.resultType), - list = deepGet(apiResponse, `data.${result_type}` ); - this.setState({ list : list.reverse()}); + list = deepGet(apiResponse, `data.${result_type}` ), + listToShowOnUI = list.reverse().slice(0,NO_OF_ITEMS_TO_SHOW); + this.setState({ list : listToShowOnUI } ); } }) @@ -66,10 +67,9 @@ class BubbleList extends PureComponent { return `/videos/${this.props.videoId}/replies`; }; - componentDidMount () {} getBubbleListJSX = () => { - let listToRender = this.state.list.slice(0,NO_OF_ITEMS_TO_SHOW); + let listToRender = this.state.list; return listToRender.length?listToRender.map((item) => { return ; }; + moreReplyText = () => { + + let list = this.state.list; + if (list.length <= this.replyCount ){ + return ''; + } + return `+ ${this.replyCount - list.length} Replies`; + }; + render() { - return {this.getBubbleListJSX()} + return + {this.getBubbleListJSX()} + {this.moreReplyText()} + } } From 6bd4d55f782a034b81860968649ce73701e483de Mon Sep 17 00:00:00 2001 From: sachinchauhan Date: Mon, 25 Nov 2019 20:02:11 +0530 Subject: [PATCH 163/302] Bug fix: Copy change need in case of workFlow cancel - Ex: Cancel Create Session --- src/helpers/TransactionHelper.js | 9 ++++----- src/services/OstErrors.js | 7 ++++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/helpers/TransactionHelper.js b/src/helpers/TransactionHelper.js index 5fa262b3..415ca30c 100644 --- a/src/helpers/TransactionHelper.js +++ b/src/helpers/TransactionHelper.js @@ -1,12 +1,10 @@ import BigNumber from 'bignumber.js'; -import {OstWalletSdk, OstWalletSdkUI, OstJsonApi} from '@ostdotcom/ost-wallet-sdk-react-native'; +import {OstWalletSdk, OstWalletSdkUI} from '@ostdotcom/ost-wallet-sdk-react-native'; import { IS_PRODUCTION, DEFAULT_SESSION_KEY_EXPIRY_TIME, DEFAULT_SPENDING_LIMIT, MAX_SPENDING_LIMIT, HIGH_SPEND_SESSION_KEY_EXPIRY_TIME, MEDIUM_SPEND_SESSION_KEY_EXPIRY_TIME } from '../constants'; import CurrentUser from "../models/CurrentUser"; -import pricer from '../services/Pricer'; -import Toast from '../theme/components/NotificationToast'; import {LoadingModal} from '../theme/components/LoadingModalCover'; import {ostSdkErrors, WORKFLOW_CANCELLED_MSG} from '../services/OstSdkErrors'; import {ostErrors} from "../services/OstErrors"; @@ -14,7 +12,7 @@ import {VideoPlayPauseEmitter} from './Emitters' const ON_USER_CANCLLED_ERROR_MSG = WORKFLOW_CANCELLED_MSG; -const DEVICE_UNAUTHORIZED_ERROR_MSG = "Your device is not authorized to perform transactions";; +const DEVICE_UNAUTHORIZED_ERROR_MSG = "Your device is not authorized to perform transactions"; const bnDefaultSpendingLimit = new BigNumber(DEFAULT_SPENDING_LIMIT); const bnMaxSpendingLimit = new BigNumber(MAX_SPENDING_LIMIT); const bnOne = new BigNumber(1); @@ -108,7 +106,8 @@ const _getWorkflowDelegate = function (callback) { delegate.userCancelled = (ostWorkflowContext, ostError) => { //Do nothing. LoadingModal.hide(); - callback(ON_USER_CANCLLED_ERROR_MSG, false); + let userCancelledMsg = ostErrors.getErrorMessage(ostError); + callback(userCancelledMsg, false); }; delegate.saltFetchFailed = ( response ) => { diff --git a/src/services/OstErrors.js b/src/services/OstErrors.js index ba21baa2..f7093352 100644 --- a/src/services/OstErrors.js +++ b/src/services/OstErrors.js @@ -5,7 +5,8 @@ const sdkErrors = { USER_NOT_ACTIVATED: 'User is not activated.', SESSION_NOT_FOUND: 'Please check your spending limit.', DEVICE_UNAUTHORIZED: 'Device is unauthorized.', - GENERAL_ERROR: 'Something went wrong please try again later.' + GENERAL_ERROR: 'Something went wrong please try again later.', + WORKFLOW_CANCELLED: 'Workflow Cancelled' }; const UIErros = { @@ -35,12 +36,12 @@ const UIErros = { email_error: 'Enter a valid email.', device_unathorized: "Your device is not authorized. Please authorized the device.", top_not_available: "Topup not available at this time, we are looking into it. Please check back later.", - delete_video_error:"Unable to delete Video at this moment.", + delete_video_error:"Unable to delete Video at this moment.", redemption_error : "Failed to redeem, please try again later", max_pepocorns: `Sorry, you don't have enough Pepo Coins to buy this many ${Utilities.getPepoCornsName()}`, price_point_validation_failed: `Sorry, you don't have enough Pepo Coins to buy this many ${Utilities.getPepoCornsName()}`, min_pepocorns: `Minimum amount allowed is 1 ${Utilities.getPepoCornsName()}.`, - bt_exceeds_bal_amount_error : `Sorry, you don't have enough Pepo Coins for this transactions.`, + bt_exceeds_bal_amount_error : `Sorry, you don't have enough Pepo Coins for this transactions.`, video_reply_not_allowed: 'Reply is not allowed for this video.', video_reply_not_allowed_low_bal: "Insufficient balance for reply" }; From 7739b460563961b82061262b8312ae42f9633acf Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Mon, 25 Nov 2019 20:23:17 +0530 Subject: [PATCH 164/302] code changes for navigation --- .../InvertedReplyThumbnailList/index.js | 13 ++++++++++++- .../CommonComponents/VideoReplyPlayer/index.js | 12 ++++++++++-- .../FullScreenReplyCollection/VideoReplyRow.js | 7 ++----- src/components/FullScreenReplyCollection/index.js | 10 ++++++---- src/components/ReplyCollection/index.js | 7 +------ 5 files changed, 31 insertions(+), 18 deletions(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index c4096c89..07c3fc3c 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -8,6 +8,7 @@ import {FlatList} from 'react-native-gesture-handler'; import ReplyHelper from '../../../helpers/ReplyHelper'; import AppConfig from "../../../constants/AppConfig"; import DataContract from '../../../constants/DataContract'; +import ReduxGetters from '../../../services/ReduxGetters'; // const ITEM_HEIGHT = AppConfig.thumbnailListConstants.iconHeight + AppConfig.thumbnailListConstants.iconWidth; @@ -54,6 +55,15 @@ class InvertedReplyList extends PureComponent { this.setClickHandlers(); } + parentClickHandler =()=>{ + const parentVideoId = this.props.videoId, + parentUserId = ReduxGetters.getVideoCreatorUserId(parentVideoId); + this.props.navigation.push('VideoPlayer', { + userId: parentUserId, + videoId: parentVideoId + }); + } + defaultChildClickHandler = ( index, item )=> { const baseUrl = DataContract.replies.getReplyListApi(this.props.videoId), clonedInstance = this.getPagination().fetchServices.cloneInstance(); @@ -61,7 +71,8 @@ class InvertedReplyList extends PureComponent {     this.props.navigation.push('FullScreenReplyCollection',{       "fetchServices": clonedInstance,       "currentIndex":index, -      "baseUrl": baseUrl +      "baseUrl": baseUrl, + "parentClickHandler": this.parentClickHandler     });   }; diff --git a/src/components/CommonComponents/VideoReplyPlayer/index.js b/src/components/CommonComponents/VideoReplyPlayer/index.js index 291152db..c927fc62 100644 --- a/src/components/CommonComponents/VideoReplyPlayer/index.js +++ b/src/components/CommonComponents/VideoReplyPlayer/index.js @@ -4,7 +4,6 @@ import deepGet from "lodash/get"; import PepoApi from "../../../services/PepoApi"; import Utilities from '../../../services/Utilities'; import reduxGetter from '../../../services/ReduxGetters'; -import ReduxGetters from '../../../services/ReduxGetters'; import DataContract from '../../../constants/DataContract'; import DeletedVideoInfo from '../DeletedVideoInfo'; import VideoReplyRow from '../../FullScreenReplyCollection/VideoReplyRow'; @@ -25,7 +24,7 @@ class VideoReplyPlayer extends PureComponent { constructor(props){ super(props); this.replyDetailId = this.props.navigation.getParam('replyDetailId'); - this.videoId = ReduxGetters.getReplyEntityId(this.replyDetailId); //Check for entity deleted + this.videoId = reduxGetter.getReplyEntityId(this.replyDetailId); //Check for entity deleted this.state = { userId : this.props.navigation.getParam('userId') || null, isDeleted : reduxGetter.isVideoEntityDeleted(this.videoId) @@ -89,6 +88,14 @@ class VideoReplyPlayer extends PureComponent { }; } + parentClickHandler =()=>{ + const parentVideoId = reduxGetter.getReplyParentVideoId(this.replyDetailId); + this.props.navigation.push('VideoPlayer', { + userId: this.state.userId, + videoId: parentVideoId + }); + } + render() { if(this.state.isDeleted){ return @@ -102,6 +109,7 @@ class VideoReplyPlayer extends PureComponent { userId={this.state.userId} replyDetailId={this.replyDetailId} getPixelDropData={this.getPixelDropData} + parentClickHandler={this.parentClickHandler} /> diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index a4389d3b..4b41f535 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -39,7 +39,7 @@ const mapStateToProps = (state, ownProps) => { class VideoReplyRow extends PureComponent { constructor(props) { super(props); - this.onParentClickDelegate = this.props.onParentClickDelegate || this.defaultParentClickHandler; + this.onParentClickDelegate = this.props.parentClickHandler || this.defaultParentClickHandler; } refetchVideoReply = () => { @@ -56,10 +56,7 @@ class VideoReplyRow extends PureComponent { } defaultParentClickHandler(){ - this.props.navigation.push('VideoPlayer', { - userId: this.props.parentUserId, - videoId: this.props.parentVideoId - }) + this.props.navigation.goBack(null); } render() { diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index 3ae52174..095c3231 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -164,8 +164,9 @@ class FullScreenReplyCollection extends PureComponent{ replyDetailId={replyDetailId} paginationService ={this.getVideoPagination()} onChildClickDelegate={this.childClickHandler} - onParentClickDelegate={this.parentClickHandler} + parentClickHandler={this.parentClickHandler} currentIndex={this.state.activeIndex} + // conditional delegate /> ; } @@ -176,7 +177,7 @@ class FullScreenReplyCollection extends PureComponent{ scrollToIndex = ( index )=>{ this.flatlistRef.scrollToIndex({index: index}); - this.setActiveIndex(); + this.setActiveIndex( index ); } onViewableItemsChanged = (data) => { @@ -185,8 +186,9 @@ class FullScreenReplyCollection extends PureComponent{ this.currentIndex = deepGet(data, 'viewableItems[0].index') || 0; } - setActiveIndex() { - this.setState({ activeIndex: this.currentIndex }); + setActiveIndex( index ) { + index = index || this.currentIndex; + this.setState({ activeIndex: index }); } onMomentumScrollEndCallback = () => { diff --git a/src/components/ReplyCollection/index.js b/src/components/ReplyCollection/index.js index f9baf427..361728c6 100644 --- a/src/components/ReplyCollection/index.js +++ b/src/components/ReplyCollection/index.js @@ -214,15 +214,10 @@ class ReplyCollection extends PureComponent { this.props.navigation.push("FullScreenReplyCollection", { "fetchServices" : clonedInstance, "currentIndex": index, - "baseUrl": this.props.fetchUrl, - "parentClickHandler": this.parentClickHandler + "baseUrl": this.props.fetchUrl }); } - parentClickHandler(){ - this.props.navigation.goBack(null); - } - renderFooter = () => { if (!this.state.loadingNext) return null; return ; From fb89e4be25fb5d4c83df6ea2200468fab0498d7c Mon Sep 17 00:00:00 2001 From: sachinchauhan Date: Mon, 25 Nov 2019 20:35:08 +0530 Subject: [PATCH 165/302] Enhancement: Cross icon is not present on reply video screen --- src/components/VideoRecorder/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/VideoRecorder/index.js b/src/components/VideoRecorder/index.js index 90c4729b..1bcdb4b0 100644 --- a/src/components/VideoRecorder/index.js +++ b/src/components/VideoRecorder/index.js @@ -184,6 +184,9 @@ class VideoRecorder extends Component { if (! this.state.hasVideoReplies){ // Show video return + + + From be56bd949ae1e081a268ee8d32da942fdb7c6289 Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Mon, 25 Nov 2019 21:01:10 +0530 Subject: [PATCH 166/302] reply bubbles UI --- .../CommonComponents/BubbleList/index.js | 19 +++++---- .../CommonComponents/BubbleList/styles.js | 39 +++++++++++++++++++ 2 files changed, 48 insertions(+), 10 deletions(-) diff --git a/src/components/CommonComponents/BubbleList/index.js b/src/components/CommonComponents/BubbleList/index.js index cacc42a1..657769a2 100644 --- a/src/components/CommonComponents/BubbleList/index.js +++ b/src/components/CommonComponents/BubbleList/index.js @@ -1,4 +1,5 @@ import React, { PureComponent } from 'react'; +import inlineStyles from './styles'; import { Text, View, ScrollView, ListView, Dimensions} from 'react-native'; import { withNavigation } from 'react-navigation'; @@ -71,13 +72,11 @@ class BubbleList extends PureComponent { getBubbleListJSX = () => { let listToRender = this.state.list; return listToRender.length?listToRender.map((item) => { - return + return + + }): <> ; }; @@ -91,9 +90,9 @@ class BubbleList extends PureComponent { }; render() { - return - {this.getBubbleListJSX()} - {this.moreReplyText()} + return + {this.getBubbleListJSX()} + {this.moreReplyText()} } } diff --git a/src/components/CommonComponents/BubbleList/styles.js b/src/components/CommonComponents/BubbleList/styles.js index e69de29b..fef5e453 100644 --- a/src/components/CommonComponents/BubbleList/styles.js +++ b/src/components/CommonComponents/BubbleList/styles.js @@ -0,0 +1,39 @@ +import DefaultStyleGenerator from '../../../theme/styles/DefaultStyleGenerator'; +import Colors from '../../../theme/styles/Colors'; + +let stylesMap = { + + bubbleShadow: { + shadowColor: Colors.wildWatermelon2, + shadowOffset: { width: 0, height: 0 }, + shadowOpacity: 0.8, + shadowRadius: 5, + elevation: 3, + borderColor: Colors.wildWatermelon2, + borderWidth: .5, + borderRadius: 20 + }, + + bubbleSize: { + height: 38, + width: 38, + borderColor: 'white', + borderWidth: 1, + borderRadius: 20 + }, + + bubbleContainer: { + flexDirection:'row', + marginLeft: 25, + alignItems: 'center' + }, + + repliesTxt: { + color: 'white', + fontSize: 16, + fontFamily: 'AvenirNext-DemiBold' + } + +}; + +export default styles = DefaultStyleGenerator.generate(stylesMap); From ba63100f28a9e73d0e4308bb1e57a2d2ead37698 Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Mon, 25 Nov 2019 21:12:18 +0530 Subject: [PATCH 167/302] bubble UI --- src/components/CommonComponents/BubbleList/index.js | 2 +- src/components/CommonComponents/BubbleList/styles.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/CommonComponents/BubbleList/index.js b/src/components/CommonComponents/BubbleList/index.js index 657769a2..e5f75699 100644 --- a/src/components/CommonComponents/BubbleList/index.js +++ b/src/components/CommonComponents/BubbleList/index.js @@ -72,7 +72,7 @@ class BubbleList extends PureComponent { getBubbleListJSX = () => { let listToRender = this.state.list; return listToRender.length?listToRender.map((item) => { - return + return diff --git a/src/components/CommonComponents/BubbleList/styles.js b/src/components/CommonComponents/BubbleList/styles.js index fef5e453..a5421c81 100644 --- a/src/components/CommonComponents/BubbleList/styles.js +++ b/src/components/CommonComponents/BubbleList/styles.js @@ -24,7 +24,7 @@ let stylesMap = { bubbleContainer: { flexDirection:'row', - marginLeft: 25, + marginLeft: 30, alignItems: 'center' }, From f65a3476d65e70d249a96d797996de2a2337ab62 Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Mon, 25 Nov 2019 21:42:27 +0530 Subject: [PATCH 168/302] reply bubble --- src/components/CommonComponents/BubbleList/index.js | 11 ++++++----- .../FullScreenVideoCollection/FullScreenVideoRow.js | 10 ++++++---- .../UserVideoHistory/UserVideoHistoryRow.js | 10 ++++++---- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/components/CommonComponents/BubbleList/index.js b/src/components/CommonComponents/BubbleList/index.js index e5f75699..9cf8434e 100644 --- a/src/components/CommonComponents/BubbleList/index.js +++ b/src/components/CommonComponents/BubbleList/index.js @@ -28,7 +28,6 @@ class BubbleList extends PureComponent { list: [] }; this.getDataWhileLoading(); - this.replyCount = reduxGetter.getVideoReplyCount(this.props.videoId) } componentDidUpdate(prevProps, prevState ) { @@ -52,6 +51,7 @@ class BubbleList extends PureComponent { let result_type = deepGet(apiResponse, DataContract.common.resultType), list = deepGet(apiResponse, `data.${result_type}` ), listToShowOnUI = list.reverse().slice(0,NO_OF_ITEMS_TO_SHOW); + this.replyCount = reduxGetter.getVideoReplyCount(this.props.videoId) this.setState({ list : listToShowOnUI } ); } @@ -64,7 +64,6 @@ class BubbleList extends PureComponent { getFetchUrl = () => { - return `/videos/${4266}/replies`; return `/videos/${this.props.videoId}/replies`; }; @@ -83,10 +82,12 @@ class BubbleList extends PureComponent { moreReplyText = () => { let list = this.state.list; - if (list.length <= this.replyCount ){ - return ''; + if (! this.replyCount || ! list.length){ + return '' + } + if (this.replyCount > list.length){ + return ` + ${this.replyCount - list.length} Replies`; } - return `+ ${this.replyCount - list.length} Replies`; }; render() { diff --git a/src/components/FullScreenVideoCollection/FullScreenVideoRow.js b/src/components/FullScreenVideoCollection/FullScreenVideoRow.js index 10d94eca..e4438f7f 100644 --- a/src/components/FullScreenVideoCollection/FullScreenVideoRow.js +++ b/src/components/FullScreenVideoCollection/FullScreenVideoRow.js @@ -21,6 +21,7 @@ import assignIn from 'lodash/assignIn'; import AppConfig from "../../constants/AppConfig"; import CommonStyle from "../../theme/styles/Common"; import InvertedReplyList from "../CommonComponents/InvertedReplyThumbnailList"; +import BubbleList from "../CommonComponents/BubbleList"; const AREA = AppConfig.MaxDescriptionArea; @@ -66,10 +67,11 @@ class FullScreeVideoRow extends PureComponent { - + {/**/} + diff --git a/src/components/UserVideoHistory/UserVideoHistoryRow.js b/src/components/UserVideoHistory/UserVideoHistoryRow.js index 9f15d0f3..6380e164 100644 --- a/src/components/UserVideoHistory/UserVideoHistoryRow.js +++ b/src/components/UserVideoHistory/UserVideoHistoryRow.js @@ -19,6 +19,7 @@ import CommonStyle from "../../theme/styles/Common"; import assignIn from 'lodash/assignIn'; import InvertedReplyList from "../CommonComponents/InvertedReplyThumbnailList"; import AppConfig from "../../constants/AppConfig"; +import BubbleList from "../CommonComponents/BubbleList"; const AREA = AppConfig.MaxDescriptionArea; @@ -77,10 +78,11 @@ class UserVideoHistoryRow extends PureComponent { - + {/**/} + From 6246c98b2ad14a61a6669d0277aba2bdb6cfe6bd Mon Sep 17 00:00:00 2001 From: Akshay Raje Date: Mon, 25 Nov 2019 21:43:17 +0530 Subject: [PATCH 169/302] videoDescriptionId fix + Analytics --- src/components/BottomStatus/Base.js | 7 +++---- src/constants/AppConfig.js | 4 +++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/BottomStatus/Base.js b/src/components/BottomStatus/Base.js index b130abc8..d9a20e07 100644 --- a/src/components/BottomStatus/Base.js +++ b/src/components/BottomStatus/Base.js @@ -13,7 +13,6 @@ import CurrentUser from '../../models/CurrentUser'; class BottomStatus extends PureComponent { constructor(props) { super(props); - this.videoDescriptionId = reduxGetter.getVideoDescriptionId(this.props.entityId); } onLinkClick = () => { @@ -129,15 +128,15 @@ class BottomStatus extends PureComponent { let tagLocation = processingString.search(item); let prevText = processingString.slice(0, tagLocation); processingString = processingString.slice(tagLocation + item.length); - if (this.isValidTag(this.videoDescriptionId, item)) { + if (this.isValidTag(this.props.entityDescriptionId, item)) { return this.getHashTagMarkup(item, prevText); - } if( this.isValidMention(this.videoDescriptionId , item) ){ + } if( this.isValidMention(this.props.entityDescriptionId , item) ){ return this.getMentionMarkup(item, prevText); }else { return this.getTextMarkup(item, prevText); } }))} - + {processingString} diff --git a/src/constants/AppConfig.js b/src/constants/AppConfig.js index 7b861429..680a3c1d 100644 --- a/src/constants/AppConfig.js +++ b/src/constants/AppConfig.js @@ -323,7 +323,9 @@ export default { RedemptionSuccess: 'Redemption/Success', CouchMarks: 'CouchMarks', AuthDeviceDrawer: 'DeviceUnauthorized', - TwitterLogin: 'TwitterLogin' + TwitterLogin: 'TwitterLogin', + FullScreenReplyCollection: 'FullScreenReplyCollection', + VideoReplies: 'VideoReplies' }, default_bt_amt : 10, From 7af523316d7ae11a71743c52091ea0e8af23f254 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Mon, 25 Nov 2019 21:57:07 +0530 Subject: [PATCH 170/302] code change --- .../CommonComponents/BubbleList/index.js | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/components/CommonComponents/BubbleList/index.js b/src/components/CommonComponents/BubbleList/index.js index e5f75699..c5fa504f 100644 --- a/src/components/CommonComponents/BubbleList/index.js +++ b/src/components/CommonComponents/BubbleList/index.js @@ -1,10 +1,9 @@ import React, { PureComponent } from 'react'; import inlineStyles from './styles'; -import { Text, View, ScrollView, ListView, Dimensions} from 'react-native'; +import { Text, View, TouchableOpacity, ListView, Dimensions} from 'react-native'; import { withNavigation } from 'react-navigation'; import Pagination from "../../../services/Pagination"; -import {FlatList} from 'react-native-gesture-handler'; import ReplyHelper from '../../../helpers/ReplyHelper'; import AppConfig from "../../../constants/AppConfig"; import DataContract from '../../../constants/DataContract'; @@ -12,6 +11,7 @@ import PepoApi from "../../../services/PepoApi"; import deepGet from "lodash/get"; import ProfilePicture from "../../ProfilePicture"; import reduxGetter from "../../../services/ReduxGetters"; +import multipleClickHandler from '../../../services/MultipleClickHandler'; // const NO_OF_ITEMS_TO_SHOW = 3; @@ -28,7 +28,8 @@ class BubbleList extends PureComponent { list: [] }; this.getDataWhileLoading(); - this.replyCount = reduxGetter.getVideoReplyCount(this.props.videoId) + this.replyCount = reduxGetter.getVideoReplyCount(this.props.videoId); + this.onClickHandler = this.props.onClickHandler || this.defaultClickHandler; } componentDidUpdate(prevProps, prevState ) { @@ -64,7 +65,6 @@ class BubbleList extends PureComponent { getFetchUrl = () => { - return `/videos/${4266}/replies`; return `/videos/${this.props.videoId}/replies`; }; @@ -89,9 +89,18 @@ class BubbleList extends PureComponent { return `+ ${this.replyCount - list.length} Replies`; }; + defaultClickHandler= ()=> { + const baseUrl = DataContract.replies.getReplyListApi(this.props.videoId); +    this.props.navigation.push('FullScreenReplyCollection',{ +      "baseUrl": baseUrl +    }); + } + render() { return - {this.getBubbleListJSX()} + {this.onClickHandler()})} + style={{flexDirection: 'row-reverse', marginRight: 5}}>{this.getBubbleListJSX()} + {this.moreReplyText()} } @@ -99,4 +108,4 @@ class BubbleList extends PureComponent { //make this component available to the app -export default BubbleList; +export default withNavigation(BubbleList); From 3510133f38be974fded62c7a824e9ad3dd856b52 Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Mon, 25 Nov 2019 21:59:32 +0530 Subject: [PATCH 171/302] fix for user profile vidoes flatlist height --- .../CommonComponents/UserProfileFlatList/index.js | 2 +- src/theme/styles/Common.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/CommonComponents/UserProfileFlatList/index.js b/src/components/CommonComponents/UserProfileFlatList/index.js index ca68c851..fed87747 100644 --- a/src/components/CommonComponents/UserProfileFlatList/index.js +++ b/src/components/CommonComponents/UserProfileFlatList/index.js @@ -182,7 +182,7 @@ class UserProfileFlatList extends PureComponent { render(){ return( - + {this.listRef = ref } } ListHeaderComponent={this.listHeaderComponent()} diff --git a/src/theme/styles/Common.js b/src/theme/styles/Common.js index 7c05d4b6..67bff46d 100644 --- a/src/theme/styles/Common.js +++ b/src/theme/styles/Common.js @@ -1,16 +1,16 @@ import { ifIphoneX , getBottomSpace} from 'react-native-iphone-x-helper'; import { Dimensions, StatusBar , NativeModules } from 'react-native'; - import NotchHelper from "../../helpers/NotchHelper"; -const {width, height} = Dimensions.get('window'); +import DefaultStyleGenerator from './DefaultStyleGenerator'; +import Colors from './Colors'; + + let RNDeviceInfo = NativeModules.RNDeviceInfo; let modalDeviceName = RNDeviceInfo.model === "Redmi Note 7 Pro" && RNDeviceInfo.brand === "xiaomi"; let btmSpace = modalDeviceName ? 5 : 0; import { CUSTOM_TAB_Height } from '../../theme/constants'; const statusBarHeight = StatusBar.currentHeight; - -import DefaultStyleGenerator from './DefaultStyleGenerator'; -import Colors from './Colors'; +const {width, height} = Dimensions.get('window'); const styles = { viewContainer: { From 58e86d7b1e24f6fe818b17c77c1d0aaa1195dd6e Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Mon, 25 Nov 2019 22:01:01 +0530 Subject: [PATCH 172/302] code changes --- .../InvertedReplyThumbnailList/index.js | 9 +++++++-- src/components/CommonComponents/VideoPlayer/index.js | 4 +++- src/components/FullScreenReplyCollection/index.js | 6 ++++++ .../FullScreenVideoCollection/FullScreenVideoRow.js | 10 +++++----- .../UserVideoHistory/UserVideoHistoryRow.js | 12 ++++++------ 5 files changed, 27 insertions(+), 14 deletions(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index 07c3fc3c..8efb9aec 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -55,12 +55,17 @@ class InvertedReplyList extends PureComponent { this.setClickHandlers(); } + bubbleClickHandler = ()=> { + this.props.navigation.goBack(null); + } + parentClickHandler =()=>{ const parentVideoId = this.props.videoId, parentUserId = ReduxGetters.getVideoCreatorUserId(parentVideoId); this.props.navigation.push('VideoPlayer', { userId: parentUserId, - videoId: parentVideoId + videoId: parentVideoId, + bubbleClickHandler: this.bubbleClickHandler }); } @@ -82,7 +87,7 @@ class InvertedReplyList extends PureComponent { if( !this.paginationService || !( this.paginationService instanceof Pagination)){ this.paginationService = new Pagination(fetchUrl); if( this.props.doRender ){ - this.initPagination() + this.initPagination(); }else { //Load data later this.hasInitialData = false; diff --git a/src/components/CommonComponents/VideoPlayer/index.js b/src/components/CommonComponents/VideoPlayer/index.js index a55005de..277666c7 100644 --- a/src/components/CommonComponents/VideoPlayer/index.js +++ b/src/components/CommonComponents/VideoPlayer/index.js @@ -23,6 +23,7 @@ class VideoPlayer extends Component { constructor(props){ super(props); this.videoId = this.props.navigation.getParam('videoId'); + this.bubbleClickHandler = this.props.navigation.getParam('bubbleClickHandler'); this.state = { userId : this.props.navigation.getParam('userId') || null, isDeleted : reduxGetter.isVideoDeleted(this.videoId) @@ -84,7 +85,8 @@ class VideoPlayer extends Component { + videoId={this.videoId} userId={this.state.userId} getPixelDropData={this.getPixelDropData} + bubbleClickHandler={this.bubbleClickHandler}/> ) diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index 095c3231..837a6656 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -76,6 +76,12 @@ class FullScreenReplyCollection extends PureComponent{ this.willBlurSubscription = this.props.navigation.addListener('willBlur', (payload) => { this.isActiveScreen = false ; }); + + //If there is no getPassedFetchServices passed that means its a fresh view. + //So load data + if(!this.getPassedFetchServices()){ + this.refresh(); + } } componentWillUnmount(){ diff --git a/src/components/FullScreenVideoCollection/FullScreenVideoRow.js b/src/components/FullScreenVideoCollection/FullScreenVideoRow.js index e4438f7f..200211a3 100644 --- a/src/components/FullScreenVideoCollection/FullScreenVideoRow.js +++ b/src/components/FullScreenVideoCollection/FullScreenVideoRow.js @@ -67,11 +67,11 @@ class FullScreeVideoRow extends PureComponent { - {/**/} - + {/* */} + diff --git a/src/components/UserVideoHistory/UserVideoHistoryRow.js b/src/components/UserVideoHistory/UserVideoHistoryRow.js index 6380e164..3bae5b1e 100644 --- a/src/components/UserVideoHistory/UserVideoHistoryRow.js +++ b/src/components/UserVideoHistory/UserVideoHistoryRow.js @@ -19,7 +19,7 @@ import CommonStyle from "../../theme/styles/Common"; import assignIn from 'lodash/assignIn'; import InvertedReplyList from "../CommonComponents/InvertedReplyThumbnailList"; import AppConfig from "../../constants/AppConfig"; -import BubbleList from "../CommonComponents/BubbleList"; +import BubbleList from '../CommonComponents/BubbleList'; const AREA = AppConfig.MaxDescriptionArea; @@ -78,11 +78,11 @@ class UserVideoHistoryRow extends PureComponent { - {/**/} - + {/* */} + From 2f82e42174b647e96d744e7e383e6eb717a3eeb7 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Mon, 25 Nov 2019 22:06:54 +0530 Subject: [PATCH 173/302] minor fix --- src/components/UserVideoHistory/UserVideoHistoryRow.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/UserVideoHistory/UserVideoHistoryRow.js b/src/components/UserVideoHistory/UserVideoHistoryRow.js index 3bae5b1e..5b28fe1d 100644 --- a/src/components/UserVideoHistory/UserVideoHistoryRow.js +++ b/src/components/UserVideoHistory/UserVideoHistoryRow.js @@ -82,7 +82,7 @@ class UserVideoHistoryRow extends PureComponent { userId={this.props.userId} doRender={this.props.doRender} /> */} - + From 51d29f5cd1f8dc49ea26a085185950ec42c87f7e Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Mon, 25 Nov 2019 22:21:47 +0530 Subject: [PATCH 174/302] fix --- src/components/CommonComponents/BubbleList/index.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/components/CommonComponents/BubbleList/index.js b/src/components/CommonComponents/BubbleList/index.js index 71bbfe34..689b8ff4 100644 --- a/src/components/CommonComponents/BubbleList/index.js +++ b/src/components/CommonComponents/BubbleList/index.js @@ -1,11 +1,8 @@ import React, { PureComponent } from 'react'; import inlineStyles from './styles'; -import { Text, View, TouchableOpacity, ListView, Dimensions} from 'react-native'; +import { Text, View, TouchableOpacity} from 'react-native'; import { withNavigation } from 'react-navigation'; -import Pagination from "../../../services/Pagination"; -import ReplyHelper from '../../../helpers/ReplyHelper'; -import AppConfig from "../../../constants/AppConfig"; import DataContract from '../../../constants/DataContract'; import PepoApi from "../../../services/PepoApi"; import deepGet from "lodash/get"; @@ -72,8 +69,9 @@ class BubbleList extends PureComponent { getBubbleListJSX = () => { let listToRender = this.state.list; return listToRender.length?listToRender.map((item) => { + let userId = deepGet(item,'payload.user_id'); return - From 5479cad6ef8fde98bf9fc59f9cc1c408fe465515 Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Mon, 25 Nov 2019 22:40:01 +0530 Subject: [PATCH 175/302] bubble change --- src/components/CommonComponents/BubbleList/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/CommonComponents/BubbleList/index.js b/src/components/CommonComponents/BubbleList/index.js index 689b8ff4..115a516a 100644 --- a/src/components/CommonComponents/BubbleList/index.js +++ b/src/components/CommonComponents/BubbleList/index.js @@ -48,7 +48,7 @@ class BubbleList extends PureComponent { if (apiResponse.success ){ let result_type = deepGet(apiResponse, DataContract.common.resultType), list = deepGet(apiResponse, `data.${result_type}` ), - listToShowOnUI = list.reverse().slice(0,NO_OF_ITEMS_TO_SHOW); + listToShowOnUI = list.slice(0,NO_OF_ITEMS_TO_SHOW); this.replyCount = reduxGetter.getVideoReplyCount(this.props.videoId) this.setState({ list : listToShowOnUI } ); } From d3060a21d70510ca5e18a480cc90e1fe2888a420 Mon Sep 17 00:00:00 2001 From: sachinchauhan Date: Mon, 25 Nov 2019 21:42:42 +0530 Subject: [PATCH 176/302] Bug fix: Pepo Amount of video is not showing on any video in video thumnail list page. i.e, On tag page or profile page or reply tray. --- .../VideoThumbnail/ReplyThumbnail.js | 13 ++++++++++--- .../VideoThumbnail/VideoThumbnail.js | 13 ++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/components/CommonComponents/VideoThumbnail/ReplyThumbnail.js b/src/components/CommonComponents/VideoThumbnail/ReplyThumbnail.js index c935c2a9..6004c315 100644 --- a/src/components/CommonComponents/VideoThumbnail/ReplyThumbnail.js +++ b/src/components/CommonComponents/VideoThumbnail/ReplyThumbnail.js @@ -3,21 +3,28 @@ import React, { PureComponent } from 'react'; import reduxGetters from '../../../services/ReduxGetters'; import AppConfig from '../../../constants/AppConfig'; import deepGet from "lodash/get"; +import Pricer from "../../../services/Pricer"; class ReplyThumbnail extends PureComponent { constructor(props){ super(props); } + getVideoStats(videoId) { + let videoBt = reduxGetters.getVideoBt(videoId); + return Pricer.getFromDecimal(videoBt) || 0; + } + render(){ const replyId = deepGet(this.props , "payload.reply_detail_id"), userId = deepGet(this.props , "payload.user_id") , videoId = reduxGetters.getReplyEntityId( replyId ), userName = reduxGetters.getUserName(userId), imageUrl = reduxGetters.getVideoImgUrl(videoId, null, AppConfig.userVideos.userScreenCoverImageWidth) , - videoDesc = reduxGetters.getVideoDescription(reduxGetters.getReplyDescriptionId(videoId)) + videoDesc = reduxGetters.getVideoDescription(reduxGetters.getReplyDescriptionId(videoId)) , + videoBtAmount = this.getVideoStats(videoId) ; - return ; + return ; } } -export default ReplyThumbnail; \ No newline at end of file +export default ReplyThumbnail; diff --git a/src/components/CommonComponents/VideoThumbnail/VideoThumbnail.js b/src/components/CommonComponents/VideoThumbnail/VideoThumbnail.js index 09ec7aa3..97e1ff19 100644 --- a/src/components/CommonComponents/VideoThumbnail/VideoThumbnail.js +++ b/src/components/CommonComponents/VideoThumbnail/VideoThumbnail.js @@ -3,20 +3,27 @@ import React, { PureComponent } from 'react'; import reduxGetters from '../../../services/ReduxGetters'; import AppConfig from '../../../constants/AppConfig'; import deepGet from "lodash/get"; +import Pricer from "../../../services/Pricer"; class VideoThumbnail extends PureComponent { constructor(props){ super(props); } + getVideoStats(videoId) { + let videoBt = reduxGetters.getVideoBt(videoId); + return Pricer.getFromDecimal(videoBt) || 0; + } + render(){ const videoId = deepGet(this.props , "payload.video_id"), userId = deepGet(this.props , "payload.user_id") , userName = reduxGetters.getUserName(userId), imageUrl = reduxGetters.getVideoImgUrl(videoId, null, AppConfig.userVideos.userScreenCoverImageWidth) , - videoDesc = reduxGetters.getVideoDescription(reduxGetters.getVideoDescriptionId(videoId)) + videoDesc = reduxGetters.getVideoDescription(reduxGetters.getVideoDescriptionId(videoId)) , + videoBtAmount = this.getVideoStats(videoId) ; - return ; + return ; } } -export default VideoThumbnail; \ No newline at end of file +export default VideoThumbnail; From 3c460148859db0bcfa5e10a7198fc08d80ff3fdb Mon Sep 17 00:00:00 2001 From: sachinchauhan Date: Mon, 25 Nov 2019 22:00:52 +0530 Subject: [PATCH 177/302] Bug fix: Pepo Amount of video is not showing on any video in video thumbnail list page. i.e, On tag page or profile page or reply tray. --- .../CommonComponents/VideoThumbnail/ReplyThumbnail.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/CommonComponents/VideoThumbnail/ReplyThumbnail.js b/src/components/CommonComponents/VideoThumbnail/ReplyThumbnail.js index 6004c315..279ad439 100644 --- a/src/components/CommonComponents/VideoThumbnail/ReplyThumbnail.js +++ b/src/components/CommonComponents/VideoThumbnail/ReplyThumbnail.js @@ -10,9 +10,9 @@ class ReplyThumbnail extends PureComponent { super(props); } - getVideoStats(videoId) { - let videoBt = reduxGetters.getVideoBt(videoId); - return Pricer.getFromDecimal(videoBt) || 0; + getReplyStats(replyId) { + let replyBt = reduxGetters.getReplyBt(replyId); + return Pricer.getFromDecimal(replyBt) || 0; } render(){ @@ -22,9 +22,9 @@ class ReplyThumbnail extends PureComponent { userName = reduxGetters.getUserName(userId), imageUrl = reduxGetters.getVideoImgUrl(videoId, null, AppConfig.userVideos.userScreenCoverImageWidth) , videoDesc = reduxGetters.getVideoDescription(reduxGetters.getReplyDescriptionId(videoId)) , - videoBtAmount = this.getVideoStats(videoId) + replyBtAmount = this.getReplyStats(replyId) ; - return ; + return ; } } export default ReplyThumbnail; From d6c60acd9b0d119b2cfc37a21fb7d6fe06fd41ea Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Tue, 26 Nov 2019 12:30:43 +0530 Subject: [PATCH 178/302] Minor fix --- .../CommonComponents/DeleteVideo/index.js | 9 ++++---- .../UserProfileFlatList/index.js | 5 +++-- src/components/ReplyCollection/index.js | 7 +++--- src/components/VideoCollections/index.js | 22 ++----------------- 4 files changed, 13 insertions(+), 30 deletions(-) diff --git a/src/components/CommonComponents/DeleteVideo/index.js b/src/components/CommonComponents/DeleteVideo/index.js index acb2407b..ddb61f13 100644 --- a/src/components/CommonComponents/DeleteVideo/index.js +++ b/src/components/CommonComponents/DeleteVideo/index.js @@ -19,14 +19,13 @@ export default class DeleteVideo extends Component { super(props); } - deleteUser = () => { - if(!this.props.videoId) return; + deleteEntity = () => { + if(!this.props.fetchUrl) return; new PepoApi(this.props.fetchUrl) .post() .then((response) => { - if (response && response.success){ - this.props.removeVideo && this.props.removeVideo(this.props.videoId); + this.props.removeVideo && this.props.removeVideo(); Toast.show({text:'Video deleted successfully!', icon: 'success'}); } else { Toast.show({text:ostErrors.getUIErrorMessage('delete_video_error'), icon: 'error'}); @@ -43,7 +42,7 @@ export default class DeleteVideo extends Component { '', 'Are you sure to delete video?', [ - {text: 'Delete', onPress: () => this.deleteUser() }, + {text: 'Delete', onPress: () => this.deleteEntity() }, { text: 'Cancel', style: 'cancel' diff --git a/src/components/CommonComponents/UserProfileFlatList/index.js b/src/components/CommonComponents/UserProfileFlatList/index.js index fed87747..16077e1a 100644 --- a/src/components/CommonComponents/UserProfileFlatList/index.js +++ b/src/components/CommonComponents/UserProfileFlatList/index.js @@ -132,7 +132,7 @@ class UserProfileFlatList extends PureComponent { let array = [...this.state.list]; // make a separate copy of the array array.splice(index, 1); this.setState({list: array}); - this.props.onDelete(array); + this.props.onDelete && this.props.onDelete(array); } } @@ -149,7 +149,8 @@ class UserProfileFlatList extends PureComponent { style={{width: (Dimensions.get('window').width - 6) / 2, margin: 1, position: 'absolute', top: 0, left: 0, zIndex: 1, alignItems: 'flex-end'}} > - {this.removeVideo(videoId , index )}} /> + {this.removeVideo(videoId , index )}} /> } - {this.removeVideo(videoId , index )}} /> + {this.removeVideo(reply_detail_id , index )}} /> } {this.onVideoClick(index)}}/> @@ -200,9 +201,9 @@ class ReplyCollection extends PureComponent { return userId === CurrentUser.getUserId(); } - removeVideo = (videoId, index) => { + removeVideo = (id, index) => { if (index > -1) { - this.videoPagination.deleteItem(videoId , "payload.reply_detail_id"); + this.videoPagination.deleteItem(id , "payload.reply_detail_id"); let array = [...this.state.list]; // make a separate copy of the array array.splice(index, 1); this.setState({list: array}); diff --git a/src/components/VideoCollections/index.js b/src/components/VideoCollections/index.js index b501b739..de6e0eaf 100644 --- a/src/components/VideoCollections/index.js +++ b/src/components/VideoCollections/index.js @@ -2,7 +2,6 @@ import React, { PureComponent } from 'react'; import { ActivityIndicator , FlatList} from "react-native"; import {SafeAreaView} from "react-navigation"; import Pagination from "../../services/Pagination"; -import deepGet from 'lodash/get'; import CommonStyle from "../../theme/styles/Common"; import VideoThumbnail from '../CommonComponents/VideoThumbnail/VideoThumbnail'; @@ -97,8 +96,7 @@ class VideoCollections extends PureComponent { } beforeRefresh = ( ) => { - //this.props.beforeRefresh && this.props.beforeRefresh(); - //this.onPullToRefresh(); + this.props.beforeRefresh && this.props.beforeRefresh(); this.setState({ refreshing : true }); }; @@ -164,23 +162,7 @@ class VideoCollections extends PureComponent { }; _renderVideoReplyThumbnail( item, index ) { - const userId = deepGet(item, "payload.user_id"); - const reply_detail_id = deepGet(item,`payload.${DataContract.replies.replyDetailIdKey}`); - const videoId = ReduxGetters.getReplyId(reply_detail_id); - return ( - {this.isCurrentUser( userId ) && - - {this.removeVideo(videoId , index )}} /> - - } - {this.onVideoClick(index)}}/> - ); + return ( {this.onVideoClick(index)}}/>); } _renderVideoThumbnail( item, index){ From 93578a653923b6c3a69b98c4d8ae4b59a46bd1d2 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Tue, 26 Nov 2019 12:46:58 +0530 Subject: [PATCH 179/302] Minor fix --- src/components/ReplyCollection/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ReplyCollection/index.js b/src/components/ReplyCollection/index.js index 02bae02f..ef7fde87 100644 --- a/src/components/ReplyCollection/index.js +++ b/src/components/ReplyCollection/index.js @@ -189,7 +189,7 @@ class ReplyCollection extends PureComponent { style={{width: (Dimensions.get('window').width - 6) / 2, margin: 1, position: 'absolute', top: 0, left: 0, zIndex: 1, alignItems: 'flex-end'}} > - {this.removeVideo(reply_detail_id , index )}} /> } From a364cdcfe4a4c8e36c37278bf982b066f2734735 Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Tue, 26 Nov 2019 13:48:36 +0530 Subject: [PATCH 180/302] bubble connect --- .../CommonComponents/BubbleList/index.js | 62 +++++++++++-------- .../CommonComponents/SingleBubble/index.js | 34 ++++++++++ .../CommonComponents/SingleBubble/styles.js | 39 ++++++++++++ 3 files changed, 110 insertions(+), 25 deletions(-) create mode 100644 src/components/CommonComponents/SingleBubble/index.js create mode 100644 src/components/CommonComponents/SingleBubble/styles.js diff --git a/src/components/CommonComponents/BubbleList/index.js b/src/components/CommonComponents/BubbleList/index.js index 115a516a..cc56fc2d 100644 --- a/src/components/CommonComponents/BubbleList/index.js +++ b/src/components/CommonComponents/BubbleList/index.js @@ -9,6 +9,10 @@ import deepGet from "lodash/get"; import ProfilePicture from "../../ProfilePicture"; import reduxGetter from "../../../services/ReduxGetters"; import multipleClickHandler from '../../../services/MultipleClickHandler'; +import {FetchServices} from "../../../services/FetchServices"; +import SingleBubble from '../SingleBubble'; + + // const NO_OF_ITEMS_TO_SHOW = 3; @@ -24,6 +28,7 @@ class BubbleList extends PureComponent { this.state = { list: [] }; + this.fetchServices = new FetchServices(this.getFetchUrl()); this.getDataWhileLoading(); this.onClickHandler = this.props.onClickHandler || this.defaultClickHandler; } @@ -32,9 +37,15 @@ class BubbleList extends PureComponent { if( this.props.doRender && this.props.doRender !== prevProps.doRender ){ this.getListData(); } - } + + getFetchUrl = () => { + return `/videos/${this.props.videoId}/replies`; + }; + + + getDataWhileLoading(){ if (this.props.doRender){ this.getListData(); @@ -42,39 +53,35 @@ class BubbleList extends PureComponent { }; getListData = () => { - return new PepoApi(this.getFetchUrl()) - .get() - .then((apiResponse) => { - if (apiResponse.success ){ - let result_type = deepGet(apiResponse, DataContract.common.resultType), - list = deepGet(apiResponse, `data.${result_type}` ), - listToShowOnUI = list.slice(0,NO_OF_ITEMS_TO_SHOW); - this.replyCount = reduxGetter.getVideoReplyCount(this.props.videoId) - this.setState({ list : listToShowOnUI } ); - } + this.getFetchService() + .refresh() + .then((res) => { + this.onRefresh(res); }) - .catch((err) => { - console.log(err); + .catch((error) => { + //this.onRefreshError(error); + console.log(error); }); - }; - getFetchUrl = () => { - return `/videos/${this.props.videoId}/replies`; + onRefresh = (res) => { + let listToBeShownOnUI = this.fetchServices.getAllResults().slice(0,NO_OF_ITEMS_TO_SHOW); + this.replyCount = reduxGetter.getVideoReplyCount(this.props.videoId) + this.setState({ list : listToBeShownOnUI } ); + }; + + getBubbleListJSX = () => { let listToRender = this.state.list; - return listToRender.length?listToRender.map((item) => { - let userId = deepGet(item,'payload.user_id'); - return - - + return listToRender.length? listToRender.map((item) => { + let userId = deepGet(item,'payload.user_id'), + replyDetailId=deepGet(item,'payload.reply_detail_id'); + return }): <> ; }; @@ -89,11 +96,16 @@ class BubbleList extends PureComponent { } }; + getFetchService = () => { + return this.fetchServices; + } + defaultClickHandler= ()=> { const baseUrl = DataContract.replies.getReplyListApi(this.props.videoId);     this.props.navigation.push('FullScreenReplyCollection',{ -      "baseUrl": baseUrl -    }); +      "baseUrl": baseUrl, + "fetchServices":this.getFetchService() +        }); } render() { diff --git a/src/components/CommonComponents/SingleBubble/index.js b/src/components/CommonComponents/SingleBubble/index.js new file mode 100644 index 00000000..fb3bda35 --- /dev/null +++ b/src/components/CommonComponents/SingleBubble/index.js @@ -0,0 +1,34 @@ +import React, { Component } from 'react'; +import {View} from 'react-native'; +import { connect } from 'react-redux'; +import ProfilePicture from "../../ProfilePicture"; +import reduxGetters from '../../../services/ReduxGetters'; +import inlineStyles from './styles'; + +const mapStateToProps = (state, ownProps) => { + return { + seen: reduxGetters.isVideoSeen( reduxGetters.getReplyEntityId(ownProps.replyDetailId)) + }; +}; + +class SingleBubble extends Component { + + constructor(props) { + super(props); + } + + render() { + return + + + } + isActiveOrUnseen = () => { + return ! this.props.seen || this.props.isActive(); + } + +} + +//make this component available to the app +export default connect(mapStateToProps)(SingleBubble); diff --git a/src/components/CommonComponents/SingleBubble/styles.js b/src/components/CommonComponents/SingleBubble/styles.js new file mode 100644 index 00000000..a5421c81 --- /dev/null +++ b/src/components/CommonComponents/SingleBubble/styles.js @@ -0,0 +1,39 @@ +import DefaultStyleGenerator from '../../../theme/styles/DefaultStyleGenerator'; +import Colors from '../../../theme/styles/Colors'; + +let stylesMap = { + + bubbleShadow: { + shadowColor: Colors.wildWatermelon2, + shadowOffset: { width: 0, height: 0 }, + shadowOpacity: 0.8, + shadowRadius: 5, + elevation: 3, + borderColor: Colors.wildWatermelon2, + borderWidth: .5, + borderRadius: 20 + }, + + bubbleSize: { + height: 38, + width: 38, + borderColor: 'white', + borderWidth: 1, + borderRadius: 20 + }, + + bubbleContainer: { + flexDirection:'row', + marginLeft: 30, + alignItems: 'center' + }, + + repliesTxt: { + color: 'white', + fontSize: 16, + fontFamily: 'AvenirNext-DemiBold' + } + +}; + +export default styles = DefaultStyleGenerator.generate(stylesMap); From a75a123db338b79c2b8bf58e9765e4a4fbbf7ca3 Mon Sep 17 00:00:00 2001 From: Akshay Raje Date: Tue, 26 Nov 2019 14:16:36 +0530 Subject: [PATCH 181/302] Links not shown + Analytics --- src/components/BottomStatus/ReplyVideoBottomStatus.js | 4 ++-- src/components/BottomStatus/VideoBottomStatus.js | 4 ++-- src/constants/AppConfig.js | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/BottomStatus/ReplyVideoBottomStatus.js b/src/components/BottomStatus/ReplyVideoBottomStatus.js index dc40ba52..a352a1d6 100644 --- a/src/components/BottomStatus/ReplyVideoBottomStatus.js +++ b/src/components/BottomStatus/ReplyVideoBottomStatus.js @@ -9,7 +9,7 @@ const mapStateToProps = (state, ownProps) => { name: reduxGetter.getName(ownProps.userId, state), entityDescriptionId : reduxGetter.getReplyDescriptionId(ownProps.entityId), description: reduxGetter.getVideoDescription(reduxGetter.getReplyDescriptionId(ownProps.entityId, state), state), - link: reduxGetter.getVideoLink(reduxGetter.getVideoLinkId(ownProps.entityId, state), state), + link: reduxGetter.getVideoLink(reduxGetter.getReplyLinkId(ownProps.entityId, state), state), supporters: reduxGetter.getReplySupporters(ownProps.entityId), totalBt: reduxGetter.getReplyBt(ownProps.entityId, state) }; @@ -17,4 +17,4 @@ const mapStateToProps = (state, ownProps) => { const ReplyVideoBottomStatus = connect(mapStateToProps)( withNavigation( Base )); -export default ReplyVideoBottomStatus; \ No newline at end of file +export default ReplyVideoBottomStatus; diff --git a/src/components/BottomStatus/VideoBottomStatus.js b/src/components/BottomStatus/VideoBottomStatus.js index 4bfe8736..f3741ffa 100644 --- a/src/components/BottomStatus/VideoBottomStatus.js +++ b/src/components/BottomStatus/VideoBottomStatus.js @@ -9,7 +9,7 @@ const mapStateToProps = (state, ownProps) => { name: reduxGetter.getName(ownProps.userId, state), entityDescriptionId : reduxGetter.getVideoDescriptionId(ownProps.entityId), description: reduxGetter.getVideoDescription(reduxGetter.getVideoDescriptionId(ownProps.entityId, state), state), - link: reduxGetter.getVideoLink(reduxGetter.getReplyLinkId(ownProps.entityId, state), state), + link: reduxGetter.getVideoLink(reduxGetter.getVideoLinkId(ownProps.entityId, state), state), supporters: reduxGetter.getVideoSupporters(ownProps.entityId), totalBt: reduxGetter.getVideoBt(ownProps.entityId, state) }; @@ -17,4 +17,4 @@ const mapStateToProps = (state, ownProps) => { const VideoBottomStatus = connect(mapStateToProps)( withNavigation( Base )); -export default VideoBottomStatus ; \ No newline at end of file +export default VideoBottomStatus ; diff --git a/src/constants/AppConfig.js b/src/constants/AppConfig.js index 680a3c1d..d5d602ba 100644 --- a/src/constants/AppConfig.js +++ b/src/constants/AppConfig.js @@ -325,6 +325,7 @@ export default { AuthDeviceDrawer: 'DeviceUnauthorized', TwitterLogin: 'TwitterLogin', FullScreenReplyCollection: 'FullScreenReplyCollection', + VideoReplyPlayer: 'VideoReplyPlayer', VideoReplies: 'VideoReplies' }, default_bt_amt : 10, From 3ecd695dcb262354eaa0da742aa6b1e2ebd3f33a Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Tue, 26 Nov 2019 14:53:22 +0530 Subject: [PATCH 182/302] bubble connect with list count --- .../CommonComponents/BubbleList/index.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/components/CommonComponents/BubbleList/index.js b/src/components/CommonComponents/BubbleList/index.js index cc56fc2d..7d8aea5a 100644 --- a/src/components/CommonComponents/BubbleList/index.js +++ b/src/components/CommonComponents/BubbleList/index.js @@ -11,9 +11,19 @@ import reduxGetter from "../../../services/ReduxGetters"; import multipleClickHandler from '../../../services/MultipleClickHandler'; import {FetchServices} from "../../../services/FetchServices"; import SingleBubble from '../SingleBubble'; +import {connect} from "react-redux"; +import reduxGetters from '../../../services/ReduxGetters'; + +const mapStateToProps = (state, ownProps) => { + return { + replyCount : reduxGetter.getVideoReplyCount(ownProps.videoId) + }; +}; + + // const NO_OF_ITEMS_TO_SHOW = 3; @@ -37,6 +47,9 @@ class BubbleList extends PureComponent { if( this.props.doRender && this.props.doRender !== prevProps.doRender ){ this.getListData(); } + if (this.props.replyCount |= prevProps.replyCount){ + this.getListData(); + } } @@ -68,7 +81,7 @@ class BubbleList extends PureComponent { onRefresh = (res) => { let listToBeShownOnUI = this.fetchServices.getAllResults().slice(0,NO_OF_ITEMS_TO_SHOW); - this.replyCount = reduxGetter.getVideoReplyCount(this.props.videoId) + this.replyCount = reduxGetter.getVideoReplyCount(this.props.videoId); this.setState({ list : listToBeShownOnUI } ); }; @@ -113,11 +126,11 @@ class BubbleList extends PureComponent { {this.onClickHandler()})} style={{flexDirection: 'row-reverse', marginRight: 5}}>{this.getBubbleListJSX()} - {this.moreReplyText()} + {/*{this.moreReplyText()}*/} } } //make this component available to the app -export default withNavigation(BubbleList); +export default connect(mapStateToProps)(withNavigation(BubbleList)) ; From 9cf61e427a415016753b1cb536975af5b1fcabb3 Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Tue, 26 Nov 2019 16:13:32 +0530 Subject: [PATCH 183/302] bubble count --- src/components/CommonComponents/BubbleList/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/CommonComponents/BubbleList/index.js b/src/components/CommonComponents/BubbleList/index.js index 7d8aea5a..fa42b023 100644 --- a/src/components/CommonComponents/BubbleList/index.js +++ b/src/components/CommonComponents/BubbleList/index.js @@ -47,7 +47,7 @@ class BubbleList extends PureComponent { if( this.props.doRender && this.props.doRender !== prevProps.doRender ){ this.getListData(); } - if (this.props.replyCount |= prevProps.replyCount){ + if (this.props.replyCount != prevProps.replyCount){ this.getListData(); } } From 8eb86e0cc3cf53a5e4ec45392e623f986722f48e Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Tue, 26 Nov 2019 16:55:37 +0530 Subject: [PATCH 184/302] Minor fix --- src/components/FullScreenReplyCollection/VideoReplyRow.js | 2 +- src/components/Home/HomeFeedRow.js | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index 4b41f535..cfed18cd 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -112,7 +112,7 @@ class VideoReplyRow extends PureComponent { {return false}} /> - + - {this.reportViewRef = ref }} onLayout={()=>{}} > - - + Date: Tue, 26 Nov 2019 16:58:22 +0530 Subject: [PATCH 185/302] Amount shown in wie on navigation --- src/components/FanVideoDetails/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/FanVideoDetails/index.js b/src/components/FanVideoDetails/index.js index 3082e21e..748f542b 100644 --- a/src/components/FanVideoDetails/index.js +++ b/src/components/FanVideoDetails/index.js @@ -35,7 +35,7 @@ import pricer from '../../services/Pricer'; import PepoPinkIcon from '../../assets/pepo-tx-icon.png'; import AppConfig from '../../constants/AppConfig' -//TODO setParams dont use +//TODO setParams dont use const mapStateToProps = (state, ownProps) => { return { @@ -88,7 +88,7 @@ class FanVideoDetails extends Component { super(props); this.videoDesc = this.props.recordedVideo.video_desc; this.videoLink = this.props.recordedVideo.video_link; - this.replyAmount = this.props.recordedVideo.reply_amount || pricer.getToDecimal(DEFAUT_BT_VALUE); + this.replyAmount = pricer.getToDecimal(this.props.recordedVideo.reply_amount || DEFAUT_BT_VALUE); this.priceOracle = pricer.getPriceOracle(); this.numberFormatter = new NumberFormatter(); this.max = props.balance; From 9541095cd0086b59b7862ea857470e2156a5db6a Mon Sep 17 00:00:00 2001 From: Shraddha Date: Tue, 26 Nov 2019 17:01:14 +0530 Subject: [PATCH 186/302] bug fix NaN --- src/services/Pricer.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/services/Pricer.js b/src/services/Pricer.js index 16aa87ca..719a46dc 100644 --- a/src/services/Pricer.js +++ b/src/services/Pricer.js @@ -94,6 +94,10 @@ class Pricer { toDisplayAmount(amount) { if(isNaN(amount)) return amount; + if(amount <= 0.0000001 ){ + amount = parseInt(amount); + amount = amount.toFixed(2); + } return numeral(amount).format('0[.]00a') || 0; } From ff95dad971a2802b50c05e8d884763d4885bf543 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Tue, 26 Nov 2019 18:20:10 +0530 Subject: [PATCH 187/302] fixes --- .../DeletedVideoInfo/index.js | 1 + .../CommonComponents/VideoPlayer/index.js | 2 +- .../VideoReplyPlayer/index.js | 27 +++----- .../VideoReplyRow.js | 69 ++++++++++++++----- .../FullScreenVideoCollection/index.js | 11 ++- src/components/VideoCollections/index.js | 2 +- src/helpers/helpers.js | 2 +- src/services/ReduxGetters.js | 10 --- 8 files changed, 78 insertions(+), 46 deletions(-) diff --git a/src/components/CommonComponents/DeletedVideoInfo/index.js b/src/components/CommonComponents/DeletedVideoInfo/index.js index 7e9dc395..3253725b 100644 --- a/src/components/CommonComponents/DeletedVideoInfo/index.js +++ b/src/components/CommonComponents/DeletedVideoInfo/index.js @@ -4,6 +4,7 @@ import {withNavigation} from 'react-navigation'; import video_not_available from '../../../assets/video-not-available.png'; import historyBack from "../../../assets/user-video-history-back-icon.png"; +import inlineStyles from './styles'; class DeletedVideoInfo extends PureComponent{ constructor(props){ diff --git a/src/components/CommonComponents/VideoPlayer/index.js b/src/components/CommonComponents/VideoPlayer/index.js index 277666c7..fa4d4755 100644 --- a/src/components/CommonComponents/VideoPlayer/index.js +++ b/src/components/CommonComponents/VideoPlayer/index.js @@ -26,7 +26,7 @@ class VideoPlayer extends Component { this.bubbleClickHandler = this.props.navigation.getParam('bubbleClickHandler'); this.state = { userId : this.props.navigation.getParam('userId') || null, - isDeleted : reduxGetter.isVideoDeleted(this.videoId) + isDeleted : false }; this.refetchVideo(); this.isActiveScreen = true; diff --git a/src/components/CommonComponents/VideoReplyPlayer/index.js b/src/components/CommonComponents/VideoReplyPlayer/index.js index c927fc62..c4faced4 100644 --- a/src/components/CommonComponents/VideoReplyPlayer/index.js +++ b/src/components/CommonComponents/VideoReplyPlayer/index.js @@ -24,12 +24,12 @@ class VideoReplyPlayer extends PureComponent { constructor(props){ super(props); this.replyDetailId = this.props.navigation.getParam('replyDetailId'); - this.videoId = reduxGetter.getReplyEntityId(this.replyDetailId); //Check for entity deleted this.state = { userId : this.props.navigation.getParam('userId') || null, - isDeleted : reduxGetter.isVideoEntityDeleted(this.videoId) + isLoading: true, + isDeleted : false }; - this.refetchVideo(); + this.fetchReply(); this.isActiveScreen = true; } @@ -44,7 +44,7 @@ class VideoReplyPlayer extends PureComponent { } componentWillUnmount(){ - this.onRefetchVideo = () => {}; + this.onReplyFetch = () => {}; this.willFocusSubscription && this.willFocusSubscription.remove(); this.willBlurSubscription && this.willBlurSubscription.remove(); } @@ -53,33 +53,27 @@ class VideoReplyPlayer extends PureComponent { return this.isActiveScreen; }; - refetchVideo = () => { + fetchReply = () => { if (this.state.isDeleted) return; new PepoApi(DataContract.replies.getSingleVideoReplyApi(this.replyDetailId)) .get() - .then((res) => { this.onRefetchVideo(res) }) + .then((res) => { this.onReplyFetch(res) }) .catch((error) => {}); }; - onRefetchVideo = ( res ) => { + onReplyFetch = ( res ) => { if(Utilities.isEntityDeleted(res)){ this.setState({isDeleted: true}); return; } - this.fetchParentVideo( res ); const users = deepGet(res , "data.users") || {} , userKeys = Object.keys(users) || [] , userId = userKeys[0] || null; if(userId){ - this.setState({ userId : userId}); + this.setState({ userId : userId , isLoading : false}); } }; - fetchParentVideo = (res) => { - const parentVideoId = deepGet(res, `data.reply_details.${this.replyDetailId}.parent_id` ); - fetchVideo(parentVideoId); - } - getPixelDropData = () => { return pixelParams = { e_entity: 'reply', @@ -103,14 +97,15 @@ class VideoReplyPlayer extends PureComponent { return ( - + />)} ) diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index cfed18cd..fb6e5275 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -6,6 +6,7 @@ import ShareIcon from "../CommonComponents/ShareIcon"; import ReportVideo from "../CommonComponents/ReportVideo"; import BottomReplyBar from "../CommonComponents/BottomReplyBar"; import PepoApi from '../../services/PepoApi'; +import deepGet from 'lodash/get'; import inlineStyles from './styles'; @@ -27,21 +28,56 @@ import multipleClickHandler from '../../services/MultipleClickHandler'; const marginTopForParentIcon = 15; const AREA = AppConfig.MaxDescriptionArea; const height = AREA / Dimensions.get('window').width + 20; -import { connect } from 'react-redux'; - -const mapStateToProps = (state, ownProps) => { - return { - parentVideoId : ReduxGetters.getReplyParentVideoId( ownProps.replyDetailId ,state ), - parentUserId : ReduxGetters.getReplyParentUserId(ownProps.replyDetailId , state ) - }; - }; +import { fetchVideo } from '../../helpers/helpers'; class VideoReplyRow extends PureComponent { constructor(props) { super(props); + this.state = { + parentVideoId : ReduxGetters.getReplyParentVideoId( props.replyDetailId ), + parentUserId : ReduxGetters.getReplyParentUserId( props.replyDetailId ) + } this.onParentClickDelegate = this.props.parentClickHandler || this.defaultParentClickHandler; } + componentDidMount(){ + if(this.props.doRender && this.state.parentVideoId && !this.state.parentUserId ){ + this.fetchParentVideo = fetchVideo(this.state.parentVideoId, this.onParentVideoFetch , null , this.onParentVideoFetchComplete); + } + } + + componentDidUpdate(prevProps){ + if(!this.fetchParentVideo && this.props.doRender && this.props.doRender !== prevProps.doRender && !this.state.parentUserId ){ + fetchVideo(this.state.parentVideoId, this.onParentVideoFetch , null , this.onParentVideoFetchComplete); + } + } + + componentWillUnmount(){ + this.onParentVideoFetch = () => {}; + this.onParentVideoFetchComplete = () => {}; + } + + onParentProfileIconClick() { + if(this.state.parentVideoId){ + this.onParentClickDelegate(); + } + } + + onParentVideoFetchComplete() { + this.fetchParentVideo = null; + } + + onParentVideoFetch = (res) => { + const users = deepGet(res , "data.users") || {} , + userKeys = Object.keys(users) || [] , + userId = userKeys[0] || null; + if(userId){ + this.setState({ + parentUserId: userId + }); + } + } + refetchVideoReply = () => { new PepoApi(`/replies/${this.props.replyDetailId}`) .get() @@ -51,7 +87,7 @@ class VideoReplyRow extends PureComponent { getPixelDropData = () => { const parentData = this.props.getPixelDropData(); - const pixelParams = { e_entity: 'reply' , parent_video_id : this.props.parentVideoId , reply_detail_id :this.props.replyDetailId }; + const pixelParams = { e_entity: 'reply' , parent_video_id : this.state.parentVideoId , reply_detail_id :this.props.replyDetailId }; return assignIn({}, pixelParams, parentData); } @@ -80,9 +116,9 @@ class VideoReplyRow extends PureComponent { - {this.props.parentVideoId && ( + {this.state.parentVideoId && ( - - {this.onParentClickDelegate()})}> - {this.onParentProfileIconClick()})}> + - + ); } @@ -143,7 +179,8 @@ VideoReplyRow.defaultProps = { console.warn("getPixelDropData props is mandatory for Video component"); return {}; }, - paginationService : null + paginationService : null, + currentIndex: 0 }; -export default connect(mapStateToProps)(withNavigation(VideoReplyRow)); +export default withNavigation(VideoReplyRow) diff --git a/src/components/FullScreenVideoCollection/index.js b/src/components/FullScreenVideoCollection/index.js index a6e24620..89ac66c0 100644 --- a/src/components/FullScreenVideoCollection/index.js +++ b/src/components/FullScreenVideoCollection/index.js @@ -164,6 +164,15 @@ class FullScreenVideoCollection extends PureComponent{ }; } + parentClickHandler =(replyDetailId)=>{ + const parentVideoId = reduxGetters.getReplyParentVideoId(replyDetailId), + parentUserId = reduxGetters.getReplyParentUserId(replyDetailId ); + this.props.navigation.push('VideoPlayer', { + userId: parentUserId, + videoId: parentVideoId + }); + } + _renderVideoReplyRow(item, index){ let userId = deepGet(item,'payload.user_id'), replyDetailId = deepGet(item,`payload.${DataContract.replies.replyDetailIdKey}`), @@ -176,7 +185,7 @@ class FullScreenVideoCollection extends PureComponent{ doRender={Math.abs(index - this.state.activeIndex) < maxVideosThreshold} userId={userId} replyDetailId={replyDetailId} - currentIndex={this.currentIndex} + parentClickHandler={()=>{this.parentClickHandler(replyDetailId)}} /> ; } diff --git a/src/components/VideoCollections/index.js b/src/components/VideoCollections/index.js index de6e0eaf..2781811f 100644 --- a/src/components/VideoCollections/index.js +++ b/src/components/VideoCollections/index.js @@ -162,7 +162,7 @@ class VideoCollections extends PureComponent { }; _renderVideoReplyThumbnail( item, index ) { - return ( {this.onVideoClick(index)}}/>); + return ( {this.onVideoClick(item.payload,index)}}/>); } _renderVideoThumbnail( item, index){ diff --git a/src/helpers/helpers.js b/src/helpers/helpers.js index f915a2f2..91b51a60 100644 --- a/src/helpers/helpers.js +++ b/src/helpers/helpers.js @@ -34,7 +34,7 @@ function fetchUser(userId, onResponse, errorCallback, finallyCallback) { } function fetchVideo( videoId , onResponse, onError, onComplete ){ - new PepoApi(`/videos/${videoId}`) + return new PepoApi(`/videos/${videoId}`) .get() .then((res) => { onResponse && onResponse(res); diff --git a/src/services/ReduxGetters.js b/src/services/ReduxGetters.js index 8b3382cc..7d145b6a 100644 --- a/src/services/ReduxGetters.js +++ b/src/services/ReduxGetters.js @@ -434,11 +434,6 @@ class ReduxGetters { return deepGet(state, `user_entities.id_${id}.status`, '').toLowerCase() == appConfig.userStatusMap.inActive; } - isVideoDeleted(id, state) { - state = state || Store.getState(); - return deepGet(state, `video_stat_entities.id_${id}.status`, '').toLowerCase() == appConfig.videoStatusMap.deleted; - } - getUSDPrice(state){ state = state || Store.getState(); return deepGet(state, "price_points.OST.USD"); @@ -516,11 +511,6 @@ class ReduxGetters { return !!val; } - isVideoEntityDeleted(id, state) { - state = state || Store.getState(); - return deepGet(state, `reply_detail_entities.id_${id}.status`, '').toLowerCase() == appConfig.replyStatusMap.deleted; - } - getReplyParentVideoId(id , state){ state = state || Store.getState(); return deepGet(state, `reply_detail_entities.id_${id}.parent_id`); From a0cbbfa0bb715763a1595989ed26c1a34347970e Mon Sep 17 00:00:00 2001 From: Akshay Raje Date: Tue, 26 Nov 2019 20:04:11 +0530 Subject: [PATCH 188/302] Clearning warnings: cyclic references, missing keys, supression of un-controllable warnings --- src/components/BottomStatus/Base.js | 6 +++--- src/components/CommonComponents/BubbleList/index.js | 10 ++-------- src/components/CommonComponents/SingleBubble/index.js | 2 +- src/components/CommonComponents/SingleBubble/styles.js | 2 +- src/helpers/NotchHelper.js | 8 ++++++-- src/services/PepoSocket.js | 9 ++++++++- src/services/Pricer.js | 10 ++++++---- src/services/Utilities.js | 9 +++++---- 8 files changed, 32 insertions(+), 24 deletions(-) diff --git a/src/components/BottomStatus/Base.js b/src/components/BottomStatus/Base.js index d9a20e07..4ed930d7 100644 --- a/src/components/BottomStatus/Base.js +++ b/src/components/BottomStatus/Base.js @@ -47,7 +47,7 @@ class BottomStatus extends PureComponent { getHashTagMarkup( item , prevText ){ const tagText = item.replace("#", ""); return ( - + {prevText} + {prevText} + {prevText + item} ) diff --git a/src/components/CommonComponents/BubbleList/index.js b/src/components/CommonComponents/BubbleList/index.js index fa42b023..8a8b45f3 100644 --- a/src/components/CommonComponents/BubbleList/index.js +++ b/src/components/CommonComponents/BubbleList/index.js @@ -4,18 +4,12 @@ import { Text, View, TouchableOpacity} from 'react-native'; import { withNavigation } from 'react-navigation'; import DataContract from '../../../constants/DataContract'; -import PepoApi from "../../../services/PepoApi"; import deepGet from "lodash/get"; -import ProfilePicture from "../../ProfilePicture"; import reduxGetter from "../../../services/ReduxGetters"; import multipleClickHandler from '../../../services/MultipleClickHandler'; import {FetchServices} from "../../../services/FetchServices"; import SingleBubble from '../SingleBubble'; import {connect} from "react-redux"; -import reduxGetters from '../../../services/ReduxGetters'; - - - const mapStateToProps = (state, ownProps) => { return { @@ -94,7 +88,7 @@ class BubbleList extends PureComponent { return listToRender.length? listToRender.map((item) => { let userId = deepGet(item,'payload.user_id'), replyDetailId=deepGet(item,'payload.reply_detail_id'); - return + return }): <> ; }; @@ -123,7 +117,7 @@ class BubbleList extends PureComponent { render() { return - {this.onClickHandler()})} + {this.onClickHandler()})} style={{flexDirection: 'row-reverse', marginRight: 5}}>{this.getBubbleListJSX()} {/*{this.moreReplyText()}*/} diff --git a/src/components/CommonComponents/SingleBubble/index.js b/src/components/CommonComponents/SingleBubble/index.js index fb3bda35..ed8f1f8d 100644 --- a/src/components/CommonComponents/SingleBubble/index.js +++ b/src/components/CommonComponents/SingleBubble/index.js @@ -20,7 +20,7 @@ class SingleBubble extends Component { render() { return } diff --git a/src/components/CommonComponents/SingleBubble/styles.js b/src/components/CommonComponents/SingleBubble/styles.js index a5421c81..0b89cc98 100644 --- a/src/components/CommonComponents/SingleBubble/styles.js +++ b/src/components/CommonComponents/SingleBubble/styles.js @@ -14,7 +14,7 @@ let stylesMap = { borderRadius: 20 }, - bubbleSize: { + bubbleSizeSkipFont: { height: 38, width: 38, borderColor: 'white', diff --git a/src/helpers/NotchHelper.js b/src/helpers/NotchHelper.js index 09340d93..ad4ec027 100644 --- a/src/helpers/NotchHelper.js +++ b/src/helpers/NotchHelper.js @@ -1,6 +1,10 @@ import {NativeModules} from "react-native"; const RNDeviceInfo = NativeModules.RNDeviceInfo; -import PepoApi from "../services/PepoApi"; + +let PepoApi; +import('../services/PepoApi').then((imports) => { + PepoApi = imports.default; +}); let devicesWithNotch = [ { @@ -149,4 +153,4 @@ class NotchHelper { } -export default new NotchHelper() \ No newline at end of file +export default new NotchHelper() diff --git a/src/services/PepoSocket.js b/src/services/PepoSocket.js index 2f811571..1efc22a5 100644 --- a/src/services/PepoSocket.js +++ b/src/services/PepoSocket.js @@ -1,7 +1,9 @@ import io from 'socket.io-client'; -import PepoApi from '../services/PepoApi'; +import { YellowBox } from 'react-native'; import deepGet from 'lodash/get'; +import PepoApi from '../services/PepoApi'; + import { upsertNotificationUnread } from '../actions'; import Store from '../store'; @@ -23,6 +25,11 @@ export default class PepoSocket { this.socket = null; this.isConnecting = false; this.attempt = 0; + // Supress un-actionable warnings + YellowBox.ignoreWarnings(['Setting a timer']); + YellowBox.ignoreWarnings([ + 'Unrecognized WebSocket connection option(s) `agent`, `perMessageDeflate`, `pfx`, `key`, `passphrase`, `cert`, `ca`, `ciphers`, `rejectUnauthorized`. Did you mean to put these under `headers`?' + ]) } setConnectionParams(response) { diff --git a/src/services/Pricer.js b/src/services/Pricer.js index 719a46dc..0c653d47 100644 --- a/src/services/Pricer.js +++ b/src/services/Pricer.js @@ -6,14 +6,16 @@ import PriceOracle from './PriceOracle'; import ReduxGetter from "./ReduxGetters"; import numeral from "numeral"; import OstWalletSdkHelper from '../helpers/OstWalletSdkHelper'; -import PepoApi from './PepoApi'; import DataContract from '../constants/DataContract'; import BigNumber from 'bignumber.js'; -let CurrentUser; +let CurrentUser, PepoApi; import('../models/CurrentUser').then((imports) => { CurrentUser = imports.default; }); +import('./PepoApi').then((imports) => { + PepoApi = imports.default; +}); let ostErrors; import('./OstErrors').then((imports) => { @@ -110,14 +112,14 @@ class Pricer { } } - getWeiToNumber = ( val ) => { + getWeiToNumber = ( val ) => { return val && Math.floor(Number(this.getFromDecimal(val))) || 0; } ; getBtFromPepoCornsInWei( pepoCorns , step , pepoInWeiPerStep){ if(!pepoCorns || !step || !pepoInWeiPerStep ) return "0"; let pepoInEthPerStep = this.getFromDecimal(pepoInWeiPerStep); //Normalize to ETH - let pepoInEthPerStepBN = BigNumber( pepoInEthPerStep ); //Convert to BN + let pepoInEthPerStepBN = BigNumber( pepoInEthPerStep ); //Convert to BN let amountBn = BigNumber(pepoCorns).dividedBy(step) ; //Get amount in BN amountBn = pepoInEthPerStepBN.multipliedBy(amountBn).toString(10); //Get pepo in ETH amountBn = this.getToDecimal( amountBn ); // Convert to WEI diff --git a/src/services/Utilities.js b/src/services/Utilities.js index a3cd0deb..5d2283dc 100644 --- a/src/services/Utilities.js +++ b/src/services/Utilities.js @@ -11,15 +11,16 @@ import { LoginPopoverActions } from '../components/LoginPopover'; import Toast from '../theme/components/NotificationToast'; import CameraPermissionsApi from '../services/CameraPermissionsApi'; import { allowAcessModalEventEmitter } from '../components/AllowAccessModalScreen'; -import AppConfig from '../constants/AppConfig'; -import PepoApi from './PepoApi'; +import AppConfig from '../constants/AppConfig';; import DataContract from '../constants/DataContract'; -import ReduxGetters from './ReduxGetters'; -let CurrentUser; +let CurrentUser, PepoApi; import('../models/CurrentUser').then((imports) => { CurrentUser = imports.default; }); +import('./PepoApi').then((imports) => { + PepoApi = imports.default; +}); let os = Platform.OS || ""; os = os.toLowerCase(); From 19cede451c0ebf0e6c7eea868c5e592292fcf515 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Tue, 26 Nov 2019 20:32:34 +0530 Subject: [PATCH 189/302] fixes --- .../CommonComponents/VideoPlayer/index.js | 14 ++++++++------ .../CommonComponents/VideoReplyPlayer/index.js | 12 +++++------- src/constants/DataContract.js | 7 +++++-- src/services/ReduxGetters.js | 5 +++++ 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/components/CommonComponents/VideoPlayer/index.js b/src/components/CommonComponents/VideoPlayer/index.js index fa4d4755..56daa7c1 100644 --- a/src/components/CommonComponents/VideoPlayer/index.js +++ b/src/components/CommonComponents/VideoPlayer/index.js @@ -10,6 +10,7 @@ import CommonStyles from "../../../theme/styles/Common"; import FlotingBackArrow from "../../CommonComponents/FlotingBackArrow"; import { SafeAreaView } from "react-navigation"; import { fetchVideo } from '../../../helpers/helpers'; +import DataContract from '../../../constants/DataContract'; class VideoPlayer extends Component { @@ -25,7 +26,7 @@ class VideoPlayer extends Component { this.videoId = this.props.navigation.getParam('videoId'); this.bubbleClickHandler = this.props.navigation.getParam('bubbleClickHandler'); this.state = { - userId : this.props.navigation.getParam('userId') || null, + userId : reduxGetter.getVideoCreatorUserId(this.videoId) || null, isDeleted : false }; this.refetchVideo(); @@ -62,11 +63,12 @@ class VideoPlayer extends Component { this.setState({isDeleted: true}); return; } - const users = deepGet(res , "data.users") || {} , - userKeys = Object.keys(users) || [] , - userId = userKeys[0] || null; - if(userId){ - this.setState({ userId : userId}); + const video_details = deepGet(res, `data.${DataContract.videos.videoDetailsKey}`), + item = video_details[this.videoId]; + if( item ){ + this.setState({ + userId: item[DataContract.videos.creatorUserIdKey] + }) } }; diff --git a/src/components/CommonComponents/VideoReplyPlayer/index.js b/src/components/CommonComponents/VideoReplyPlayer/index.js index c4faced4..ac2b410a 100644 --- a/src/components/CommonComponents/VideoReplyPlayer/index.js +++ b/src/components/CommonComponents/VideoReplyPlayer/index.js @@ -10,7 +10,6 @@ import VideoReplyRow from '../../FullScreenReplyCollection/VideoReplyRow'; import FlotingBackArrow from "../../CommonComponents/FlotingBackArrow"; import CommonStyles from "../../../theme/styles/Common"; import { SafeAreaView } from "react-navigation"; -import { fetchVideo } from '../../../helpers/helpers'; class VideoReplyPlayer extends PureComponent { @@ -25,7 +24,7 @@ class VideoReplyPlayer extends PureComponent { super(props); this.replyDetailId = this.props.navigation.getParam('replyDetailId'); this.state = { - userId : this.props.navigation.getParam('userId') || null, + userId : reduxGetter.getReplyUserId( this.replyDetailId ) || null, isLoading: true, isDeleted : false }; @@ -66,11 +65,10 @@ class VideoReplyPlayer extends PureComponent { this.setState({isDeleted: true}); return; } - const users = deepGet(res , "data.users") || {} , - userKeys = Object.keys(users) || [] , - userId = userKeys[0] || null; - if(userId){ - this.setState({ userId : userId , isLoading : false}); + const replyDetails = deepGet(res , `data.${DataContract.replies.replyDetailsKey}`) , + item = replyDetails[this.replyDetailId] + if(item){ + this.setState({ userId : item[DataContract.replies.creatorUserIdKey], isLoading : false}); } }; diff --git a/src/constants/DataContract.js b/src/constants/DataContract.js index cad53a98..ca562d9a 100644 --- a/src/constants/DataContract.js +++ b/src/constants/DataContract.js @@ -54,7 +54,8 @@ export default { }, replyDetailIdKey: 'reply_detail_id', parentVideoIdKey: 'parent_id', - creatorUserIdKey: 'creator_user_id' + creatorUserIdKey: 'creator_user_id', + replyDetailsKey: 'reply_details' }, common: { @@ -77,7 +78,9 @@ export default { reply : "VIDEO_REPLY", video:"FAN_UPDATE" }, - kindKey: "kind" + kindKey: "kind", + creatorUserIdKey: 'creator_user_id', + videoDetailsKey: 'video_details' }, share: { diff --git a/src/services/ReduxGetters.js b/src/services/ReduxGetters.js index 7d145b6a..050cd66e 100644 --- a/src/services/ReduxGetters.js +++ b/src/services/ReduxGetters.js @@ -516,6 +516,11 @@ class ReduxGetters { return deepGet(state, `reply_detail_entities.id_${id}.parent_id`); } + getReplyUserId(id , state){ + state = state || Store.getState(); + return deepGet(state, `reply_detail_entities.id_${id}.creator_user_id`); + } + getReplyParentUserId(id , state){ state = state || Store.getState(); let parentId = deepGet(state, `reply_detail_entities.id_${id}.parent_id`); From 5b4c7eca03d83c93510bf12f8cf42bd4ace4f864 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Tue, 26 Nov 2019 20:41:16 +0530 Subject: [PATCH 190/302] fixes --- src/components/FullScreenReplyCollection/VideoReplyRow.js | 2 +- src/components/FullScreenReplyCollection/index.js | 1 + .../FullScreenVideoCollection/FullScreenVideoRow.js | 4 ---- src/components/FullScreenVideoCollection/index.js | 1 + src/components/Home/HomeFeedRow.js | 5 ----- src/components/UserVideoHistory/UserVideoHistoryRow.js | 4 ---- 6 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index fb6e5275..f4b072ff 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -123,7 +123,7 @@ class VideoReplyRow extends PureComponent { paginationService={this.props.paginationService} onChildClickDelegate={this.props.onChildClickDelegate} currentIndex={this.props.currentIndex} - showActiveIndicator={true} + showActiveIndicator={this.props.showActiveIndicator} /> diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index 837a6656..f6687fb7 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -172,6 +172,7 @@ class FullScreenReplyCollection extends PureComponent{ onChildClickDelegate={this.childClickHandler} parentClickHandler={this.parentClickHandler} currentIndex={this.state.activeIndex} + showActiveIndicator={true} // conditional delegate /> ; } diff --git a/src/components/FullScreenVideoCollection/FullScreenVideoRow.js b/src/components/FullScreenVideoCollection/FullScreenVideoRow.js index 200211a3..d324a553 100644 --- a/src/components/FullScreenVideoCollection/FullScreenVideoRow.js +++ b/src/components/FullScreenVideoCollection/FullScreenVideoRow.js @@ -67,10 +67,6 @@ class FullScreeVideoRow extends PureComponent { - {/* */} diff --git a/src/components/FullScreenVideoCollection/index.js b/src/components/FullScreenVideoCollection/index.js index 89ac66c0..5e8a9ed3 100644 --- a/src/components/FullScreenVideoCollection/index.js +++ b/src/components/FullScreenVideoCollection/index.js @@ -186,6 +186,7 @@ class FullScreenVideoCollection extends PureComponent{ userId={userId} replyDetailId={replyDetailId} parentClickHandler={()=>{this.parentClickHandler(replyDetailId)}} + showActiveIndicator={true} /> ; } diff --git a/src/components/Home/HomeFeedRow.js b/src/components/Home/HomeFeedRow.js index c0985d4e..d3d216a3 100644 --- a/src/components/Home/HomeFeedRow.js +++ b/src/components/Home/HomeFeedRow.js @@ -73,11 +73,6 @@ class HomeFeedRow extends PureComponent { - {/**/} diff --git a/src/components/UserVideoHistory/UserVideoHistoryRow.js b/src/components/UserVideoHistory/UserVideoHistoryRow.js index 5b28fe1d..df54f8e8 100644 --- a/src/components/UserVideoHistory/UserVideoHistoryRow.js +++ b/src/components/UserVideoHistory/UserVideoHistoryRow.js @@ -78,10 +78,6 @@ class UserVideoHistoryRow extends PureComponent { - {/* */} From 1934f3904056a05aa663a9d83f38f386377fb111 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Tue, 26 Nov 2019 20:49:05 +0530 Subject: [PATCH 191/302] Minor fix --- src/components/ReplyCollection/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/ReplyCollection/index.js b/src/components/ReplyCollection/index.js index ef7fde87..99a82db5 100644 --- a/src/components/ReplyCollection/index.js +++ b/src/components/ReplyCollection/index.js @@ -19,6 +19,7 @@ import PepoApi from '../../services/PepoApi'; import ReplyThumbnail from '../CommonComponents/VideoThumbnail/ReplyThumbnail'; import ReduxGetters from '../../services/ReduxGetters'; import entityHelper from '../../helpers/EntityHelper'; +import { fetchVideo } from '../../helpers/helpers'; class ReplyCollection extends PureComponent { @@ -202,6 +203,8 @@ class ReplyCollection extends PureComponent { } removeVideo = (id, index) => { + const videoId = ReduxGetters.getReplyEntityId(id); + videoId && fetchVideo(videoId); if (index > -1) { this.videoPagination.deleteItem(id , "payload.reply_detail_id"); let array = [...this.state.list]; // make a separate copy of the array From c7f50090980f4e41ec812392fdc6a072c588b4e0 Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Tue, 26 Nov 2019 20:51:02 +0530 Subject: [PATCH 192/302] lightbox video flow changes --- src/components/CaptureVideo/index.js | 12 +++-- src/components/FanVideoDetails/index.js | 10 +++- .../FanVideoReplyDetails/TouchableButton.js | 13 +++-- src/components/FanVideoReplyDetails/index.js | 36 ++++++++++---- src/components/VideoRecorder/index.js | 12 ++--- src/components/VideoReplies/index.js | 8 ++-- src/helpers/cameraHelper.js | 3 +- src/services/CameraWorker.js | 47 +++++++++++++++++-- src/services/ReduxGetters.js | 6 +++ src/store/index.js | 4 +- 10 files changed, 114 insertions(+), 37 deletions(-) diff --git a/src/components/CaptureVideo/index.js b/src/components/CaptureVideo/index.js index ca4c3a3c..05aea73b 100644 --- a/src/components/CaptureVideo/index.js +++ b/src/components/CaptureVideo/index.js @@ -19,14 +19,14 @@ class CaptureVideo extends Component { }; constructor(props) { super(props); - let videoReplyCount = props.navigation.getParam("videoReplyCount"); + let isChargeble = props.navigation.getParam("isChargeble"); this.state = { recordingScreen: true, videoUri: '', actionSheetOnRecordVideo: true, modalVisible: true, acceptedCameraTnC: null, - hasVideoReplies: videoReplyCount && videoReplyCount > 0 + showLightBoxOnReply: isChargeble }; this.replyReceiverUserId = null; this.replyReceiverVideoId = null; @@ -56,6 +56,7 @@ class CaptureVideo extends Component { this.replyReceiverUserId = this.props.navigation.getParam("userId"); this.replyReceiverVideoId = this.props.navigation.getParam("videoId"); this.amountToSendWithReply = this.props.navigation.getParam("amount"); + this.isChargeble = this.props.navigation.getParam("isChargeble"); } else { // Do nothing. @@ -75,7 +76,7 @@ class CaptureVideo extends Component { recordingScreen: true, actionSheetOnRecordVideo: false, acceptedCameraTnC: 'true', - hasVideoReplies: true + showLightBoxOnReply: false }); } @@ -123,7 +124,8 @@ class CaptureVideo extends Component { if ( this.isVideoTypeReply()) { replyOptions['replyReceiverUserId'] = this.replyReceiverUserId; replyOptions['replyReceiverVideoId'] = this.replyReceiverVideoId; - replyOptions['amountToSendWithReply']= this.amountToSendWithReply; + replyOptions['amountToSendWithReply'] = this.amountToSendWithReply; + replyOptions['isChargeble'] = this.isChargeble; } return replyOptions; } @@ -167,7 +169,7 @@ class CaptureVideo extends Component { getActionSheetText={this.getActionSheetText} navigation={this.props.navigation} isVideoTypeReply={this.isVideoTypeReply()} - hasVideoReplies={this.state.hasVideoReplies} + showLightBoxOnReply={this.state.showLightBoxOnReply} videoId={this.replyReceiverVideoId} /> diff --git a/src/components/FanVideoDetails/index.js b/src/components/FanVideoDetails/index.js index 748f542b..788438a2 100644 --- a/src/components/FanVideoDetails/index.js +++ b/src/components/FanVideoDetails/index.js @@ -102,7 +102,8 @@ class FanVideoDetails extends Component { linkError: null, descError : null, usdVal : this.weiToUSD(this.replyAmount), - replyAmt : null + replyAmt : null, + buttonText: 'Post' }; @@ -142,8 +143,10 @@ class FanVideoDetails extends Component { videoLink: this.props.recordedVideo.video_link, replyAmount: this.props.recordedVideo.reply_amount }); + } + componentWillUnmount() { this.keyboardWillShowListener.remove(); this.keyboardWillHideListener.remove(); @@ -154,6 +157,7 @@ class FanVideoDetails extends Component { enableStartUploadFlag = () => { this.clearErrors(); + this.setState({buttonText: 'Posting...'}); this.validateData().then((res) => { utilities.saveItem(`${CurrentUser.getUserId()}-accepted-camera-t-n-c`, true); Store.dispatch( @@ -164,9 +168,11 @@ class FanVideoDetails extends Component { ); this.props.navigation.dispatch(StackActions.popToTop()); this.props.navigation.dispatch(StackActions.popToTop()); + this.setState({buttonText: 'Post'}); this.props.navigation.navigate('HomeScreen'); }).catch((err)=>{ // show error on UI. + this.setState({buttonText: 'Post'}); this.showError(err); }); }; @@ -346,7 +352,7 @@ class FanVideoDetails extends Component { TouchableStyles={[{ minWidth: '100%', borderColor: 'none', borderWidth: 0 }]} TextStyles={[Theme.Button.btnPinkText]} style={{marginBottom: 20}} - text="Post" + text={this.state.buttonText} onPress={multipleClickHandler(() => { this.enableStartUploadFlag(); })} diff --git a/src/components/FanVideoReplyDetails/TouchableButton.js b/src/components/FanVideoReplyDetails/TouchableButton.js index d6a9f7f1..28624a23 100644 --- a/src/components/FanVideoReplyDetails/TouchableButton.js +++ b/src/components/FanVideoReplyDetails/TouchableButton.js @@ -3,15 +3,20 @@ import { Image, Text, TouchableOpacity } from 'react-native'; import Theme from '../../theme/styles'; import source from '../../assets/heart.png' -const TouchableButton = ({ TouchableStyles, TextStyles, textBeforeImage, textAfterImage, onPress, imgDimension, disabled = false }) => ( +const TouchableButton = ({ TouchableStyles, TextStyles, textBeforeImage, textAfterImage, onPress, imgDimension, buttonText, disabled = false }) => ( - {textBeforeImage} - - {textAfterImage} + {buttonText ? + {buttonText}: + + {textBeforeImage} + + {textAfterImage} + + } ); diff --git a/src/components/FanVideoReplyDetails/index.js b/src/components/FanVideoReplyDetails/index.js index 81dfdace..ff3bd8e2 100644 --- a/src/components/FanVideoReplyDetails/index.js +++ b/src/components/FanVideoReplyDetails/index.js @@ -32,7 +32,9 @@ import pricer from "../../services/Pricer"; import {ensureDeivceAndSession} from "../../helpers/TransactionHelper"; import Toast from "../../theme/components/NotificationToast"; -//TODO setParams dont use +//TODO setParams dont use + +const PROCESSING_TEXT = 'Processing...'; const mapStateToProps = (state, ownProps) => { return { @@ -97,7 +99,8 @@ class FanVideoReplyDetails extends Component { }, error: null, linkError: null, - descError : null + descError : null, + buttonText: null }; } _keyboardShown = (e) => { @@ -130,8 +133,17 @@ class FanVideoReplyDetails extends Component { videoDesc: this.props.recordedVideo.video_desc, videoLink: this.props.recordedVideo.video_link }); + this.setState({buttonText: this.setButtonText()}); } + setButtonText = () => { + if (! this.checkIfReplyChargeable()){ + return 'Reply'; + } + return null; + }; + + componentWillUnmount() { this.keyboardWillShowListener.remove(); this.keyboardWillHideListener.remove(); @@ -139,11 +151,17 @@ class FanVideoReplyDetails extends Component { this.keyboardDidHideListener.remove(); } + checkIfReplyChargeable = () => { + let btAmount = this.getAmountToSend(); + return this.replyObject.isChargeble && btAmount != '0'; + }; + + ensureSession = () => { return new Promise((resolve, reject)=> { let btAmount = this.getAmountToSend(); const btInDecimal = pricer.getToDecimal(btAmount); - if (btAmount === '0'){ + if (! this.checkIfReplyChargeable()) { return resolve(); } ensureDeivceAndSession(CurrentUser.getOstUserId(), btInDecimal, (device) => { @@ -186,6 +204,8 @@ class FanVideoReplyDetails extends Component { enableStartUploadFlag = () => { this.clearErrors(); //todo @mayur button text change to validating or similar + let buttonText = this.state.buttonText; + this.setState({buttonText: PROCESSING_TEXT}); this.validateData().then((res) => { let videoOwnerId = this.replyObject.replyReceiverUserId; if (videoOwnerId === CurrentUser.getUserId()){ @@ -196,11 +216,10 @@ class FanVideoReplyDetails extends Component { this.giveUploadConsent(); }).catch(()=> { }); - - - + this.setState({buttonText: buttonText}); }).catch((err)=>{ // show error on UI. + this.setState({buttonText: buttonText}); this.showError(err); }) ; }; @@ -273,9 +292,6 @@ class FanVideoReplyDetails extends Component { }); }; - getButtonText =() => { - return "Reply | " - }; getAmountToSend = () => { let amount = this.replyObject.amountToSendWithReply ; @@ -326,6 +342,8 @@ class FanVideoReplyDetails extends Component { TouchableStyles={[{ minWidth: '100%', borderColor: 'none', borderWidth: 0 }]} TextStyles={[Theme.Button.btnPinkText]} style={{marginBottom: 20}} + // if buttonText is passed, it has priority over textBeforeImage & textAfterImage. + buttonText={this.state.buttonText} textBeforeImage='Reply | ' textAfterImage={this.getAmountToSend()} onPress={multipleClickHandler(() => { diff --git a/src/components/VideoRecorder/index.js b/src/components/VideoRecorder/index.js index 1bcdb4b0..1a3038b8 100644 --- a/src/components/VideoRecorder/index.js +++ b/src/components/VideoRecorder/index.js @@ -41,7 +41,7 @@ class VideoRecorder extends Component { progress: 0, recordingInProgress: false, acceptedCameraTnC: this.props.acceptedCameraTnC, - hasVideoReplies: this.props.hasVideoReplies, + showLightBoxOnReply: this.props.showLightBoxOnReply, cameraFrontMode: true, isLocalVideoPresent: false }; @@ -58,8 +58,8 @@ class VideoRecorder extends Component { this.setState({acceptedCameraTnC: nextProps.acceptedCameraTnC }) } - if ( nextProps.hasVideoReplies != this.state.hasVideoReplies ) { - this.setState({hasVideoReplies: nextProps.hasVideoReplies }) + if ( nextProps.showLightBoxOnReply != this.state.showLightBoxOnReply ) { + this.setState({showLightBoxOnReply: nextProps.showLightBoxOnReply }) } } @@ -146,7 +146,7 @@ class VideoRecorder extends Component { replyToVideo = () => { this.setState({ - hasVideoReplies: true + showLightBoxOnReply: false }); }; @@ -181,7 +181,7 @@ class VideoRecorder extends Component { if (this.props.isVideoTypeReply) { // TODO: return coach for posting - if (! this.state.hasVideoReplies){ + if (this.state.showLightBoxOnReply){ // Show video return @@ -312,7 +312,7 @@ class VideoRecorder extends Component { if (this.props.isVideoTypeReply){ // If video type is reply and has video replies then we will not show coach and we need to show action buttons - return this.state.hasVideoReplies; + return ! this.state.showLightBoxOnReply; } else { // If video type is post and terms and conditions are accepted then we will not show coach and we need to show action buttons return this.state.acceptedCameraTnC === 'true'; diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index 7e4edb9c..3aa1b540 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -74,15 +74,15 @@ class VideoRepliesScreen extends PureComponent { }); }, 300) - videoUploaderComponent.on('show', this.showVideoUploader); - videoUploaderComponent.on('hide', this.hideVideoUploader); + videoUploaderComponent.on('show.videoReplies', this.showVideoUploader); + videoUploaderComponent.on('hide.videoReplies', this.hideVideoUploader); } componentWillUnmount() { this.onAnimatedValueChange= () => {}; this.animatedValue.removeListener(this.listener); - videoUploaderComponent.removeListener('show'); - videoUploaderComponent.removeListener('hide'); + videoUploaderComponent.removeListener('show.videoReplies'); + videoUploaderComponent.removeListener('hide.videoReplies'); } showVideoUploader = () => { diff --git a/src/helpers/cameraHelper.js b/src/helpers/cameraHelper.js index a773ea50..90361cb4 100644 --- a/src/helpers/cameraHelper.js +++ b/src/helpers/cameraHelper.js @@ -13,7 +13,8 @@ const getVideoReplyObject = (videoId, creatorUserId) => { videoId: videoId, userId: creatorUserId, amount: ReduxGetters.getBtAmountForReply(videoId), - videoReplyCount: ReduxGetters.getVideoReplyCount(videoId) + videoReplyCount: ReduxGetters.getVideoReplyCount(videoId), + isChargeble: true //|| ReduxGetters.isVideoIsChargeable(videoId) }; }; diff --git a/src/services/CameraWorker.js b/src/services/CameraWorker.js index 390e254a..801e9641 100644 --- a/src/services/CameraWorker.js +++ b/src/services/CameraWorker.js @@ -136,6 +136,7 @@ class CameraWorker extends PureComponent { if (this.props.recorded_video.do_upload) { if (!ReduxGetters.getVideoProcessingStatus()) { + console.log('-----------------------processVideo:::VideoUploadStatusToProcessing------------------------------------'); this.VideoUploadStatusToProcessing(); } @@ -169,6 +170,10 @@ class CameraWorker extends PureComponent { processReplyVideo = async () => { + console.log( + '-----processReplyVideo--------' + ); + // let sessionCreated = await this.ensureSession(); // // if (! sessionCreated) { @@ -204,6 +209,14 @@ class CameraWorker extends PureComponent { onFlowInterrupt = (ostWorkflowContext, error) => { console.log('CameraWorker.onFlowInterrupt', ostWorkflowContext, error); + console.log('-----------------------onFlowInterrupt:::VideoUploadStatusToNotProcessing------------------------------------'); + Store.dispatch( + upsertRecordedVideo({ + do_upload: false, + go_for_tx: false + }) + ); + this.executeTx = false; this.VideoUploadStatusToNotProcessing(); this.executingTx = false; Toast.show({ @@ -229,9 +242,21 @@ class CameraWorker extends PureComponent { return metaProperties; }; + isReplyChargeable = () => { + let isChargeable = deepGet (this.props.recorded_video, 'reply_obj.isChargeble'), + amountToSendWithReply = deepGet(this.props.recorded_video, 'reply_obj.amountToSendWithReply'); + return isChargeable && amountToSendWithReply != '0'; + }; + executeTransaction = () => { + console.log('executeTransaction-------'); + console.log(goForTx,'goForTx'); + console.log(receiverUserId,'receiverUserId'); + console.log(doDiscard,'doDiscard'); + console.log(goForTx,'goForTx'); + let goForTx = this.props.recorded_video.go_for_tx, doDiscard = this.props.recorded_video.do_discard, receiverUserId = deepGet (this.props.recorded_video, 'reply_obj.replyReceiverUserId'), @@ -240,16 +265,19 @@ class CameraWorker extends PureComponent { return; } this.executeTx = true; - if ( receiverUserId === this.props.currentUserId || ! Number(amountToSendWithReply)) { + console.log('-----------------------executeTransaction:::VideoUploadStatusToProcessing------------------------------------'); + this.VideoUploadStatusToProcessing(); + console.log('CameraWorker.executeTransaction'); + + if (! this.isReplyChargeable()) { this.videoUploadedSuccessCallback(); return; - }; + } upsertRecordedVideo({ executing_tx: true }); - this.VideoUploadStatusToProcessing(); - console.log('CameraWorker.executeTransaction'); + let callbacks = {onRequestAcknowledge: this.videoUploadedSuccessCallback, onFlowInterrupt: this.onFlowInterrupt}; @@ -357,7 +385,14 @@ class CameraWorker extends PureComponent { text: responseData.err.msg, icon: 'error' }); + console.log('-----------------------/replies:::VideoUploadStatusToNotProcessing------------------------------------'); this.VideoUploadStatusToNotProcessing(); + Store.dispatch( + upsertRecordedVideo({ + do_upload: false + }) + ); + this.executeTx = false; } this.postToPepoApi = false; }) @@ -378,6 +413,7 @@ class CameraWorker extends PureComponent { async cleanUp() { // stop ffmpge processing + console.log('-----------------------cleanUp:::VideoUploadStatusToNotProcessing------------------------------------'); this.VideoUploadStatusToNotProcessing(); FfmpegProcesser.cancel(); // remove files from cache, @@ -453,6 +489,7 @@ class CameraWorker extends PureComponent { compression_processing: true }) ); + console.log('-----------------------compressVideo:::VideoUploadStatusToProcessing------------------------------------'); this.VideoUploadStatusToProcessing(); FfmpegProcesser.init(this.props.recorded_video.raw_video); @@ -517,6 +554,7 @@ class CameraWorker extends PureComponent { video_s3_upload_processing: true }) ); + console.log('-----------------------uploadVideo:::VideoUploadStatusToProcessing------------------------------------'); this.VideoUploadStatusToProcessing(); return this.uploadToS3(this.props.recorded_video.compressed_video, 'video') .then((s3Video) => { @@ -639,6 +677,7 @@ class CameraWorker extends PureComponent { }) ); } else { + console.log('-----------------------/fanvideo:::VideoUploadStatusToNotProcessing------------------------------------'); this.VideoUploadStatusToNotProcessing(); } this.postToPepoApi = false; diff --git a/src/services/ReduxGetters.js b/src/services/ReduxGetters.js index 050cd66e..b4f4367d 100644 --- a/src/services/ReduxGetters.js +++ b/src/services/ReduxGetters.js @@ -484,6 +484,12 @@ class ReduxGetters { return !!Number( deepGet(state, `current_user_video_relation_entities.id_${id}.can_delete` , 0) ); } + isVideoIsChargeable(id, state){ + state = state || Store.getState(); + return !!Number( deepGet(state, `current_user_video_relation_entities.id_${id}.is_reply_chargeable` , 0) ); + + } + getReplyDescriptionId(id, state) { state = state || Store.getState(); return deepGet(state, `reply_detail_entities.id_${id}.description_id`); diff --git a/src/store/index.js b/src/store/index.js index c33e22a4..a8f55b4f 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -2,7 +2,7 @@ import { createStore, applyMiddleware } from 'redux'; import logger from 'redux-logger'; import { reducer } from '../reducers'; -//export const store = __DEV__ === true ? createStore(reducer, applyMiddleware(logger)) : createStore(reducer); - export const store = createStore(reducer); +export const store = __DEV__ === true ? createStore(reducer, applyMiddleware(logger)) : createStore(reducer); +// export const store = createStore(reducer); export default store; From 7ac2bf6720505bdbd9e32d9ba083bbf4726fbb3e Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Tue, 26 Nov 2019 20:56:21 +0530 Subject: [PATCH 193/302] Minor fix --- src/components/FanVideoReplyDetails/index.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/FanVideoReplyDetails/index.js b/src/components/FanVideoReplyDetails/index.js index 81dfdace..e28be6fe 100644 --- a/src/components/FanVideoReplyDetails/index.js +++ b/src/components/FanVideoReplyDetails/index.js @@ -29,8 +29,9 @@ import { StackActions } from 'react-navigation'; import PepoApi from "../../services/PepoApi"; import DataContract from "../../constants/DataContract"; import pricer from "../../services/Pricer"; -import {ensureDeivceAndSession} from "../../helpers/TransactionHelper"; +import {ensureDeivceAndSession, ON_USER_CANCLLED_ERROR_MSG} from "../../helpers/TransactionHelper"; import Toast from "../../theme/components/NotificationToast"; +import { WORKFLOW_CANCELLED_MSG } from '../../services/OstSdkErrors'; //TODO setParams dont use @@ -153,10 +154,12 @@ class FanVideoReplyDetails extends Component { if ( success ) { return resolve(); } else { - Toast.show({ - text: errorMessage, - icon: 'error' - }); + if (ON_USER_CANCLLED_ERROR_MSG !== errorMessage && WORKFLOW_CANCELLED_MSG !== errorMessage) { + Toast.show({ + text: errorMessage, + icon: 'error' + }); + } return reject() } }); From 5fe8a8ed4cab620e3c936711f5c9302d5db3081c Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Tue, 26 Nov 2019 21:02:04 +0530 Subject: [PATCH 194/302] remove code --- src/helpers/cameraHelper.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/cameraHelper.js b/src/helpers/cameraHelper.js index 90361cb4..d0a9deb4 100644 --- a/src/helpers/cameraHelper.js +++ b/src/helpers/cameraHelper.js @@ -14,7 +14,7 @@ const getVideoReplyObject = (videoId, creatorUserId) => { userId: creatorUserId, amount: ReduxGetters.getBtAmountForReply(videoId), videoReplyCount: ReduxGetters.getVideoReplyCount(videoId), - isChargeble: true //|| ReduxGetters.isVideoIsChargeable(videoId) + isChargeble: ReduxGetters.isVideoIsChargeable(videoId) }; }; From 7f4635a37d59b2b58d8957b07720458db8cbf0c0 Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Tue, 26 Nov 2019 21:11:54 +0530 Subject: [PATCH 195/302] sliding up panel UI --- .../ReplyThumbnailItem.js | 14 +++-------- src/components/CustomTab/styles.js | 12 ---------- src/components/VideoReplies/index.js | 17 ++++++++----- src/components/VideoReplies/styles.js | 24 +++++++++++++------ 4 files changed, 31 insertions(+), 36 deletions(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js index c04dc57e..4b0ee1b8 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js @@ -48,7 +48,7 @@ const inlineStyle= { wrapperStyle: { width: AppConfig.thumbnailListConstants.iconWidth , height:AppConfig.thumbnailListConstants.iconHeight , - borderRadius: (AppConfig.thumbnailListConstants.iconWidth )/ 2, + borderRadius: (AppConfig.thumbnailListConstants.iconWidth)/ 2, padding: 4 }, active: { @@ -56,24 +56,16 @@ const inlineStyle= { shadowOffset: { width: 0, height: 2 }, shadowOpacity: 1, shadowRadius: 4, - elevation: 5 + elevation: 5, + overflow: 'hidden' }, unseen: { - shadowColor: 'red', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 1, shadowRadius: 4, elevation: 5, overflow: 'hidden' - // shadowColor: 'red', - // shadowOffset: { - // width: 1, - // height: 1 - // }, - // shadowOpacity: 1, - // shadowRadius: 15, - // borderRadius: 30 } } diff --git a/src/components/CustomTab/styles.js b/src/components/CustomTab/styles.js index e818becb..80f9bbbc 100644 --- a/src/components/CustomTab/styles.js +++ b/src/components/CustomTab/styles.js @@ -16,10 +16,6 @@ let stylesMap = { shadowRadius: 1, elevation: 5, alignItems: 'center' - // borderColor: 'rgba(0, 0, 0, 0.25)', - // borderWidth: 1, - // borderBottomWidth: 0, - // elevation: 8 }, tapArea:{ minHeight: 55, @@ -28,17 +24,9 @@ let stylesMap = { tabElementSkipFont: { alignSelf: 'center', marginHorizontal: 20, - // marginVertical: 10, height: 35, width: 35 } - // tabElementFriendsSkipFont: { - // alignSelf: 'center', - // marginHorizontal: 20, - // marginVertical: 10, - // height: 22, - // width: 35 - // } }; export default styles = DefaultStyleGenerator.generate(stylesMap); diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index 3aa1b540..b9d3da85 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -8,7 +8,7 @@ import { Animated ,TouchableWithoutFeedback } from 'react-native'; -import { ifIphoneX } from 'react-native-iphone-x-helper'; +import {getBottomSpace, ifIphoneX} from 'react-native-iphone-x-helper'; import pepoIcon from "../../assets/pepo-tx-icon.png"; import inlineStyles from './styles'; @@ -32,9 +32,12 @@ const { width, height } = Dimensions.get('window'); const landScape = width > height; const topPadding = getInset('top', landScape); const bottomPadding = getInset('bottom', landScape); -const bottomReplyViewHeight = 54; +const bottomReplyViewHeight = 89; const listBottomPadding = height - (height/1.5)+bottomReplyViewHeight ; +const bottomSpace = getBottomSpace([true]); +console.log('bottomSpace', bottomSpace); + class VideoRepliesScreen extends PureComponent { @@ -206,10 +209,12 @@ class VideoRepliesScreen extends PureComponent { {this.state.addRepliesVisible && ( - - - Add a reply... - + + + + Add a reply... + + )} diff --git a/src/components/VideoReplies/styles.js b/src/components/VideoReplies/styles.js index a81d1d6a..e86156f5 100644 --- a/src/components/VideoReplies/styles.js +++ b/src/components/VideoReplies/styles.js @@ -1,5 +1,6 @@ import DefaultStyleGenerator from '../../theme/styles/DefaultStyleGenerator'; import Colors from '../../theme/styles/Colors'; +import {ifIphoneX} from "react-native-iphone-x-helper"; let stylesMap = { container: { @@ -58,11 +59,14 @@ let stylesMap = { color: 'rgba(42, 41, 59, 0.7)' }, addReplyView : { - flexDirection:'row', - alignItems:'center', - justifyContent:'flex-start', width:'100%', - height:54, + ...ifIphoneX( + { + height: 89 + }, + { + height: 54 + }), shadowColor:'#000', elevation: 8, shadowOffset: { width: 0, height: 1 }, @@ -70,9 +74,15 @@ let stylesMap = { position:'absolute', bottom:0, zIndex:9999, - backgroundColor:Colors.white, - paddingVertical:18, - paddingHorizontal:12 + backgroundColor:Colors.white + }, + addReplyInnerView:{ + height: 54, + width: '100%', + flexDirection:'row', + alignItems: 'center', + paddingHorizontal:12, + backgroundColor:Colors.white, }, addReplyText : { color:Colors.black, From d5b013e3c48500e31318e2ea942fe6059cc575cd Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Tue, 26 Nov 2019 21:12:54 +0530 Subject: [PATCH 196/302] comment --- src/helpers/cameraHelper.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/helpers/cameraHelper.js b/src/helpers/cameraHelper.js index d0a9deb4..d30128fd 100644 --- a/src/helpers/cameraHelper.js +++ b/src/helpers/cameraHelper.js @@ -7,6 +7,8 @@ import Pricer from "../services/Pricer"; import ReduxGetters from "../services/ReduxGetters"; import Toast from '../theme/components/NotificationToast'; + +// creatorUserId is mandatory as without it token holder address can not be accessed. const getVideoReplyObject = (videoId, creatorUserId) => { return { videoType : AppConfig.videoTypes.reply, From 32bf5ef313af21981cec8981bea155180e49fb05 Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Tue, 26 Nov 2019 21:20:34 +0530 Subject: [PATCH 197/302] reply --- src/components/CommonComponents/BubbleList/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/CommonComponents/BubbleList/index.js b/src/components/CommonComponents/BubbleList/index.js index 8a8b45f3..7ddfb661 100644 --- a/src/components/CommonComponents/BubbleList/index.js +++ b/src/components/CommonComponents/BubbleList/index.js @@ -60,6 +60,9 @@ class BubbleList extends PureComponent { }; getListData = () => { + if ( this.props.replyCount != 0 ) { + return; + } this.getFetchService() .refresh() From cce647f697c6370e554ca545c321862f7c78b6dd Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Tue, 26 Nov 2019 21:28:46 +0530 Subject: [PATCH 198/302] reply --- src/components/CommonComponents/BubbleList/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/CommonComponents/BubbleList/index.js b/src/components/CommonComponents/BubbleList/index.js index 7ddfb661..321c003f 100644 --- a/src/components/CommonComponents/BubbleList/index.js +++ b/src/components/CommonComponents/BubbleList/index.js @@ -60,7 +60,7 @@ class BubbleList extends PureComponent { }; getListData = () => { - if ( this.props.replyCount != 0 ) { + if ( this.props.replyCount == 0 ) { return; } From 5ccb92d8e0e1fe1d17f8c91176f26534d21275b6 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Tue, 26 Nov 2019 21:57:53 +0530 Subject: [PATCH 199/302] adding reply detail relations to redux --- src/actions/constants.js | 2 ++ src/actions/index.js | 5 +++++ .../ReplyThumbnailItem.js | 2 +- .../CommonComponents/SingleBubble/index.js | 2 +- src/components/ReplyCollection/index.js | 3 +-- src/helpers/ReplyHelper.js | 13 +++++++------ src/reducers/index.js | 7 +++++++ src/services/ReduxGetters.js | 15 ++++++++++----- src/services/ReduxSetters.js | 1 + 9 files changed, 35 insertions(+), 15 deletions(-) diff --git a/src/actions/constants.js b/src/actions/constants.js index e6075c36..d5817792 100644 --- a/src/actions/constants.js +++ b/src/actions/constants.js @@ -19,6 +19,7 @@ const UPSERT_VIDEO_ENTITIES = 'UPSERT_VIDEO_ENTITIES'; const UPSERT_VIDEO_STAT_ENTITIES = 'UPSERT_VIDEO_STAT_ENTITIES'; const UPSERT_REPLY_DETAIL_ENTITIES = 'UPSERT_REPLY_DETAIL_ENTITIES'; const UPSERT_CURRENT_USER_VIDEO_RELATION_ENTITIES = 'UPSERT_CURRENT_USER_VIDEO_RELATION_ENTITIES'; +const UPSERT_CURRENT_USER_REPLY_DETAIL_RELATION_ENTITIES = 'UPSERT_CURRENT_USER_REPLY_DETAIL_RELATION_ENTITIES'; const UPSERT_HOME_FEED_ENTITIES = 'UPSERT_HOME_FEED_ENTITIES'; const UPSERT_IMAGE_ENTITIES = 'UPSERT_IMAGE_ENTITIES'; const UPDATE_BALANCE = 'UPDATE_BALANCE'; @@ -65,6 +66,7 @@ export { UPSERT_USER_STAT_ENTITIES, UPSERT_REPLY_DETAIL_ENTITIES, UPSERT_CURRENT_USER_VIDEO_RELATION_ENTITIES, + UPSERT_CURRENT_USER_REPLY_DETAIL_RELATION_ENTITIES, UPSERT_LINK_ENTITIES, UPSERT_VIDEO_ENTITIES, UPSERT_VIDEO_STAT_ENTITIES, diff --git a/src/actions/index.js b/src/actions/index.js index 419c81bd..a6ab32c7 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -133,6 +133,11 @@ export const upsertCurrentUserVideoRelationEntities = (data) => ({ payload: { current_user_video_relation_entities: data } }); +export const upsertCurrentUserReplyDetailRelationEntities = (data) => ({ + type: types.UPSERT_CURRENT_USER_REPLY_DETAIL_RELATION_ENTITIES, + payload: { current_user_reply_detail_relation_entities: data } +}); + export const upsertHomeFeedEntities = (data) => ({ type: types.UPSERT_HOME_FEED_ENTITIES, payload: { home_feed_entities: data } diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js index 4b0ee1b8..b6a851ab 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js @@ -10,7 +10,7 @@ import multipleClickHandler from '../../../services/MultipleClickHandler'; const mapStateToProps = (state, ownProps) => { return { - seen: reduxGetters.isVideoSeen( reduxGetters.getReplyEntityId(deepGet(ownProps.payload,'reply_detail_id'))) + seen: reduxGetters.isReplySeen( deepGet(ownProps.payload,'reply_detail_id')) }; }; diff --git a/src/components/CommonComponents/SingleBubble/index.js b/src/components/CommonComponents/SingleBubble/index.js index ed8f1f8d..47af57b9 100644 --- a/src/components/CommonComponents/SingleBubble/index.js +++ b/src/components/CommonComponents/SingleBubble/index.js @@ -7,7 +7,7 @@ import inlineStyles from './styles'; const mapStateToProps = (state, ownProps) => { return { - seen: reduxGetters.isVideoSeen( reduxGetters.getReplyEntityId(ownProps.replyDetailId)) + seen: reduxGetters.isReplySeen(ownProps.replyDetailId) }; }; diff --git a/src/components/ReplyCollection/index.js b/src/components/ReplyCollection/index.js index 99a82db5..f575fadf 100644 --- a/src/components/ReplyCollection/index.js +++ b/src/components/ReplyCollection/index.js @@ -180,9 +180,8 @@ class ReplyCollection extends PureComponent { _renderVideoReplyThumbnail( item, index ) { const reply_detail_id = deepGet(item,`payload.${DataContract.replies.replyDetailIdKey}`); - const videoId = ReduxGetters.getReplyEntityId(reply_detail_id); return ( - {ReduxGetters.getCanDeleteVideo( videoId ) && ({ + ...state, + current_user_reply_detail_relation_entities: assignIn({}, state.current_user_reply_detail_relation_entities, action.payload.current_user_reply_detail_relation_entities) + }), [upsertVideoDescriptionEntities]: (state, action) => ({ ...state, video_description_entities: assignIn( diff --git a/src/services/ReduxGetters.js b/src/services/ReduxGetters.js index b4f4367d..c32358c9 100644 --- a/src/services/ReduxGetters.js +++ b/src/services/ReduxGetters.js @@ -469,19 +469,24 @@ class ReduxGetters { return deepGet(state, `reply_detail_entities.id_${id}.entity_id`); } - getCurrentUserVideoRelationEntity(id, state){ + getVideoRelationEntity(id, state){ state = state || Store.getState(); return deepGet(state, `current_user_video_relation_entities.id_${id}`); } - isVideoSeen(id, state){ + getReplyDetailRelationEntity(id, state){ state = state || Store.getState(); - return deepGet(state, `current_user_video_relation_entities.id_${id}.has_seen`); + return deepGet(state, `current_user_reply_detail_relation_entities.id_${id}`); } - getCanDeleteVideo(id, state){ + isReplySeen(id, state){ state = state || Store.getState(); - return !!Number( deepGet(state, `current_user_video_relation_entities.id_${id}.can_delete` , 0) ); + return deepGet(state, `current_user_reply_detail_relation_entities.id_${id}.has_seen`); + } + + getCanDeleteReply(id, state){ + state = state || Store.getState(); + return !!Number( deepGet(state, `current_user_reply_detail_relation_entities.id_${id}.can_delete` , 0) ); } isVideoIsChargeable(id, state){ diff --git a/src/services/ReduxSetters.js b/src/services/ReduxSetters.js index 37bbd9b2..f14eae56 100644 --- a/src/services/ReduxSetters.js +++ b/src/services/ReduxSetters.js @@ -16,6 +16,7 @@ const knownEntitiesDispatcherMap = { video_replies: 'upsertVideoReplyEntities', reply_details: 'upsertReplyDetailEntities', current_user_video_relations: 'upsertCurrentUserVideoRelationEntities', + current_user_reply_detail_relations: 'upsertCurrentUserReplyDetailRelationEntities', images: 'upsertImageEntities', current_user_video_contributions: 'upsertVideoContributionEntities', current_user_user_contributions: 'upsertUserContributionEntities', From d6e8deb685c33b2f8dba20b42adc24d1632f7af4 Mon Sep 17 00:00:00 2001 From: Shraddha Date: Tue, 26 Nov 2019 20:32:16 +0530 Subject: [PATCH 200/302] bug fix --- src/components/VideoReplies/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index b9d3da85..329af5a4 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -191,9 +191,9 @@ class VideoRepliesScreen extends PureComponent { Replies to {ReduxGetters.getUserName(this.userId)} - Send a reply with{' '} - - { Pricer.getToBT(Pricer.getFromDecimal(ReduxGetters.getBtAmountForReply(this.videoId )), 2)} + {/*Send a reply with{' '}*/} + {/**/} + {/*{ Pricer.getToBT(Pricer.getFromDecimal(ReduxGetters.getBtAmountForReply(this.videoId )), 2)}*/} Date: Tue, 26 Nov 2019 22:00:26 +0530 Subject: [PATCH 201/302] bug fix --- .../CommonComponents/VideoThumbnail/ReplyThumbnail.js | 2 +- .../CommonComponents/VideoThumbnail/VideoThumbnail.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/CommonComponents/VideoThumbnail/ReplyThumbnail.js b/src/components/CommonComponents/VideoThumbnail/ReplyThumbnail.js index 279ad439..2942f719 100644 --- a/src/components/CommonComponents/VideoThumbnail/ReplyThumbnail.js +++ b/src/components/CommonComponents/VideoThumbnail/ReplyThumbnail.js @@ -24,7 +24,7 @@ class ReplyThumbnail extends PureComponent { videoDesc = reduxGetters.getVideoDescription(reduxGetters.getReplyDescriptionId(videoId)) , replyBtAmount = this.getReplyStats(replyId) ; - return ; + return ; } } export default ReplyThumbnail; diff --git a/src/components/CommonComponents/VideoThumbnail/VideoThumbnail.js b/src/components/CommonComponents/VideoThumbnail/VideoThumbnail.js index 97e1ff19..63d82e00 100644 --- a/src/components/CommonComponents/VideoThumbnail/VideoThumbnail.js +++ b/src/components/CommonComponents/VideoThumbnail/VideoThumbnail.js @@ -23,7 +23,7 @@ class VideoThumbnail extends PureComponent { videoDesc = reduxGetters.getVideoDescription(reduxGetters.getVideoDescriptionId(videoId)) , videoBtAmount = this.getVideoStats(videoId) ; - return ; + return ; } } export default VideoThumbnail; From d77968e21170549e0dc3a4619d8b2caefbe83ed0 Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Tue, 26 Nov 2019 22:13:44 +0530 Subject: [PATCH 202/302] video reply icon and Bubble List Pause --- src/assets/video-reply.png | Bin 0 -> 2538 bytes src/assets/video_reply.png | Bin 1935 -> 0 bytes .../CommonComponents/ReplyIcon/index.js | 4 ++-- .../CommonComponents/ReplyIcon/styles.js | 4 ++-- .../FullScreenVideoRow.js | 2 +- .../UserVideoHistory/UserVideoHistoryRow.js | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 src/assets/video-reply.png delete mode 100644 src/assets/video_reply.png diff --git a/src/assets/video-reply.png b/src/assets/video-reply.png new file mode 100644 index 0000000000000000000000000000000000000000..8a3b5292bfd2b2aa070d90e19cd86c6e92aedf43 GIT binary patch literal 2538 zcmVkRN6vmg8ndKFkUdU0*MN#A`$qbiB`f7 zO^sN@=r2-Dh#Ew^fl*W}VieIPM8TA5TWtYv7->KWtx!OX1W^!Byw&G9?zNr0&+N<0 zp4ofmobOBCvu4)Jto6ZLPINNCbO6EUyAbf|cMX;Qli3WRPcy^Y6}qCz1}j-^V$2FSrxj zmBAhazMuWZ+n^hpx#I}80w-SG!D`aOI!^tERB@gJs`g*u|J7Ia@7Uh~ZUQ$Wtox0# zs);Clg9vvJ7oP&w0EIgQNNf^~&6!yeR|oz8egw9IEeQKJ(wW;#g+x4~>b2ku@CINL z*#zNmW2hxz74f^^8n6pdZ7pVEGZ7L2kL7L^?=4^{NW`$&I!nGkfal)=-$u~er+pVw z6%qkY<_6CL3YiF)_C42GU%Dsz(@!AijdfO*ExUFh5zjj8`xNlSz^2m? z3c9WCo2^Yq1bhO{p9VI7qk;X0d5g)Cpto_;3i|!JZoU>F5%Cxtz687!EJgwQ^-3J< z;=ub6bYK4olkQh4BmzDaht37-fl~)ZrD6YPz&=z_KMuZtpzc>Uua^P2@&j)dbP<9oZfToHNJM-V zHD3;l#)!glGAN*fp!XoAi}|Ijw2+9niW;v1E@nqxSc?AcMMmcy@HWIOwU%2diV$%P zm0k}*L`bN>oL4(V+XA=8l_{^VkW_R!6@48X2qF^8u%3U7T>4CPGaR3kf6Cz8LQN|b zoJdidfS;hSdKj?J{0BIbX7=afRx!4ai1=~}by4^!VC?J0btKN~VZgbjZ!^3JF`cH2 zw6O$1L|1CA1-?pAxH%r_MVyewfCHdEgHsXnzPuB%c_W2H#20XZ!{cXzXi~H6)xYh^ z&+ox0h^eRpZD@2MqC$TbIA07A2hv#E0S7<^(#J;CFjPn`UI(1)$LMqvll2{!`?Uns zn}<~~uxaJOm0b7(;6ixVY#DGQ`v_P~6Z^+JS8^i~5p70oQlmM|V{Q6*2AuQuiw9Mm zDu12HP_Iat{X!bDVeMexpSZa?xtbO7WHMs`ATiVY)Nihxl-!&XlKyce z8Hc9KNL$0ei_mUv;U-1oiq^Ouj%FEfu)55QB;+C4qp{s82IjQO3K;{PR_WJucAk*2 z5YXkOH5&%sJR#%RV{7#5I%@Fs2RGCnA5-KL5kx4g+(q zN2ZAUHJPQqEgO{1jDZJv9=Xrj=Y;IMk@Yk7W56>rO$t}+EMr@`Dn+FGzI5d`fWq3r zfFsr&$g2 zBr5%4-f&sO9Z=Q&Hmn)

Hd08hrl4<-e0pd}aj*^s zJ`DF)k5lkiLRt_7ew4)dW!Q8W_#B*ne%z{t4tDYiVF0v|{B!b-MP4NgIJmhQ5jPYm zZS06lg;K!1g&No&CZeh*VCba|{@T+J^{~EC07y z>~Coytp+iVC;1Za2YKV|0!S!fuAlmUDBp>QyGmR?cgaLTS^{DoLE@)q6^KOxNGM>= z&+h?mMZ~)cTsQC3iJL?mxQ|j#1@@ahxsJsHNEl&qBv)SrubWgv>zX(sEhHJyc`Vz` zH;)FDmYwQY0I34*1^!>GTdKOB%E?AdA4oguT3?lu3#1(TLPfk7T#AVPyh>$O`2a-+ z5!2^pj>INzx+}ZW*%hRK^1K~vgdd}^a;qaEeR0cIEB#5d#cT@b;O~3j5(K=xPBJQw zNSr+jJf}{l8(y{o+7ew0K81jHPQ%|yBa$Z7S3{f&9Rw;Zdm3a+P)BM$?NY7*Uq--v z6O>o@(yAlUh4ll$Vh}Nn0eq{?|Jm@zm57!uoK+qHsbxAv@teuL?WWE zPJRVAf2>PHNp%3R6&wmyfb4%k@VKyk&l|N==(&Cl6T(Gm z_k~}R*av9bTLL#Dri|xSm)I!&Ce!to0*&_HT#}9_{G5f@@5)2e=TGvsB z{a0BLlTgmVz6mxVo{<N9PBUye6<*l?T?sZL;A5m=6){j$NSnboj!}1N zHhp-y6I>5&Ks>*U5>^8Pg_=nE$ffvj128hvhd{B6Qb(LNoqK_+A=|+Ah&))Bf)x@{ ze-QI|B@~07*qoM6N<$f;Ahg Ar~m)} literal 0 HcmV?d00001 diff --git a/src/assets/video_reply.png b/src/assets/video_reply.png deleted file mode 100644 index e6d36d02214a148377a2cf47470ae242f6203716..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1935 zcmV;A2XOd_P)?tSmx z1^>6t-e(VM|IgZMuf6Z9X;lKLudi=Iw>>~7a5iWk;3TQ|2OI$hYiepvk+uk_DOL+6 z-kLu8fPr8%7z8AuLx8rV?SKTG29hBGCxYkwq(6d6m)CK!J4?Q-|0_6Ry0+=4NM;*CerzA(2|L8{^~aeeeX8Y6p}#(9S@_^$3b&C z%6#S}A@k7N?Y?M9kwJ&&(AyJWK+(OHw}bu+w-Eh17dvc<3_7|WTwQF3&D4H4<4!Gh z>;xIGdLA9!4vGnnF(=M`5K}MRGn~6O2t}g4DB(<*$Ng;;f`K6}nQf(wrtLXO%w8#}jl? zcJgotSavU1#{0;*Y8idOxu6=P3zP69oe%;t12gYU6fI;7SOOuJSr8Vx2 z%%$=egrs&E$*}R?5e+J>_$UgCbcynZ`jGJ;6=+I^7bV$DiQ#5O~jqDF*2+=2n_Y1HQSH3&uf9VNR=*MGoSQ}W25Ty zxFg&Ayw<$S7cLWJHK_HWf~5}KSB3PSM7~3)EL(OsOQmgs4A}gM8tXtMTgNx(|3h-7 zOzr}nT>`m?u}S}=W!T_Nu)~K66vOUUf+e3+e+mzgp?9)Ukhy1{>`7lKd0 z5zrDv<+p&j=$o=)h!{-SQ=k{fN1W%O24vVnU?Gq2s1GqhZAo$fWtM}fVpTS~6(9tN<J!|<>>G#`Q8(&8Q zZ_vvrT0$-O9K4IN28I~|5r*3@f@?t5C7;nCduA)eT3kGn45&5C1n$M97MG?6$6eq< zupSb8&Jc9+j>7ZAL*UYkm-%JtsQwaTIBw%)FlamKECPDzTtqMbD{u{KNsaj!zx*FS zPwt(Hq4Wmu9oUY7DW5<-CFnGg%mU!`o#PZL?n0{=$MF&pxl9;Te=-k@1#!N`_{7P) z160x+dL@_G&q*a=E5Nm2Ah4_tD0GLQX#;U-ZUi&Y`FMl36f_{i zN+>yvMC;JW=-fQX+R<8|bIXYU`guEOYi!_IN2l5~NcAHw!S+GE2WhFqU1KG1DW8ZM zBr6$KW+Lt&PFm-7*s^?uK1S1K9`LLCYgco~&kXu7bJ!L)c-yE7G}a#!CG@cgLN?RM zO<)EX1hj~9N=F9M`eG&0GGbfiSpiZc;d*c<(CT!OI?Hm1%X>N>Cvu6XMA^tlpE1Pf z9LIq1pf`{xeTG|Uu5yZsk(M3m5KaeeO+l+PG!MhBp zDl*b%1~Ep^I%z|C4~^Y{L7zLybC9u&G()PEjN~jKMa$4)+{!NpI_9O2;ck>6{{sRQ V;{v`G=RN=c002ovPDHLkV1i?Dd~W~% diff --git a/src/components/CommonComponents/ReplyIcon/index.js b/src/components/CommonComponents/ReplyIcon/index.js index 6da07b00..1d1f9386 100644 --- a/src/components/CommonComponents/ReplyIcon/index.js +++ b/src/components/CommonComponents/ReplyIcon/index.js @@ -5,7 +5,7 @@ import {withNavigation} from "react-navigation"; import reduxGetter from '../../../services/ReduxGetters'; import inlineStyles from './styles'; import multipleClickHandler from "../../../services/MultipleClickHandler"; -import reply_video from '../../../assets/video_reply.png'; +import reply_video from '../../../assets/video-reply.png'; import Utilities from '../../../services/Utilities'; import NavigationService from "../../../services/NavigationService"; import utilities from "../../../services/Utilities"; @@ -47,7 +47,7 @@ class ReplyIcon extends PureComponent { this.replyVideo())} > - + ); } diff --git a/src/components/CommonComponents/ReplyIcon/styles.js b/src/components/CommonComponents/ReplyIcon/styles.js index 20f8a946..70893536 100644 --- a/src/components/CommonComponents/ReplyIcon/styles.js +++ b/src/components/CommonComponents/ReplyIcon/styles.js @@ -5,8 +5,8 @@ let stylesMap = { replyIconWrapper : { marginBottom: 5, - height: 50, - width: 50, + height: 40, + width: 40, alignItems: 'center', justifyContent: 'center' }, diff --git a/src/components/FullScreenVideoCollection/FullScreenVideoRow.js b/src/components/FullScreenVideoCollection/FullScreenVideoRow.js index d324a553..b85e2fc5 100644 --- a/src/components/FullScreenVideoCollection/FullScreenVideoRow.js +++ b/src/components/FullScreenVideoCollection/FullScreenVideoRow.js @@ -64,7 +64,7 @@ class FullScreeVideoRow extends PureComponent { {!!this.videoId && !!this.userId && ( - + diff --git a/src/components/UserVideoHistory/UserVideoHistoryRow.js b/src/components/UserVideoHistory/UserVideoHistoryRow.js index df54f8e8..f9b09a3a 100644 --- a/src/components/UserVideoHistory/UserVideoHistoryRow.js +++ b/src/components/UserVideoHistory/UserVideoHistoryRow.js @@ -75,9 +75,9 @@ class UserVideoHistoryRow extends PureComponent { {!!this.props.videoId && !!this.props.userId && ( - + - + From 9c5b77d487e4957599fb4a9781915bbdc59cde51 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Tue, 26 Nov 2019 22:24:49 +0530 Subject: [PATCH 203/302] Minor fix --- src/components/CommonComponents/BubbleList/index.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/CommonComponents/BubbleList/index.js b/src/components/CommonComponents/BubbleList/index.js index 321c003f..db9a2764 100644 --- a/src/components/CommonComponents/BubbleList/index.js +++ b/src/components/CommonComponents/BubbleList/index.js @@ -10,6 +10,7 @@ import multipleClickHandler from '../../../services/MultipleClickHandler'; import {FetchServices} from "../../../services/FetchServices"; import SingleBubble from '../SingleBubble'; import {connect} from "react-redux"; +import Utilities from '../../../services/Utilities'; const mapStateToProps = (state, ownProps) => { return { @@ -83,9 +84,6 @@ class BubbleList extends PureComponent { }; - - - getBubbleListJSX = () => { let listToRender = this.state.list; return listToRender.length? listToRender.map((item) => { @@ -118,9 +116,14 @@ class BubbleList extends PureComponent {         }); } + onIconClick = () => { + if(!Utilities.checkActiveUser()) return; + this.onClickHandler(); + } + render() { return - {this.onClickHandler()})} + {this.onIconClick()})} style={{flexDirection: 'row-reverse', marginRight: 5}}>{this.getBubbleListJSX()} {/*{this.moreReplyText()}*/} From 17edc19224c38856f17cd0044ec7451b108fb2f1 Mon Sep 17 00:00:00 2001 From: Akshay Raje Date: Tue, 26 Nov 2019 22:29:37 +0530 Subject: [PATCH 204/302] Android full screen video --- src/services/NavigationStateHandler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/NavigationStateHandler.js b/src/services/NavigationStateHandler.js index 40122bfd..359c6e9f 100644 --- a/src/services/NavigationStateHandler.js +++ b/src/services/NavigationStateHandler.js @@ -5,7 +5,7 @@ import Colors from "../theme/styles/Colors"; import NavigationService from './NavigationService'; import AppConfig from '../constants/AppConfig'; -const routesWithoutStatusBar = ['Home', 'HomeScreen', 'VideoPlayer', 'CaptureVideo', 'CaptureImageScreen', 'ImageGalleryScreen', 'UserVideoHistory', 'VideoReplies', 'FullScreenReplyCollection', 'VideoReplyPlayer']; +const routesWithoutStatusBar = ['Home', 'HomeScreen', 'VideoPlayer', 'CaptureVideo', 'CaptureImageScreen', 'ImageGalleryScreen', 'UserVideoHistory', 'VideoReplies', 'FullScreenVideoCollection', 'FullScreenReplyCollection', 'VideoReplyPlayer']; const typesToIgnore = ['Navigation/COMPLETE_TRANSITION', 'Navigation/MARK_DRAWER_SETTLING', 'Navigation/MARK_DRAWER_IDLE', 'Navigation/DRAWER_CLOSED']; const routesAnalyticsMap = AppConfig.routesAnalyticsMap; From 59366e8549b293de10dffa0cf7170af3641ffe44 Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Tue, 26 Nov 2019 22:36:18 +0530 Subject: [PATCH 205/302] VideoReplyRow Icon --- src/components/FullScreenReplyCollection/VideoReplyRow.js | 4 +++- src/constants/AppConfig.js | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index f4b072ff..7c3de6b5 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -141,7 +141,9 @@ class VideoReplyRow extends PureComponent { diff --git a/src/constants/AppConfig.js b/src/constants/AppConfig.js index d5d602ba..4e8fb093 100644 --- a/src/constants/AppConfig.js +++ b/src/constants/AppConfig.js @@ -342,8 +342,8 @@ export default { iconHeight:44, // this is width of profile icon + shadow around it. iconWidth: 44, - parentIconHeight: 50, - parentIconWidth: 50 + parentIconHeight: 40, + parentIconWidth: 40 }, VideoScreenObject : { ...ifIphoneX( From 157a5099f9a0e6d205963233d381ccd48824971f Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Tue, 26 Nov 2019 22:40:50 +0530 Subject: [PATCH 206/302] cross icon white --- src/assets/cross-icon-white.png | Bin 0 -> 739 bytes src/components/VideoRecorder/index.js | 3 ++- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 src/assets/cross-icon-white.png diff --git a/src/assets/cross-icon-white.png b/src/assets/cross-icon-white.png new file mode 100644 index 0000000000000000000000000000000000000000..97a9f86bb72c026f9b186b6ad643d8dd8245d9d9 GIT binary patch literal 739 zcmV<90v!E`P)5(D6Kx3mOmqXuOo51NNL5MhFpzLlyKw+))rY zoZd1w7(|62MEA9V$T<@WzjK#1;R1=$Qy)cx6Dn9mCFpWH9a;m^iyEjARA!yv#4 zAzHsS5Zd6!J?Sx6G8pFW0#T~=xkw>5m}n46{7VK=gqb97GG| z3~?5_C8^8dbfj}+iwKnEro|pDN#s1QE3y%^CSr2g<1x$+LV2L*3*!$F0cJQ5Jz%0i z6e=P{ zp^&d^+9qEV%)gA+$_^1dJ8gk=`w#I$BZrMOToSMGWBhZ|IiLo*Ht-Yt3g5;nh$poU VovCU^5Xb-k002ovPDHLkV1ig3LU;fG literal 0 HcmV?d00001 diff --git a/src/components/VideoRecorder/index.js b/src/components/VideoRecorder/index.js index 1a3038b8..d1a84d7a 100644 --- a/src/components/VideoRecorder/index.js +++ b/src/components/VideoRecorder/index.js @@ -20,6 +20,7 @@ import { ActionSheet, Button } from 'native-base'; import Store from '../../store'; import { upsertRecordedVideo } from '../../actions'; import closeIcon from '../../assets/camera-cross-icon.png'; +import closeIconWhite from '../../assets/cross-icon-white.png'; import { withNavigation } from 'react-navigation'; import AppConfig from '../../constants/AppConfig'; import deepGet from 'lodash/get'; @@ -185,7 +186,7 @@ class VideoRecorder extends Component { // Show video return - + From 9fe2c520be871a685af29dd8f49f245620712247 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Tue, 26 Nov 2019 22:48:11 +0530 Subject: [PATCH 207/302] fix for white cross icon on post a reply page --- src/components/VideoRecorder/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/VideoRecorder/index.js b/src/components/VideoRecorder/index.js index d1a84d7a..e5db3ab0 100644 --- a/src/components/VideoRecorder/index.js +++ b/src/components/VideoRecorder/index.js @@ -185,8 +185,8 @@ class VideoRecorder extends Component { if (this.state.showLightBoxOnReply){ // Show video return - - + + From afc1ad3dab835ee9006259b80b2adf8ed8a6fd86 Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Wed, 27 Nov 2019 12:52:19 +0530 Subject: [PATCH 208/302] loader fix --- src/components/VideoReplies/index.js | 8 ++++---- src/services/CameraWorker.js | 5 ----- src/store/index.js | 4 ++-- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index 329af5a4..488d0257 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -77,15 +77,15 @@ class VideoRepliesScreen extends PureComponent { }); }, 300) - videoUploaderComponent.on('show.videoReplies', this.showVideoUploader); - videoUploaderComponent.on('hide.videoReplies', this.hideVideoUploader); + videoUploaderComponent.on('show', this.showVideoUploader); + videoUploaderComponent.on('hide', this.hideVideoUploader); } componentWillUnmount() { this.onAnimatedValueChange= () => {}; this.animatedValue.removeListener(this.listener); - videoUploaderComponent.removeListener('show.videoReplies'); - videoUploaderComponent.removeListener('hide.videoReplies'); + videoUploaderComponent.removeListener('show' , this.showVideoUploader , this); + videoUploaderComponent.removeListener('hide' , this.hideVideoUploader , this); } showVideoUploader = () => { diff --git a/src/services/CameraWorker.js b/src/services/CameraWorker.js index 801e9641..f2860c52 100644 --- a/src/services/CameraWorker.js +++ b/src/services/CameraWorker.js @@ -251,11 +251,6 @@ class CameraWorker extends PureComponent { executeTransaction = () => { - console.log('executeTransaction-------'); - console.log(goForTx,'goForTx'); - console.log(receiverUserId,'receiverUserId'); - console.log(doDiscard,'doDiscard'); - console.log(goForTx,'goForTx'); let goForTx = this.props.recorded_video.go_for_tx, doDiscard = this.props.recorded_video.do_discard, diff --git a/src/store/index.js b/src/store/index.js index a8f55b4f..b386dca5 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -2,7 +2,7 @@ import { createStore, applyMiddleware } from 'redux'; import logger from 'redux-logger'; import { reducer } from '../reducers'; -export const store = __DEV__ === true ? createStore(reducer, applyMiddleware(logger)) : createStore(reducer); -// export const store = createStore(reducer); +// export const store = __DEV__ === true ? createStore(reducer, applyMiddleware(logger)) : createStore(reducer); + export const store = createStore(reducer); export default store; From 52426d02321b291ea08b9e377ea631e466bb3d42 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Wed, 27 Nov 2019 13:13:01 +0530 Subject: [PATCH 209/302] is active fix --- .../ReplyThumbnailItem.js | 4 ++-- .../InvertedReplyThumbnailList/index.js | 16 ++++++++-------- .../CommonComponents/VideoReplyPlayer/index.js | 6 ++++++ .../FullScreenReplyCollection/VideoReplyRow.js | 3 ++- .../FullScreenReplyCollection/index.js | 1 - .../FullScreenVideoCollection/index.js | 9 +++++++-- 6 files changed, 25 insertions(+), 14 deletions(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js index b6a851ab..706c8f42 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js @@ -25,13 +25,13 @@ class ReplyThumbnailItem extends Component { render() { return { this.props.onClickHandler();})} - style={[ this.isActiveOrUnseen() && inlineStyle.wrapperStyle, !this.props.seen && inlineStyle.unseen, this.props.isActive() && inlineStyle.active]}> + style={[ this.isActiveOrUnseen() && inlineStyle.wrapperStyle, !this.props.seen && inlineStyle.unseen, this.props.isActive && inlineStyle.active]}> } isActiveOrUnseen = () => { - return ! this.props.seen || this.props.isActive(); + return !this.props.seen || this.props.isActive; } } diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index 8efb9aec..6a8128f8 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -155,7 +155,7 @@ class InvertedReplyList extends PureComponent { } getFetchUrl = () => { - return `/videos/${this.props.videoId}/replies`; + return DataContract.replies.getReplyListApi(this.props.videoId); }; scrollToTop(){ @@ -209,15 +209,16 @@ class InvertedReplyList extends PureComponent { }; _renderItem = ({item, index}) => { - return - {this.onItemClick(index, item)}} isActive={()=>{return this.isActive( index )} }/> + {this.onItemClick(index, item)}} isActive={this.isActiveEntity( index , item)} /> ; - }; - isActive = ( index )=>{ - return this.props.showActiveIndicator && this.props.currentIndex == index; + isActiveEntity = ( index , item )=>{ + if(typeof this.props.isActiveEntity == "function" ){ + return this.props.isActiveEntity(this.props.fullVideoReplyId , item , index) ; + } + return this.props.currentIndex == index; } setListRef = (ref) => { @@ -279,8 +280,7 @@ class InvertedReplyList extends PureComponent { InvertedReplyList.defaultProps = { paginationService : null, doRender: true, - currentIndex: 0, - showActiveIndicator: false + currentIndex: 0 }; //make this component available to the app diff --git a/src/components/CommonComponents/VideoReplyPlayer/index.js b/src/components/CommonComponents/VideoReplyPlayer/index.js index ac2b410a..3baf1618 100644 --- a/src/components/CommonComponents/VideoReplyPlayer/index.js +++ b/src/components/CommonComponents/VideoReplyPlayer/index.js @@ -88,6 +88,11 @@ class VideoReplyPlayer extends PureComponent { }); } + isActiveEntity = (fullVideoReplyId , item , index)=> { + let replyId = deepGet(item, `payload.${DataContract.replies.replyDetailIdKey}`) + return fullVideoReplyId == replyId; + } + render() { if(this.state.isDeleted){ return @@ -103,6 +108,7 @@ class VideoReplyPlayer extends PureComponent { replyDetailId={this.replyDetailId} getPixelDropData={this.getPixelDropData} parentClickHandler={this.parentClickHandler} + isActiveEntity={this.isActiveEntity} />)} diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index 7c3de6b5..a1428625 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -123,7 +123,8 @@ class VideoReplyRow extends PureComponent { paginationService={this.props.paginationService} onChildClickDelegate={this.props.onChildClickDelegate} currentIndex={this.props.currentIndex} - showActiveIndicator={this.props.showActiveIndicator} + isActiveEntity={this.props.isActiveEntity} + fullVideoReplyId={this.props.replyDetailId} /> diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index f6687fb7..837a6656 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -172,7 +172,6 @@ class FullScreenReplyCollection extends PureComponent{ onChildClickDelegate={this.childClickHandler} parentClickHandler={this.parentClickHandler} currentIndex={this.state.activeIndex} - showActiveIndicator={true} // conditional delegate /> ; } diff --git a/src/components/FullScreenVideoCollection/index.js b/src/components/FullScreenVideoCollection/index.js index 5e8a9ed3..7a31d27e 100644 --- a/src/components/FullScreenVideoCollection/index.js +++ b/src/components/FullScreenVideoCollection/index.js @@ -171,7 +171,12 @@ class FullScreenVideoCollection extends PureComponent{ userId: parentUserId, videoId: parentVideoId }); - } + } + + isActiveEntity = (fullVideoReplyId , item , index)=> { + let replyId = deepGet(item, `payload.${DataContract.replies.replyDetailIdKey}`) + return fullVideoReplyId == replyId; + } _renderVideoReplyRow(item, index){ let userId = deepGet(item,'payload.user_id'), @@ -186,7 +191,7 @@ class FullScreenVideoCollection extends PureComponent{ userId={userId} replyDetailId={replyDetailId} parentClickHandler={()=>{this.parentClickHandler(replyDetailId)}} - showActiveIndicator={true} + isActiveEntity={this.isActiveEntity} /> ; } From bfd6b082495c1a43beae217514bd9f85de4e5744 Mon Sep 17 00:00:00 2001 From: Aniket Date: Wed, 27 Nov 2019 13:36:43 +0530 Subject: [PATCH 210/302] sdk version updated --- ios/Cartfile | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/Cartfile b/ios/Cartfile index 6ad59fcb..50d55200 100644 --- a/ios/Cartfile +++ b/ios/Cartfile @@ -1 +1 @@ -github "ostdotcom/ost-wallet-sdk-ios" == 2.3.4 +github "ostdotcom/ost-wallet-sdk-ios" == 2.3.5 diff --git a/package.json b/package.json index 0c0e2490..5daab109 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "test": "jest" }, "dependencies": { - "@ostdotcom/ost-wallet-sdk-react-native": "2.3.9", + "@ostdotcom/ost-wallet-sdk-react-native": "2.3.10", "@react-native-community/async-storage": "1.6.1", "@react-native-community/cameraroll": "1.1.1", "@react-native-community/netinfo": "3.2.1", From 05f493b011c8851fa6d8d4239ef7d2c6b634b0f7 Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Wed, 27 Nov 2019 14:55:21 +0530 Subject: [PATCH 211/302] fix for cell box shadow --- .../InvertedReplyThumbnailList/ReplyThumbnailItem.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js index 706c8f42..904493fa 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js @@ -53,15 +53,15 @@ const inlineStyle= { }, active: { shadowColor: '#fff', - shadowOffset: { width: 0, height: 2 }, + shadowOffset: { width: 0, height: 0 }, shadowOpacity: 1, shadowRadius: 4, elevation: 5, overflow: 'hidden' }, unseen: { - shadowColor: 'red', - shadowOffset: { width: 0, height: 2 }, + shadowColor: '#ff5566', + shadowOffset: { width: 0, height: 0 }, shadowOpacity: 1, shadowRadius: 4, elevation: 5, From 7d42910b92f4b0aa9ba967c1a70199cac8644a98 Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Wed, 27 Nov 2019 15:28:56 +0530 Subject: [PATCH 212/302] fix for unwanted white space on VideoReplies screen --- src/components/VideoReplies/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index 488d0257..91ce5e2c 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -8,7 +8,7 @@ import { Animated ,TouchableWithoutFeedback } from 'react-native'; -import {getBottomSpace, ifIphoneX} from 'react-native-iphone-x-helper'; +import {getBottomSpace, ifIphoneX, isIphoneX} from 'react-native-iphone-x-helper'; import pepoIcon from "../../assets/pepo-tx-icon.png"; import inlineStyles from './styles'; @@ -32,7 +32,7 @@ const { width, height } = Dimensions.get('window'); const landScape = width > height; const topPadding = getInset('top', landScape); const bottomPadding = getInset('bottom', landScape); -const bottomReplyViewHeight = 89; +const bottomReplyViewHeight = isIphoneX() ? 89 : 54; const listBottomPadding = height - (height/1.5)+bottomReplyViewHeight ; const bottomSpace = getBottomSpace([true]); From fb6ea78e0f246678ad3158b35ccd5feb69a8e2b8 Mon Sep 17 00:00:00 2001 From: rachinkapoor Date: Wed, 27 Nov 2019 16:05:12 +0530 Subject: [PATCH 213/302] panel close flicker fix. --- src/components/VideoReplies/index.js | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index 91ce5e2c..acb76b81 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -94,19 +94,23 @@ class VideoRepliesScreen extends PureComponent { }); }; - hideVideoUploader = () => { + hideVideoUploader = ( otherStates, callback ) => { + otherStates = otherStates || {}; this.setState({ + ...otherStates, videoUploaderVisible: false - }); + }, callback); }; onAnimatedValueChange = ({ value }) => { clearTimeout(this.panelAnimateTimeOut); this.panelAnimateTimeOut = setTimeout(()=> { if( value < 10){ - this.state.addRepliesVisible = false; - this.hideVideoUploader(); - this.props.navigation.goBack(); + this.hideVideoUploader({ + addRepliesVisible: false + },() => { + this.props.navigation.goBack(); + }); } } , 10) }; @@ -137,6 +141,14 @@ class VideoRepliesScreen extends PureComponent { this.dataLoaded = true; } + getWrapViewStyles = () => { + let wrapStyles = {}; + if ( !this.state.addRepliesVisible ) { + wrapStyles.display = "none"; + } + return wrapStyles; + }; + render(){ return ( @@ -181,7 +193,7 @@ class VideoRepliesScreen extends PureComponent { snappingPoints={[0, this.initialHeight, height]}> {dragHandler => ( - + From 246f319b6e48dcf21484e88c7e8f2dd6a7181b9f Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Wed, 27 Nov 2019 16:13:43 +0530 Subject: [PATCH 214/302] Minor fix --- src/components/BottomStatus/Base.js | 6 +++++- .../CommonComponents/VideoThumbnail/ReplyThumbnail.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/BottomStatus/Base.js b/src/components/BottomStatus/Base.js index 4ed930d7..3beffa4d 100644 --- a/src/components/BottomStatus/Base.js +++ b/src/components/BottomStatus/Base.js @@ -90,7 +90,11 @@ class BottomStatus extends PureComponent { } if( tapEntity.kind === 'users'){ - this.props.navigation.push('UsersProfileScreen', { userId: tapEntity.id }); + if (tapEntity.id == CurrentUser.getUserId()) { + this.props.navigation.navigate('ProfileScreen'); + }else{ + this.props.navigation.push('UsersProfileScreen', { userId: tapEntity.id }); + } return; } }; diff --git a/src/components/CommonComponents/VideoThumbnail/ReplyThumbnail.js b/src/components/CommonComponents/VideoThumbnail/ReplyThumbnail.js index 2942f719..a0b85fa5 100644 --- a/src/components/CommonComponents/VideoThumbnail/ReplyThumbnail.js +++ b/src/components/CommonComponents/VideoThumbnail/ReplyThumbnail.js @@ -21,7 +21,7 @@ class ReplyThumbnail extends PureComponent { videoId = reduxGetters.getReplyEntityId( replyId ), userName = reduxGetters.getUserName(userId), imageUrl = reduxGetters.getVideoImgUrl(videoId, null, AppConfig.userVideos.userScreenCoverImageWidth) , - videoDesc = reduxGetters.getVideoDescription(reduxGetters.getReplyDescriptionId(videoId)) , + videoDesc = reduxGetters.getVideoDescription(reduxGetters.getReplyDescriptionId(replyId)) , replyBtAmount = this.getReplyStats(replyId) ; return ; From a240935fd3544a8ea1ff8fd583ecee0639e1018e Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Wed, 27 Nov 2019 16:15:46 +0530 Subject: [PATCH 215/302] Minor fix --- src/components/FullScreenReplyCollection/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index 837a6656..76b53931 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -27,7 +27,7 @@ class FullScreenReplyCollection extends PureComponent{ super(props); this.setVideoPagination(); this.paginationEvent = this.getVideoPagination().event; - this.currentIndex = this.props.navigation.getParam("currentIndex"); + this.currentIndex = this.props.navigation.getParam("currentIndex") || 0; this.parentClickHandler = this.props.navigation.getParam("parentClickHandler"); this.isScrolled = false ; this.willFocusSubscription = null ; From 38020a2e4b66530ef8e9b2e8ca6929b021e4d7e9 Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Wed, 27 Nov 2019 17:10:04 +0530 Subject: [PATCH 216/302] mentions page restricting bounce --- src/components/FanVideoDetails/index.js | 3 ++- src/components/FanVideoReplyDetails/index.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/FanVideoDetails/index.js b/src/components/FanVideoDetails/index.js index 788438a2..3811efa9 100644 --- a/src/components/FanVideoDetails/index.js +++ b/src/components/FanVideoDetails/index.js @@ -298,7 +298,8 @@ class FanVideoDetails extends Component { contentContainerStyle={[styles.container, this.state.viewStyle]} keyboardShouldPersistTaps={'handled'} enableOnAndroid - eyboardOpeningTime={0} + bounces={false} + keyboardOpeningTime={0} > diff --git a/src/components/FanVideoReplyDetails/index.js b/src/components/FanVideoReplyDetails/index.js index 11441582..50f1dcc3 100644 --- a/src/components/FanVideoReplyDetails/index.js +++ b/src/components/FanVideoReplyDetails/index.js @@ -308,7 +308,8 @@ class FanVideoReplyDetails extends Component { contentContainerStyle={[styles.container, this.state.viewStyle]} keyboardShouldPersistTaps={'handled'} enableOnAndroid - eyboardOpeningTime={0} + bounces={false} + keyboardOpeningTime={0} > From 1b2f412a526bbd9ce78e03d18e70bdcd210add67 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Wed, 27 Nov 2019 17:41:15 +0530 Subject: [PATCH 217/302] fixes --- RootNavigationContainer.js | 17 +++++++++++++---- .../CommonComponents/TagsInput/index.js | 6 ++++-- src/components/FanVideoReplyDetails/index.js | 5 +++++ src/constants/AppConfig.js | 3 ++- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/RootNavigationContainer.js b/RootNavigationContainer.js index d41df3d1..4ea3576d 100644 --- a/RootNavigationContainer.js +++ b/RootNavigationContainer.js @@ -121,7 +121,8 @@ const CaptureVideoStack = createStackNavigator( CaptureVideo: CaptureVideo, FanVideoDetails: FanVideoDetails, FanVideoReplyDetails: FanVideoReplyDetails, - WalletSettingScreen: WalletSettingScreen + WalletSettingScreen: WalletSettingScreen, + WalletDetails: WalletDetails }, { headerLayoutPreset: 'center' @@ -148,6 +149,8 @@ const FullScreenReplyStack = createStackNavigator( VideoPlayer: VideoPlayer, VideoReplyPlayer: VideoReplyPlayer, VideoTags: VideoTags, + WalletSettingScreen: WalletSettingScreen, + WalletDetails: WalletDetails }, { headerLayoutPreset: 'center' @@ -165,7 +168,9 @@ const HomePushStack = createStackNavigator( VideoPlayer: VideoPlayer, VideoReplyPlayer: VideoReplyPlayer, VideoTags: VideoTags, - FullScreenVideoCollection: FullScreenVideoCollection + FullScreenVideoCollection: FullScreenVideoCollection, + WalletSettingScreen: WalletSettingScreen, + WalletDetails: WalletDetails }, { initialRouteName: 'HomeScreen', @@ -203,7 +208,9 @@ const NotificationPushStack = createStackNavigator( SupportingListScreen: SupportingListScreen, SupportersListScreen: SupportersListScreen, VideoTags: VideoTags, - FullScreenVideoCollection: FullScreenVideoCollection + FullScreenVideoCollection: FullScreenVideoCollection, + WalletSettingScreen: WalletSettingScreen, + WalletDetails: WalletDetails, }, { headerLayoutPreset: 'center' @@ -275,7 +282,9 @@ const SearchPushStack = createStackNavigator( VideoPlayer: VideoPlayer, VideoReplyPlayer: VideoReplyPlayer, VideoTags: VideoTags, - FullScreenVideoCollection: FullScreenVideoCollection + FullScreenVideoCollection: FullScreenVideoCollection, + WalletSettingScreen: WalletSettingScreen, + WalletDetails: WalletDetails, }, { headerLayoutPreset: 'center' diff --git a/src/components/CommonComponents/TagsInput/index.js b/src/components/CommonComponents/TagsInput/index.js index 2a6fee74..8aa968c2 100644 --- a/src/components/CommonComponents/TagsInput/index.js +++ b/src/components/CommonComponents/TagsInput/index.js @@ -5,6 +5,7 @@ import { FlatList, TouchableOpacity, TouchableWithoutFeedback } from 'react-nati import PepoApi from '../../../services/PepoApi'; import CustomTextInput from './CustomTextInput'; import deepGet from 'lodash/get'; +import unescape from 'lodash/unescape'; import DataContract from "../../../constants/DataContract"; import inlineStyles from "./styles"; import ProfilePicture from "../../ProfilePicture"; @@ -163,7 +164,8 @@ class TagsInput extends PureComponent { const HashRow = this.props.hashResultRowComponent || HashResultRowComponent ; return ( this.onHashSuggestionTap(item)} style={{paddingLeft: 8}}> - + {/* Hashtags do not include special character like '&' today, but unescaped if they start supporting*/} + ); }; @@ -172,7 +174,7 @@ class TagsInput extends PureComponent { const MentionRow = this.props.mentionResultRowComponent || MentionResultRowComponent ; return ( this.onMentionSuggestionTap(item)} style={{paddingLeft: 8}}> - + ); }; diff --git a/src/components/FanVideoReplyDetails/index.js b/src/components/FanVideoReplyDetails/index.js index 50f1dcc3..43b7df5f 100644 --- a/src/components/FanVideoReplyDetails/index.js +++ b/src/components/FanVideoReplyDetails/index.js @@ -32,6 +32,7 @@ import pricer from "../../services/Pricer"; import {ensureDeivceAndSession, ON_USER_CANCLLED_ERROR_MSG} from "../../helpers/TransactionHelper"; import Toast from "../../theme/components/NotificationToast"; import { WORKFLOW_CANCELLED_MSG } from '../../services/OstSdkErrors'; +import AppConfig from '../../constants/AppConfig'; //TODO setParams dont use @@ -239,6 +240,10 @@ class FanVideoReplyDetails extends Component { break; } } + const status = deepGet(err , "code") || ""; + if(status.toLowerCase() == AppConfig.beKnownErrorCodeMaps.validateUploadError){ + this.setState({error: err.msg}); + } }; diff --git a/src/constants/AppConfig.js b/src/constants/AppConfig.js index 4e8fb093..ede3146f 100644 --- a/src/constants/AppConfig.js +++ b/src/constants/AppConfig.js @@ -38,7 +38,8 @@ export default { logoutTimeOut : 2000, beKnownErrorCodeMaps : { - entityDeleted: "not_found" + entityDeleted: "not_found", + validateUploadError: "precondition_failed" }, userStatusMap: { From 1b0940e0637d772091a9c70cbff299da15ac0c58 Mon Sep 17 00:00:00 2001 From: sachinchauhan Date: Tue, 26 Nov 2019 20:45:34 +0530 Subject: [PATCH 218/302] Bug fix:iOS/Android - Balance re-fetch issue USD value not appearing while set the pepo amount on video. And USD not appearing for Custom pepo send as well --- src/reducers/index.js | 24 ++++++++++++++++++------ src/services/PriceOracle.js | 16 +++++++++++++--- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/src/reducers/index.js b/src/reducers/index.js index 8157b1e4..afd44e36 100644 --- a/src/reducers/index.js +++ b/src/reducers/index.js @@ -129,14 +129,14 @@ export const reducer = handleActions( { [showModal]: (state, action) => ({ ...state, modal: action.payload.modal }), [showModalCover]: (state, action) => ({ ...state, modal_cover: action.payload.modal_cover }), - + [showLoginPopover]: (state, action) => ({ ...state, login_popover: action.payload.login_popover }), [showConnectingLoginPopover]: (state, action) => ({ ...state, login_popover: action.payload.login_popover }), [hideLoginPopover]: (state, action) => ({ ...state, login_popover: action.payload.login_popover }), [hideModal]: (state, action) => ({ ...state, modal: action.payload.modal }), [hideModalCover]: (state, action) => ({ ...state, modal_cover: action.payload.modal_cover }), - + [showToast]: (state, action) => ({ ...state, toast: action.payload.toast }), [hideToast]: (state, action) => ({ ...state, toast: action.payload.toast }), [upsertUserEntities]: (state, action) => ({ @@ -247,10 +247,22 @@ export const reducer = handleActions( ...state, balance: action.payload.isPurchase }), - [updatePricePoints]: (state, action) => ({ - ...state, - price_points: action.payload.price_points - }), + [updatePricePoints]: (state, action) => { + //Make sure price_points is not null; + if (!action.payload.price_points) { + return {...state}; + } + + // Make sure response has keys; + if ( !Object.keys(action.payload.price_points).length ) { + return {...state}; + } + + return { + ...state, + price_points: action.payload.price_points + }; + }, [updateToken]: (state, action) => ({ ...state, token: action.payload.token diff --git a/src/services/PriceOracle.js b/src/services/PriceOracle.js index d2e4e25e..42a8f210 100644 --- a/src/services/PriceOracle.js +++ b/src/services/PriceOracle.js @@ -5,11 +5,21 @@ const btPrecession = 2; export default class PriceOracle { constructor(token, pricePoints) { - if (!token || !token.conversion_factor || !pricePoints) { - return null; + if ( !token ) { + //Assign token to an empty object so that fallback values apply. + token = {}; } - this.conversionFactor = token.conversion_factor; + if ( !pricePoints ) { + //Assign pricePoints to an empty object so that fallback values apply. + pricePoints = {}; + } + + ///NOTE: If you are wondering why fall back is 1, Ask Ashutosh. + this.conversionFactor = token.conversion_factor || 1; + + ///NOTE: If you are wondering why fall back is 18, Ask Ashutosh. this.decimals = token.decimal || 18; + this.usdPricePoint = pricePoints['USD']; } From 3baf2895cae153a60c623b80ca914b1d0f65d31d Mon Sep 17 00:00:00 2001 From: sachinchauhan Date: Wed, 27 Nov 2019 18:00:14 +0530 Subject: [PATCH 219/302] Bug fix:Sound is from another video. On Reply thread if user changed the video then user hear only first video's sound --- src/components/FullScreenReplyCollection/index.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index 76b53931..98848339 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -77,8 +77,8 @@ class FullScreenReplyCollection extends PureComponent{ this.isActiveScreen = false ; }); - //If there is no getPassedFetchServices passed that means its a fresh view. - //So load data + //If there is no getPassedFetchServices passed that means its a fresh view. + //So load data if(!this.getPassedFetchServices()){ this.refresh(); } @@ -145,7 +145,7 @@ class FullScreenReplyCollection extends PureComponent{ if(entityHelper.isVideoReplyEntity( item )){ if(entityHelper.isReplyVideoTypeEntity(item)){ return this._renderVideoReplyRow( item, index ); - } + } } }; @@ -193,8 +193,10 @@ class FullScreenReplyCollection extends PureComponent{ } setActiveIndex( index ) { - index = index || this.currentIndex; - this.setState({ activeIndex: index }); + if( typeof index === "number"){ + this.currentIndex = index; + } + this.setState({ activeIndex: this.currentIndex }); } onMomentumScrollEndCallback = () => { From f907f08e5e15e3b21ebcfcb05bff0b5aeac7db51 Mon Sep 17 00:00:00 2001 From: Aniket Date: Wed, 27 Nov 2019 18:16:58 +0530 Subject: [PATCH 220/302] spearator line fix --- .../ReplyThumbnailItem.js | 55 +++++++++++++------ .../InvertedReplyThumbnailList/index.js | 8 ++- 2 files changed, 46 insertions(+), 17 deletions(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js index 904493fa..178e2345 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import { connect } from 'react-redux'; import deepGet from 'lodash/get'; +import {View} from 'react-native'; import ProfilePicture from "../../ProfilePicture"; import reduxGetters from '../../../services/ReduxGetters'; @@ -23,11 +24,29 @@ class ReplyThumbnailItem extends Component { this.userId = reduxGetters.getReplyEntity(this.replyDetailId).creator_user_id; } + _renderTopMiniSeperator() { + //NOTE: Deliberately treating cellIndex as falsey. + if (!this.props.cellIndex) { + return null; + } + + return + } + _renderBottomMiniSeperator() { + if (this.props.cellIndex == this.props.totalCells - 1) { + return null; + } + return + } render() { - return { this.props.onClickHandler();})} - style={[ this.isActiveOrUnseen() && inlineStyle.wrapperStyle, !this.props.seen && inlineStyle.unseen, this.props.isActive && inlineStyle.active]}> + return + {this._renderTopMiniSeperator()} + { this.props.onClickHandler();})} + style={[inlineStyle.wrapperStyle, !this.props.seen && inlineStyle.unseen, this.props.isActive && inlineStyle.active]}> - + + {this._renderBottomMiniSeperator()} + } isActiveOrUnseen = () => { @@ -49,25 +68,29 @@ const inlineStyle= { width: AppConfig.thumbnailListConstants.iconWidth , height:AppConfig.thumbnailListConstants.iconHeight , borderRadius: (AppConfig.thumbnailListConstants.iconWidth)/ 2, - padding: 4 - }, - active: { - shadowColor: '#fff', - shadowOffset: { width: 0, height: 0 }, + padding: 4, + shadowColor: 'transparent', + shadowOffset: { width: 0, height: 2 }, shadowOpacity: 1, shadowRadius: 4, elevation: 5, - overflow: 'hidden' + overflow: 'hidden', + }, + active: { + shadowColor: '#fff', }, unseen: { - shadowColor: '#ff5566', - shadowOffset: { width: 0, height: 0 }, - shadowOpacity: 1, - shadowRadius: 4, - elevation: 5, - overflow: 'hidden' + shadowColor: 'red', + }, + miniSeparator: { + position: 'absolute', + left: '50%', + width: 1, + marginLeft: -0.5, + backgroundColor: 'white', + height: 4 } -} +}; //make this component available to the app export default connect(mapStateToProps)(ReplyThumbnailItem); diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index 6a8128f8..3a5cd9ca 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -210,7 +210,13 @@ class InvertedReplyList extends PureComponent { _renderItem = ({item, index}) => { return - {this.onItemClick(index, item)}} isActive={this.isActiveEntity( index , item)} /> + {this.onItemClick(index, item)}} + isActive={this.isActiveEntity( index , item)} + cellIndex={index} + totalCells={this.state.list.length} + /> ; }; From 3f710770a5af24c98e178d7ba5c3b431067923f3 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Wed, 27 Nov 2019 18:24:52 +0530 Subject: [PATCH 221/302] minor fix --- src/components/BottomStatus/Base.js | 7 ++++--- src/services/ReduxGetters.js | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/BottomStatus/Base.js b/src/components/BottomStatus/Base.js index 3beffa4d..e5a8ed7a 100644 --- a/src/components/BottomStatus/Base.js +++ b/src/components/BottomStatus/Base.js @@ -117,9 +117,10 @@ class BottomStatus extends PureComponent { this.navigateToUserProfile())} pointerEvents={'auto'}> - - {`@${this.props.userName}`} - + {!!this.props.userName && + + {`@${this.props.userName}`} + } {this.props.description ? ( Date: Wed, 27 Nov 2019 18:40:15 +0530 Subject: [PATCH 222/302] scroll position fix. --- .../CommonComponents/InvertedReplyThumbnailList/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index 3a5cd9ca..4e127fb1 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -105,7 +105,7 @@ class InvertedReplyList extends PureComponent { this.initPagination(); } if(this.props.currentIndex != prevProps.currentIndex){ - this.listRef && this.listRef.scrollToIndex({index : this.props.currentIndex, viewOffset: 100, viewPosition: 0}); + this.listRef && this.listRef.scrollToIndex({index : this.props.currentIndex, viewOffset: 100, viewPosition: 0.5}); } } @@ -279,7 +279,7 @@ class InvertedReplyList extends PureComponent { initialScrollIndex={this.props.currentIndex} getItemLayout={this.getItemLayout} onScrollToIndexFailed={this.onScrollToIndexFailed} - /> + /> } } From 70936bc095500c65d8c26f56817b7f9dda0ceccc Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Wed, 27 Nov 2019 19:45:58 +0530 Subject: [PATCH 223/302] fix amount on fan video --- src/components/FanVideoDetails/index.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/FanVideoDetails/index.js b/src/components/FanVideoDetails/index.js index 3811efa9..4fd72816 100644 --- a/src/components/FanVideoDetails/index.js +++ b/src/components/FanVideoDetails/index.js @@ -88,7 +88,12 @@ class FanVideoDetails extends Component { super(props); this.videoDesc = this.props.recordedVideo.video_desc; this.videoLink = this.props.recordedVideo.video_link; - this.replyAmount = pricer.getToDecimal(this.props.recordedVideo.reply_amount || DEFAUT_BT_VALUE); + if (this.props.recordedVideo.reply_amount){ + this.replyAmount = this.props.recordedVideo.reply_amount; + } else { + this.replyAmount = pricer.getToDecimal(DEFAUT_BT_VALUE); + } + this.priceOracle = pricer.getPriceOracle(); this.numberFormatter = new NumberFormatter(); this.max = props.balance; @@ -216,7 +221,9 @@ class FanVideoDetails extends Component { } else { return reject(res.err); } - }) + }).catch((err)=>{ + return reject(err); + }) }); }; From 62ea1e1d1834d5db4ff43c38c8cd29aa69157465 Mon Sep 17 00:00:00 2001 From: sachinchauhan Date: Wed, 27 Nov 2019 20:26:14 +0530 Subject: [PATCH 224/302] Package-lock.json update --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 105c9edf..3a9fbedd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2946,9 +2946,9 @@ } }, "@ostdotcom/ost-wallet-sdk-react-native": { - "version": "2.3.9", - "resolved": "https://registry.npmjs.org/@ostdotcom/ost-wallet-sdk-react-native/-/ost-wallet-sdk-react-native-2.3.9.tgz", - "integrity": "sha512-Vmny29NomNBY20u7Q09FGx6B7QFbomGXpi0gFEpN6e82MxNFv+Gew3PdBiSoD/pOLfD54cTMv2FCA5heVS+MpA==" + "version": "2.3.10", + "resolved": "https://registry.npmjs.org/@ostdotcom/ost-wallet-sdk-react-native/-/ost-wallet-sdk-react-native-2.3.10.tgz", + "integrity": "sha512-SthTSY/CiJoA6/wSsGdzcP/9quk+XYxJ39DOvkIWQvaVx7jkNF+lL26GzVXNT1sbrkBuNCWTal+pwXnHYIF8Fg==" }, "@protobufjs/aspromise": { "version": "1.1.2", From eedf4dea988bb30d8a8cb3bab32a1c800a167293 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Wed, 27 Nov 2019 20:39:10 +0530 Subject: [PATCH 225/302] changes --- RootNavigationContainer.js | 85 ++++++++++++------------------ src/components/Search/styles.js | 1 + src/helpers/NavigationAnimation.js | 26 +++++++++ 3 files changed, 60 insertions(+), 52 deletions(-) diff --git a/RootNavigationContainer.js b/RootNavigationContainer.js index 4ea3576d..51299c1b 100644 --- a/RootNavigationContainer.js +++ b/RootNavigationContainer.js @@ -96,25 +96,22 @@ const txModalConfig = { cardStyle: { backgroundColor: 'rgba(0,0,0,0)' }, gesturesEnabled: false, transitionConfig: (transitionProps, prevTransitionProps) => { - const scenes = transitionProps["scenes"]; - const prevScene = scenes[scenes.length - 2]; - const nextScene = scenes[scenes.length - 1]; - // if(Platform.OS == "ios"){ - // if (prevScene - // && prevScene.route.routeName === 'VideoReplies' - // && nextScene.route.routeName === 'FullScreenReplyCollection') { - // return NavigationAnimation.zoomIn(); - // } - // else if (prevScene - // && prevScene.route.routeName === 'FullScreenReplyCollection' - // && nextScene.route.routeName === 'VideoReplies') { - // return NavigationAnimation.zoomOut(); - // } - // } return NavigationAnimation.defaultTransition(); } }; +const cardStackConfig = { + transparentCard: true, + cardStyle: { backgroundColor: 'rgba(0,0,0,0)' }, + transitionConfig: ( transitionProps, prevTransitionProps ) => { + const scenes = transitionProps["scenes"]; + const nextScene = scenes[scenes.length - 1]; + if (nextScene.route.routeName === 'VideoReplies') { + return NavigationAnimation.fromBottom(); + } + } +} + const CaptureVideoStack = createStackNavigator( { @@ -138,26 +135,6 @@ const InAppBrowserStack = createStackNavigator( } ); -const FullScreenReplyStack = createStackNavigator( - { - FullScreenReplyCollection: FullScreenReplyCollection, - FullScreenVideoCollection: FullScreenVideoCollection, - UsersProfileScreen: UsersProfileScreen, - UserVideoHistory: UserVideoHistory, - SupportingListScreen: SupportingListScreen, - SupportersListScreen: SupportersListScreen, - VideoPlayer: VideoPlayer, - VideoReplyPlayer: VideoReplyPlayer, - VideoTags: VideoTags, - WalletSettingScreen: WalletSettingScreen, - WalletDetails: WalletDetails - }, - { - headerLayoutPreset: 'center' - } -); - - const HomePushStack = createStackNavigator( { HomeScreen: HomeScreen, @@ -168,13 +145,16 @@ const HomePushStack = createStackNavigator( VideoPlayer: VideoPlayer, VideoReplyPlayer: VideoReplyPlayer, VideoTags: VideoTags, - FullScreenVideoCollection: FullScreenVideoCollection, WalletSettingScreen: WalletSettingScreen, - WalletDetails: WalletDetails + WalletDetails: WalletDetails, + FullScreenVideoCollection: FullScreenVideoCollection, + VideoReplies:VideoReplies , + FullScreenReplyCollection: FullScreenReplyCollection }, { initialRouteName: 'HomeScreen', - headerLayoutPreset: 'center' + headerLayoutPreset: 'center' , + ...cardStackConfig } ); @@ -188,8 +168,6 @@ const HomeStack = createStackNavigator( InviteCodeScreen: InviteCodeScreen, AuthDeviceDrawer: AuthDeviceDrawer, AddEmailScreen: AddEmailScreen, - VideoReplies:VideoReplies , - FullScreenReplyCollection: FullScreenReplyStack, CouchMarks: CouchMarks }, { @@ -208,12 +186,15 @@ const NotificationPushStack = createStackNavigator( SupportingListScreen: SupportingListScreen, SupportersListScreen: SupportersListScreen, VideoTags: VideoTags, - FullScreenVideoCollection: FullScreenVideoCollection, WalletSettingScreen: WalletSettingScreen, WalletDetails: WalletDetails, + FullScreenVideoCollection: FullScreenVideoCollection, + VideoReplies:VideoReplies , + FullScreenReplyCollection: FullScreenReplyCollection }, { - headerLayoutPreset: 'center' + headerLayoutPreset: 'center', + ...cardStackConfig } ); @@ -224,8 +205,6 @@ const NotificationStack = createStackNavigator( AuthDeviceDrawer: AuthDeviceDrawer, SayThanksScreen: SayThanksScreen, CaptureVideo: CaptureVideoStack, - VideoReplies:VideoReplies , - FullScreenReplyCollection: FullScreenReplyStack, InAppBrowserStack: InAppBrowserStack }, { ...modalStackConfig, ...txModalConfig } @@ -248,10 +227,13 @@ const ProfilePushStack = createStackNavigator( WalletSettingScreen: WalletSettingScreen, WalletDetails: WalletDetails, VideoTags: VideoTags, - FullScreenVideoCollection: FullScreenVideoCollection + FullScreenVideoCollection: FullScreenVideoCollection, + VideoReplies:VideoReplies , + FullScreenReplyCollection: FullScreenReplyCollection }, { - headerLayoutPreset: 'center' + headerLayoutPreset: 'center', + ...cardStackConfig } ); @@ -265,8 +247,6 @@ const ProfileStack = createStackNavigator( CaptureVideo: CaptureVideoStack, InAppBrowserStack: InAppBrowserStack, StoreProductsScreen: StoreProductsScreen, - VideoReplies: VideoReplies, - FullScreenReplyCollection: FullScreenReplyStack, RedemptiomScreen: RedemptiomScreen }, { ...modalStackConfig, ...txModalConfig } @@ -282,12 +262,15 @@ const SearchPushStack = createStackNavigator( VideoPlayer: VideoPlayer, VideoReplyPlayer: VideoReplyPlayer, VideoTags: VideoTags, - FullScreenVideoCollection: FullScreenVideoCollection, WalletSettingScreen: WalletSettingScreen, WalletDetails: WalletDetails, + FullScreenVideoCollection: FullScreenVideoCollection, + VideoReplies:VideoReplies , + FullScreenReplyCollection: FullScreenReplyCollection, }, { - headerLayoutPreset: 'center' + headerLayoutPreset: 'center', + ...cardStackConfig } ); @@ -297,8 +280,6 @@ const SearchStack = createStackNavigator( CaptureVideo: CaptureVideoStack, InAppBrowserStack: InAppBrowserStack, TransactionScreen: TransactionScreen, - VideoReplies: VideoReplies, - FullScreenReplyCollection: FullScreenReplyStack, AuthDeviceDrawer: AuthDeviceDrawer }, { diff --git a/src/components/Search/styles.js b/src/components/Search/styles.js index 8b3670ee..27f3c949 100644 --- a/src/components/Search/styles.js +++ b/src/components/Search/styles.js @@ -5,6 +5,7 @@ import { Platform } from 'react-native'; let stylesMap = { container: { paddingBottom: 0, + backgroundColor: Colors.white, paddingTop: Platform.OS === 'ios' ? 30 : 20, flex: 1 }, diff --git a/src/helpers/NavigationAnimation.js b/src/helpers/NavigationAnimation.js index 6bf04a41..0e9b2e13 100644 --- a/src/helpers/NavigationAnimation.js +++ b/src/helpers/NavigationAnimation.js @@ -47,6 +47,32 @@ export default { }, } }, + fromBottom : (duration = 300) => { + return { + transitionSpec: { + duration, + easing: Easing.out(Easing.poly(4)), + timing: Animated.timing, + useNativeDriver: true, + }, + screenInterpolator: ({ layout, position, scene }) => { + const { index } = scene; + const { initHeight } = layout; + + const translateY = position.interpolate({ + inputRange: [index - 1, index, index + 1], + outputRange: [initHeight, 0, 0], + }); + + const opacity = position.interpolate({ + inputRange: [index - 1, index - 0.99, index], + outputRange: [0, 1, 1], + }); + + return { opacity, transform: [{ translateY }] }; + }, + }; + }, defaultTransition: ( duration=300 ) => { return { transitionSpec: { From 0cef874a255651233da4c834cb1f61e264aeddb3 Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Wed, 27 Nov 2019 20:39:41 +0530 Subject: [PATCH 226/302] text changes --- src/components/CaptureVideo/index.js | 13 +++++++++---- src/components/VideoRecorder/index.js | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/components/CaptureVideo/index.js b/src/components/CaptureVideo/index.js index 05aea73b..8cb832cb 100644 --- a/src/components/CaptureVideo/index.js +++ b/src/components/CaptureVideo/index.js @@ -7,10 +7,10 @@ import {upsertRecordedVideo} from "../../actions"; import utilities from '../../services/Utilities'; import CurrentUser from '../../models/CurrentUser'; import AppConfig from '../../constants/AppConfig'; - +import deepGet from 'lodash/get'; import FanVideoDetails from '../FanVideoDetails'; import KeepAwake from 'react-native-keep-awake'; - +import reduxGetters from "../../services/ReduxGetters"; class CaptureVideo extends Component { @@ -69,7 +69,7 @@ class CaptureVideo extends Component { isVideoTypeReply = () => { return this.videoType === AppConfig.videoTypes.reply; - } + }; goToRecordScreen() { this.setState({ @@ -130,6 +130,11 @@ class CaptureVideo extends Component { return replyOptions; } + getName(){ + return reduxGetters.getUserName(deepGet (reduxGetters.getRecordedVideo(),'reply_obj.replyReceiverUserId')); + } + + modalRequestClose = () => { if (this.state.recordingScreen) { this.props.navigation.goBack(); @@ -140,7 +145,7 @@ class CaptureVideo extends Component { getActionSheetText = (videoObject) => { if (videoObject.video_type ===AppConfig.videoTypes.reply ){ - return 'get language from UX'; + return 'You were replying to ' + this.getName(); } else if (videoObject.video_type === AppConfig.videoTypes.post ) { return 'You have already recorded video'; } diff --git a/src/components/VideoRecorder/index.js b/src/components/VideoRecorder/index.js index e5db3ab0..5c245398 100644 --- a/src/components/VideoRecorder/index.js +++ b/src/components/VideoRecorder/index.js @@ -196,7 +196,7 @@ class VideoRecorder extends Component { - Be the first one to reply to @{this.getUserName()}’s video. Once you post the reply, you will pay {this.getPepoAmount()} Pepo Coins + You are replying to @{this.getUserName()}’s video. Once you post the reply, you will pay {this.getPepoAmount()} Pepo Coins Date: Wed, 27 Nov 2019 20:50:28 +0530 Subject: [PATCH 227/302] fixes for # and @ issues on android --- .../TagsInput/CustomTextInput.js | 34 ++++++++++++++++--- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/src/components/CommonComponents/TagsInput/CustomTextInput.js b/src/components/CommonComponents/TagsInput/CustomTextInput.js index 1234830e..bcfdc9f7 100644 --- a/src/components/CommonComponents/TagsInput/CustomTextInput.js +++ b/src/components/CommonComponents/TagsInput/CustomTextInput.js @@ -1,14 +1,17 @@ import React, { PureComponent } from 'react'; -import { View, Text, TextInput } from 'react-native'; +import { View, Text, TextInput, Platform } from 'react-native'; import Theme from '../../../theme/styles'; const MAX_LENGTH = 500; +const IS_ANDROID = Platform.OS === 'android'; class CustomTextInput extends PureComponent { constructor(props) { super(props); this.textInputRef = null; + this.textVal = ""; + this.needsOnChangeText = false; } setTextInputRef = (textInputRef) => { @@ -23,19 +26,40 @@ class CustomTextInput extends PureComponent { this.textInputRef.setNativeProps({ "text": text }); + this.textVal = text; } }; + onChangeText = (text) => { + this.textVal = text; + if ( IS_ANDROID ) { + this.needsOnChangeText = true; + } else { + // Only for iOS + this.triggerOnTextChange(text); + } + } + + onSelectionChange = (...args) => { + this.props.locationGetter(...args); + if ( this.needsOnChangeText ) { + this.triggerOnTextChange(this.textVal); + } + } + + triggerOnTextChange = (text) => { + this.props.onChangeText(text); + this.needsOnChangeText = false; + } + render() { return ( { - this.props.onChangeText(value); - }} + onSelectionChange={this.onSelectionChange} + onChangeText={this.onChangeText} multiline={true} autoFocus={this.props.autoFocus} placeholder={this.props.placeholderText} From 2883af045ffee49e30dfcd7c0422ebc35ce90f62 Mon Sep 17 00:00:00 2001 From: Akshay Raje Date: Wed, 27 Nov 2019 21:15:45 +0530 Subject: [PATCH 228/302] Fan video decimal fix --- src/components/FanVideoDetails/index.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/components/FanVideoDetails/index.js b/src/components/FanVideoDetails/index.js index 4fd72816..75a80e70 100644 --- a/src/components/FanVideoDetails/index.js +++ b/src/components/FanVideoDetails/index.js @@ -88,11 +88,7 @@ class FanVideoDetails extends Component { super(props); this.videoDesc = this.props.recordedVideo.video_desc; this.videoLink = this.props.recordedVideo.video_link; - if (this.props.recordedVideo.reply_amount){ - this.replyAmount = this.props.recordedVideo.reply_amount; - } else { - this.replyAmount = pricer.getToDecimal(DEFAUT_BT_VALUE); - } + this.replyAmount = this.props.recordedVideo.reply_amount ? this.props.recordedVideo.reply_amount : pricer.getToDecimal(DEFAUT_BT_VALUE); this.priceOracle = pricer.getPriceOracle(); this.numberFormatter = new NumberFormatter(); @@ -283,7 +279,7 @@ class FanVideoDetails extends Component { let formattedUsdVal = this.weiToUSD( pricer.getToDecimal(value) ); //Done for the value to be accessible in static navigationOptions this.props.navigation.setParams({ - replyAmount: value + replyAmount: this.replyAmount }); this.setState({ usdVal : formattedUsdVal, From 0a8c35bede69a3dcea49f18ef941c057a5559bde Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Wed, 27 Nov 2019 21:41:58 +0530 Subject: [PATCH 229/302] fixes for UX review --- src/assets/reply-with-pepo.png | Bin 0 -> 918 bytes .../CommonComponents/BottomReplyBar/styles.js | 2 +- .../FanVideoReplyDetails/TouchableButton.js | 6 +++--- .../FullScreenReplyCollection/styles.js | 2 +- .../FullScreenVideoCollection/styles.js | 2 +- src/components/Home/styles.js | 2 +- src/components/PepoTransactionButton/styles.js | 2 +- src/components/UserVideoHistory/styles.js | 2 +- src/helpers/NotchHelper.js | 4 ++++ src/theme/styles/Colors.js | 3 ++- src/theme/styles/Common.js | 2 +- 11 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 src/assets/reply-with-pepo.png diff --git a/src/assets/reply-with-pepo.png b/src/assets/reply-with-pepo.png new file mode 100644 index 0000000000000000000000000000000000000000..b65c104c944c79c6bd813e49ddc101074aa4bc20 GIT binary patch literal 918 zcmV;H18Mw;P)2XVh%5TlGQBC=-rafaZXYZtx~jXn z>Pv5BW@k3|jVx%Ke5Z6CeTzOshl3z^%~)1~1_Qgm9x!WvWOj~?|vUI};iC1_F%*VeH$i?Pp!*Rx2U;sNTSaI_{0~ar2 z3R>D@%u8U}VGD4F6s(w|^z~=&fPq~GoLsjT38j(&vAqHYc0EiZ=vGwAIL=L(@B$dn z4d{7z{v_T`+&J;9BW*HFQ?jS&1<(8*k@*<9>4-58dnNz zI0fvW-dGP{T`#Krj=&?pKC(A>(ZdQ#9{JCpZ7x`etHlXRzkQVC5k$T(==T!O0j>C+ zBy(U29*Y2)IK;P>sQQQe2d;WVDFZU^VQv!JVJbe7hio(S^<+xU`Rx?2#fxXUdBVRf z>0!CFXvt|Ofo<>qnjlBnEdu=BT1|2rEvDe3l6=ipK0Cj)9M6>kQ`VL)%a7ykBv`)C zXqnPZYMWE(x0@J$Pm;v!8?bT}@K-0vRdx>vH(5o*9YgIW*0MQdf%tY*0JV%%+>~^Y z3b%EY(7w+2&l_-84dPnRH{m`#bi3kH&rzWjozs;M`ej5Z_s?RwnBdlHWWo#st*i zA8>YM0uv_*MZ3{SO%lN#A|~-oCk~%8mg4ez!%_4xYG1CHDvI>#4Yb3Vqz02wFI%gq sEiX6ZC#vP>G%62@6MPf<#aK7_0|3WYI@^pXNdN!<07*qoM6N<$f<3>PXaE2J literal 0 HcmV?d00001 diff --git a/src/components/CommonComponents/BottomReplyBar/styles.js b/src/components/CommonComponents/BottomReplyBar/styles.js index 14bdc3c8..23c7caca 100644 --- a/src/components/CommonComponents/BottomReplyBar/styles.js +++ b/src/components/CommonComponents/BottomReplyBar/styles.js @@ -6,7 +6,7 @@ let stylesMap = { wrapper : { flex: 1, height: CUSTOM_TAB_Height, - backgroundColor: Colors.gray, + backgroundColor: Colors.darkShadeOfGray, paddingHorizontal: 10, justifyContent: 'center', borderTopWidth: 0.5, diff --git a/src/components/FanVideoReplyDetails/TouchableButton.js b/src/components/FanVideoReplyDetails/TouchableButton.js index 28624a23..2460e629 100644 --- a/src/components/FanVideoReplyDetails/TouchableButton.js +++ b/src/components/FanVideoReplyDetails/TouchableButton.js @@ -1,11 +1,11 @@ import React from 'react'; import { Image, Text, TouchableOpacity } from 'react-native'; import Theme from '../../theme/styles'; -import source from '../../assets/heart.png' +import source from '../../assets/reply-with-pepo.png' const TouchableButton = ({ TouchableStyles, TextStyles, textBeforeImage, textAfterImage, onPress, imgDimension, buttonText, disabled = false }) => ( @@ -13,7 +13,7 @@ const TouchableButton = ({ TouchableStyles, TextStyles, textBeforeImage, textAft {buttonText}: {textBeforeImage} - + {textAfterImage} } diff --git a/src/components/FullScreenReplyCollection/styles.js b/src/components/FullScreenReplyCollection/styles.js index d5a597ea..555f80e3 100644 --- a/src/components/FullScreenReplyCollection/styles.js +++ b/src/components/FullScreenReplyCollection/styles.js @@ -44,7 +44,7 @@ let stylesMap = { color: Colors.white, alignSelf: 'center', marginTop: 3, - marginBottom: 15 + marginBottom: 5 }, txElem: { marginBottom: 20 diff --git a/src/components/FullScreenVideoCollection/styles.js b/src/components/FullScreenVideoCollection/styles.js index c8cf05fb..23f8a34f 100644 --- a/src/components/FullScreenVideoCollection/styles.js +++ b/src/components/FullScreenVideoCollection/styles.js @@ -48,7 +48,7 @@ let stylesMap = { color: Colors.white, alignSelf: 'center', marginTop: 3, - marginBottom: 15 + marginBottom: 5 }, txElem: { marginBottom: 20 diff --git a/src/components/Home/styles.js b/src/components/Home/styles.js index 242352f5..bdabc21f 100644 --- a/src/components/Home/styles.js +++ b/src/components/Home/styles.js @@ -47,7 +47,7 @@ let stylesMap = { fontSize: 18, color: Colors.white, alignSelf: 'center', - marginBottom: 8, + marginBottom: 5, textShadowColor: 'rgba(0, 0, 0, 0.65)', textShadowOffset: {width: 1, height: 1}, textShadowRadius: 1, diff --git a/src/components/PepoTransactionButton/styles.js b/src/components/PepoTransactionButton/styles.js index 9c8173c2..b9f7185b 100644 --- a/src/components/PepoTransactionButton/styles.js +++ b/src/components/PepoTransactionButton/styles.js @@ -6,7 +6,7 @@ let stylesMap = { fontSize: 18, color: Colors.white, alignSelf: 'center', - marginBottom: 8, + marginBottom: 5, textShadowColor: 'rgba(0, 0, 0, 0.65)', textShadowOffset: {width: 1, height: 1}, textShadowRadius: 1, diff --git a/src/components/UserVideoHistory/styles.js b/src/components/UserVideoHistory/styles.js index 6996a0ea..8ceb8980 100644 --- a/src/components/UserVideoHistory/styles.js +++ b/src/components/UserVideoHistory/styles.js @@ -48,7 +48,7 @@ let stylesMap = { color: Colors.white, alignSelf: 'center', marginTop: 3, - marginBottom: 15 + marginBottom: 5 }, txElem: { marginBottom: 20 diff --git a/src/helpers/NotchHelper.js b/src/helpers/NotchHelper.js index ad4ec027..918cebcb 100644 --- a/src/helpers/NotchHelper.js +++ b/src/helpers/NotchHelper.js @@ -127,6 +127,10 @@ let devicesWithNotch = [ "brand": "HONOR", "model": "COR-AL00" }, + { + "brand": "HONOR", + "model": "JSN-L42" + }, { "brand": "OnePlus", "model": "ONEPLUS A6010" diff --git a/src/theme/styles/Colors.js b/src/theme/styles/Colors.js index b687d8e2..ffc788ce 100644 --- a/src/theme/styles/Colors.js +++ b/src/theme/styles/Colors.js @@ -27,5 +27,6 @@ export default { snow: '#FBFBFB', green: '#0F9D58', nobel: '#979797', - gray:"#333333" + gray:"#333333", + darkShadeOfGray: '#111111' }; diff --git a/src/theme/styles/Common.js b/src/theme/styles/Common.js index 67bff46d..7e0ab5db 100644 --- a/src/theme/styles/Common.js +++ b/src/theme/styles/Common.js @@ -21,7 +21,7 @@ const styles = { backgroundColor: 'rgba(0,0,0,0.5)' }, fullScreenVideoSafeAreaContainer: { - flex:1, backgroundColor: Colors.gray, + flex:1, backgroundColor: Colors.darkShadeOfGray, }, fullScreen: { width: width, From 9949778b9e8be582495d9e4b8748f5a039963342 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Wed, 27 Nov 2019 21:51:04 +0530 Subject: [PATCH 230/302] fixes --- src/assets/UnicornSmall.png | Bin 14286 -> 4745 bytes src/assets/top-up-icon.png | Bin 4022 -> 2501 bytes src/components/VideoReplies/index.js | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/assets/UnicornSmall.png b/src/assets/UnicornSmall.png index bf146545b0e7179aa6623c19bb1f3ccefaa48cb2..831194a5201f3f4f42d8a7314a6a5e491184deb4 100644 GIT binary patch literal 4745 zcmV;45_av0P)41vrfQ#FPj@N&Q)qjYOSYZ6WQ~beG>9kI)g*4=iuj+V)XjqbNksPuT^*4%P7P5;7E z|Bajf=kV6__0{wA*!1<=_4d>A^!-z0+V%F{_V@2iUDWdQ_)%giDLeX7WA#vB@=jmS z^7E#OPP?Mz(l`ugel`u<#O|5#|``1scJ^nKjn$no;S@A2~Z`Rh_*_wx4tg_CjF z-tWoH@B91O+u#4p*5UW~{^RVc-{k5|UH`aMcREna^7Dz^;{Ms<@6XeMy~Y1=f5~in z|7CUgS7z|__QCG(mEq;O!pQ%ux$Jp`qgHC?R%LrXQ<6VY^6l=S=IQU{>FwO%an9BM zlAwe;P@!N?{r>*5>+P@U?0DDQ+11(A$Ibq}$@9X<|FpmVpR3`Ur2m$q?U0(`j+y^^ zir969;%s{KUvK}LZ2qWMLqt=*?eN9q=-c7tzTDyV*xk0#*Y3K&$G5-Qw7aacx{$EA z?yt7Mr?8o#to@Ol_=%U~f{p!ph)_{r|9xNDO<(_tUH_O{mQGu|Mp~#sR^z2o+MH3v z@A1yx=d|46%Gup~#LM`pvF@g>(3+&|mY=ATpTUcl?t_x)e~rI+hVO5EXlZthU~;To zZ{A#M|8-&iu3gMYU5Q9rwR~3Ss#3*>P}Aw_n&9Ql*4dxc*{QF#t(>Qxou;;vo{5f_ z)WiN zo`hIRJLJ}~u$hg9ZCdc+)xo-xeROhbYEji#DU1LB4(3TjK~#9!%+%Xb+b|HuacH4k zpJV4(l9^B#n3ls0SHNTJi-`BXfn$grQC6`f>Z8T*gc&;x9zDt0+bP*N!rL#rj!z}v7ip- z@0~HNfQWco>7duLmSTOgmUMZ zGm}eLVOVb|LCMLL@X>CrIc?BkyP(_&j)-eaD_Z@f7W9j9(v-8C>$=L+Tb`x$;(9$R z@2-eT+AeGisOh{~-YyjGEL+^JKD`!}UIDXuO6l7ZR6C#MmnjO>v-zXe64p6v5Gg^o z&f@P{;a=tId16jWuYg%YNloa(G{YWM)BDY|G_1GPmeQmIO_n3<-Dst!rC~j-;-mn@ zzZ4HDeQvQdEVFt@_2IYBq^$7Z(z0j|%+JcDY|^GiuhIrUvU*B2bn*wiyO{tOFV#sEH6w^V=prNUrkbIICY+J5}v5`#7^I<1FE^*z-X zxY77vYp3)z#o$#B`nbp{KLJ^KS7C%y1Hi0(sO+KuUKBHH<|H*j+@2R1Yh}GhNp_SA)Ap&7ag@oXM#33SzB8Z?8m8c2MB*+ls zoS>|X)4~`R#`}8dy=~9EeSIeQTd`^K<2&bkw-D(pn-##JqD5Uc6Q-TaY~*UIiWk+r z4*mmK8Lm`UK)$GR;J=W=+ZC(Yhf0rs+L`nLVX4gu*p5Ft9j2Mm<{_|1%VsO!K$VZ* zJr5k=`1SQZKho@_KW4dIsl+N9|9o&n-HJ=#h{vsZs}H7_Pgj6m7E+ak`j6uu-xNL% zsZ&3s>qkoYNM_R&K(VG0YA!gU_}I>H?`24pM?Jc(KL*ZXc3JXRC85p&XFO1pK)A0M zQsQS%Ub(J62Zk45mgKT*L(TAjGj1tLMY#7jSX{9gz>~Z@qB;bO%{~B6hD#i)U8pm_ z8H0+VYzv0(czpox{cj-&AItMBn!PO2f&w7SK-(%-O$;>?oNs_TQnzU`{I(C_!Z2MIMsIaU1_jdZKJeJbBo zF|i_5S*UKOp^htr4Z&dVVO70HR9}LSw2)zZikLo$M!KDug2zo#k{^~h)Yag$sg%e9 z1cOcL1ThtFKyi&>OsPI)k*ewzh_XO@Sc3WUPR(-ORD^BA!C{aspMLvW3dso_ zFstrrjBli=EH+jI0_RDnmTN=(L~U(tS2vw~$00LD^%0Ad7HTYWB^$t3mCxV)i%QJ_ z(=;12PW8AFVFOXUGeSgv^K4tfm;b!VZwme{FiwNJ&EG zNiBx4V+v(=e&9Co+^fY?cETid7?jRPq!cgiv$d=PkSe-=oB4N`7N28P`W43RFC`jg zZy)){MQR!j(QYrkO( z#+Z6R!V_>LBuI6qlF05#VXQ{zFf(O^ikT@>#aHD{Pj>!jS4$MkjxQqD zOQkAf3rI;vcO_NLmY;uPRP_cIs8mFZXqX?!RC-sq0)$sJSN7X>8V91PhZ0&9a}%rH zS5ct~nT763raB*l>Vj8P@f(e{eWRxYSj-f&olZz@qrkW-Glh~ro#2au%s=6-T8VNn;oIN@Iw>JpDXV5eBHqa^s(Q-gRN`G-^y_+I;r`Ry zwJ2WoU23YHlvU9SFxjfVF(_4Bb&*Cn&cs$cEF=)syX-00i|@(@cBDn#0IZ51EA&rr zU2ip}Xg4{%T7=I`m6#H)fB#U}Ao=R@3g5r{xpJ;Lr0e>#sA`AF*%OX`t-cmA9^zOj z1GP;}U9Yb~a@^=;6|1`bR(BpDQba)*z6j=k7!INb1A+&0z?^fYhh6CInVoUealjF0 zj2KW1pa`Oz_~gfX%7`7XdvJKDrm-@S+fP|Ck<;hCf#xB@2K@f zSW&38^Nh-M4SN8fayeH0$vhNmD?)ubX>!HCNmjM;jLNk}dH_NdVRez3v$#H5bpWJS zqPC_dR&^2ZtIXDIs&ZEpzk)d%#?+s@kijR77pwGrgKz4oe{>y6-43xTD4{Fel?YYL4$xxI!_WnA5|QSX(hI-#ZjEt}8+ zX`wg;rZ+9=t>F5nZPfOaD(Xgw3ge$JwXm%8RxrK6Zj*}XO5`hns%1=LQ2|(q4R++L zqXp_+>;ZtvjGEPT6jvcx>0=A*tc}Xu&AL&96-?`f9@WCL`Z^54&RVTgxw}~_9n`s6 zMmKal;}>z!>^WJD=^RP}#1Wgv!4;rlv&vHNDhxjxf5Y%=)+{Wv7V!P}$B30Uxb*OV znhNSYe-AHChI=pt-$6WwTt;BJ#mj`rHSa1J1VVz~`Dcv;moDuUES=L&7 zfi-n(!({+{$nNF=JrvY;W%-rh&b4ggOa~c8%<#nu1@>%h3HNZAUnMJjb-~jEhA61* z|40FcSa`&BJ;_j$Nk6RSf(7DtTwdV|As7|k21HHr=rYaMYdFd3wTR;}5W)bSyC=K-J=Ud_iAc!XD63L4B+E>dvzo zC=)j!ru3MROaf{;z4GX}wLVcVp;ZfUCCodpMk%baX8FF2=f}8ZRp0~%03C=#<{ew; zi}nFRB`(@|o3*#AvtHILMNMW^P>fskWQ1wnhWiV*RdpHj4DAI}?fN1%D^IPcz~0X{ zsp2NHYA$AQt6qpmEo;8v*!@G>2@6A1Aynd0sFzuRb%;w`t;p~=Hkkt$Mv{ls`%Mun zg7_R>VS8V-r7kdcc9~mW@R}nU2UNq*liaFD#nz51@uh{^u~%#m2blgZFk`c}#nlye z)hxIwL(L_v46t~aSlU;lY+6kGAdh$zUSiYN!m(MM$Qp!DEBRJmBF?O;18NLV)7SIP zcq=APn;!AdGDZxMxAxpTWiyDpY)`+o7>W|>H@*kSNQJMa58$1>im8)R)4;xj#B4=B zVIW+f6GB~Vk3aWSUIIX(!h@+2d)Zh<74Bl&#-!^$?>-wfVt`ga=Q%M7++u@ zp4*Tv(A7cx%ELdylPVb1j9YO9z6yy7xgAN2$De-0B<1$pvTfcJuwt=hk3Y96D*V7%-2UM^}_qa7sb&IrXCw{4Ye8x(uiKq;# z&qSgk6|j{7X5}lvp-wB4iEE)!O(>{~!x}Ycg9ywzj*<3|ZCCoV;6Y_OfDzWHf!l6i zR<;$;Uu_XnvtL%RYFMMv%}gj%DX3PuLmp5c;17-htBra*lu<*ph{3GAVf5{}KyiZB zc3PE2of>rTgOXy{{^f&2Js??Y4B%D`Wz+t zze%&=W}%=)&6;#^efM1GrlvHjgmrL1E!)*=+@?#b2DNI}nOVqIu{0}&EuIFv-mDUq z>;Jbk#;huAaW#wPB3fI6ilGI!%8Fq@Mby|Fvlel?c<;91pdxF+@7gwAs;E9~V5w9- z7{OFBpWz@s8Y1=IKW<{FR6ZF~QXk?esm~jg)<>gC>Qh{$^?|d}`fOZ@eT+|4;SqlW X!bfSf;a3>E00000NkvXXu0mjfD!Gdv literal 14286 zcmV;=g=D-;n(C;$>jAPIy(1OvhXM9$dQ2IKIJ z&GW<0@7vGd=Wp{qHXoY|5||)@$WbI=g2+NSXCY~&&AXHSy*+b#@6=RvSI_i}c2`^H z?AEQD>Q>dA>gq}z5S;;QAkcxTA=ZJ)l6Fx#QiGaS!ogVPgU;CxhDJUZ%4qtdCcX~u z=pD7uJ8HSeG5w4?q?30v2k2rHLt{pDd z`SG%Pg4;vm<;uof<>RS=JTm9X@p6@q$KtoLx8=sng>9MSk%??;3phiWI8Y|C&Q`Tj zbCE}DZXTdqG>!*zEY@7uRqFwyH5kFIQpSLKmuVurib`4iA^2EjW1JrI%ROnGaa4AGP!6Rl`+}K*G;Dr-HC?wyU|r;B%De%lSX%w zb)q}b&|Wt>mB~w-4V|v}t18`9C_@In^K{eaMAy-DcwTf99?qW*?B*0s^mJ)xr;}_p z%8`yvN10qS4mZHh{M>Zu=w9(?zfOjiO@>WmygHB@zmDz|Pi4``5#3Adr!LogO)B42 zi6MiZc{%CQ(fqSTy+8vCWkF~3Y2!cj3J`jv;19u+MU9Gb6^r(!wL zh{vzk$q{rk6+ROjl|`k4XkKE!^l0kU)W?sXT`{R^uaVvI z^M)7X?m>?1!SCCS|vjn%d&*`68oVeB|o`wQy9`f_@Ps$L&j&C#^TvJs;a8Q((%)eugJ^4 zs34Fx8+@R58s*Q0$o{a1y}myjT5!|aPhWZX%P%8Rrn0kmO`|$D8Ol=TBfOW`4;@MQ z*^QcnO+S&TKApS@FXNojPBgLhw2OuhC@sCXFc6prjDylI{sEEvHWZ6KzOAuoLDdV7 zd@5NWJ4~i&R4?n$;UrUBlPbNgLOKSy!F7Bl_)K-_&>IU0TN={-B|xp46!d{O0rI}V4Dho?C#(@3Ap4nG5s+`?# z(D&d)@JG;OJ$V5-E*z+9jz#YIVE67jW-NYY2P>!SJUp#~QJm9MY05(8BfLqRiL9+( zb^@E=0mwv$PFBYAG>6elo=$;r$nlFoV}4Q`2>uv&yLc#9$6*bKrcgBYkLR~-{NHny zyjsHw#+^t9BfBY$sZNsNcoUfCXTqPt!yO@oXn@E>UMDN#dD;`acg|%eb64+523H`Ei;eC&>!pcs>(*P3|!>F65weXq!Ck8)1<+K|Hmy|ym3r77k(8{T`?`+yREJiqOEN=z>E%q#%&QOFqnVUhJu9D+88KyMFs4EG^p~siAPP?_dpzuzpSJ*+< z8PcqQ!lGdCtXoEpAJngV=^HO>+GH{`;cbE0@-&CZBo&TmzQM&GyMLE zbNWo`(en}bWlp6`I^)c10J_F+R@K(d8};&|s}kCHZ>fSg4n=sH!(^NaM>MC{lN@&_ zC#6X9!pn83k&&hSQvIM01K&x|ICfd6Wzc>4lfXR5CJ-rwOJQ^$={uTh6>_+<@ZpXFJE!RK;0} zVcfmDsrkZQ&pr4m%Yht=Vk8kvF~^Z8r#az>ri)d2l)U6LN+Ls=@-Yz$l;xb#M57oL z5NySJ&bne+_riiF0AFEg@BEkD8VHC`Z76hI<A$r&MkJ8AqR3&WWvMcRs0<11{2+i_ndS2^zQkEFs2rT zJd;j1_cZ|fOs=V1c>g1boVjxmOfj;Uz%pM#wQIz6E1BJTKyosrupv^XgX0ON*iwxz zis00bL!#5E4J$jFY!!KhckMpwQaCba1>RN!Q|x4h%p<3rWQpb~#k z#h6zBr}W~pADv@r)5_02Uo5{zVafdMXJ0-!kr!_>%ARl(Bc8*=$744-=QVFP|j(Hh7P1io84=gMmw%%k?D z7+H0&gBmS~>q=tMId&40OG2w$l5^qTb!S{S zHem;~9mU){6^_#hHsvFJWvp`SOcir^4wC_dvtt}rPwdj|Azi znY1^>fu89&*niq)UILvuWVWqsvu}u{spRAOpRWQfd`8hg6 z8pR9MwOYHNQHNhKWY~Xc8Cv~B+5QSSQ$B@g9F?hKYZWts%1FWmmYyW ziciUqE3BS#)Bm|k2+FdW%ek{7n{Nn@!mBTwYws%D=e~l>1B=00;clB6}`HNz6JSKIp8KK z0bgB!GEx(&i&vJHf9o5ta-5(NvmA3_qH!F-PBh|C#@w;fR-)9L{Fq5$xpBzgpFxI) zrV!d8qIuRd_z*|D`UVxpd+JAebQckD_;wL0D}}iBa?yPB1knHvj3v3CXIC+_xDfj2 z7~DD^1$3_erLPeO#DM~)2Wn}iEO4@Y4~G;GZxz-RB2 zFI^E}%`>Vs(wJdf0dvvwzH1FTWKFS6n?;{hYeW-!#1z1Qy4YY)E$fP>WBG@bcl{~A z{Jf-^HIBuapvvPgQss19!r?#l*nU?oa8s=)h2A=o zP!I@S`Yzmjo6wQs4-!6;tVovfux6+TnMrIbbW(CdRn=wC)X80(lRz7$Mf>&^;cS)G zk^-b<-^JdV0`}VQ1zt+}6H_le40>tyGAqDgDPX=056l;l^&1HV&K$6M>a>T|wk8I^ z_kR93>bO%F20`)FU7{ct#odLhgZ{OG#YN41Fo@TkU>Mpf7c z!wwz>CVJuk>yhC*jGV=STVFR*NZt@QmX>>IrXiA8JZgSzv1nQR9;3k478rkx*SUYsEsKI$< zmk@*>Le?M5KD3XnOUnBr+_2XE0Ztq{=Z-63oM) zD0gfpeq#sLDM`n%Rn9EqC>^kdA;I9OIs0?0{bVz zqiG97s_2ximExE#6=F&Ce(~a-eWLfObs}6)Al{yOv{*WRjMxP|Gi{bil~!Y-@RV6M zaDere1K^B2pkF+Z{4(4#b~JvHS73sFK$UUcFa zJm}<^P&l1um{Sc3ebVofc?DgxltWv~E)9+JxdL(*xv$}bbgHmaAx zK;HCR6(%VkZ0Kt*7XruDQoz+Vv16x%)hA>4(lry#GkORY_U$RgmdAI^c@Q&ZZG!Ex zcVBRp*p_&ajlvT}4%S@tiq#@o*I<*-oy(wi&%Im2lzJdA9Skw@8{6PCfz;Y?R-`gY z#!)(O$=I>@N;Ab-WtOPN9wP+wn98tkzY?uOhL0Kx-z4+qq&R-Ps9!H}T92+-Yst8C zpCiI~FrripMH<(@7$063dBEX^FRSHTsUZxGG4kzMXHuh(pXj9B=sGzI@71xLl%*JQ zTh;i9Ai&<(oWy;kL2o8z&(bTbsnydIln@;IN;gdF-bGwHppU4?(s*`fk8a|vV<*7d zS#nc0ZQ3G2JHJgbJ3d#Pgvxnhd|6K%XY)XQBgZNpj&p>QYa^AFGE1cxV7e6+Of_Kh zpJfvKp7;!ioI|K}yeX4Z>Bz7u71|hgD9on(cyNDF1v4bs2ro~aY|Xxq?iO(9W^imC zaQkU?=c;*bdbl_*&kvt)^-DL$)>~*m$%_R>8L;`!a@a^`or!aa&P;J?6c$dReR`R& zI`WjmpzPYJ{^A%|gz-Dn!-@E>ha6(54Z$!Ahafz_eTdc~496WPI2Z`##3#~qY`0&G zMTebY`bpnx)hv!Raaq|ZcyO-hp#DypJkj8NL!3LPulPi`OROAE=<9nQ1a`T^zZAsU$jWSLY!id)wCfo}#=_n!GdgSgs zjI)cv7}oDF1@>}Z-K|0t$%`x*WV8tm64WmPr)K-X55QctdkJEq&w@!ORVEnS9Ndkr z&CiQtt1=;+9E&$#l?igq-NFnmPmeu92!mUg0&rkebfLP{){RBThGV1RVc>|@^y)53 z;Q*~4VHd1=w#1^gDxB@a!vfSWHlYmwQ+xK4pX9!q>BX@f=x-I zVd#dlAw}?K5@4CyB*b7bBwJw+IQBJtdWaGqoEw+w8%jznQ{!{hdCGH^*(!?{y;WBw_OzN>Nl`S#2G$xy& zKREZLa5r8aoDk16v?PAiW%&V+RmzF_km)ukkR~1JLP3D$Q zuq0DkQxjosntlwe*i;Cg0$C1+_U<9hbDEws%)bc^Kj6z^HVz9Inqb5R>z-Nn4JXI; z)b-0H3dFL!FoR3TFcTo;rDWV=Z4d(B1hLUB(}JKUCT*TFP@NXbI9R0|pW%lTId*1Q1+whe1N*6GKWb`{rn{U95j*!RCvu!-IJ9wBp}^653~gi|kn|Lc9?mY@8)*t%xD$Tu7w;X=x67;~o^*1+Kf-1yYi z12`S_*p7~wX&JKV*uFk)u;YBLx<>qN>n^bto!4o6ye)om#iVi~7tIwhrv(f{r=-08 z_5MfVqO&g(58VBbcxN@L^NG7Psza*b$gch{5FbqvxM38sVPnwj7|V z_O;Vfl@<0o`W~!DOyY5qv2r|Tc-PLoVl(SGd$^qy1P2rQV7q2lcLzaZqsLDYjghb@ ze&F$xrS9Nf&|?@Dzwxfv2iru0u&jT9y9`{tZ(X~M(6xOjuZ zlbiqXh^X4K&9>_R0>1c$ll|Gqz#8I3V==RNHwWv!ffL#9N>>^j?-s^S94m$nt8!yArk@EjB&+M2gnS>Mu>!`J2eU~7q=N^HoKp}U zA{lpjZU$$g$F}kWU&+XL?5%gPQ`Nj6J8%qb5;kr!;etnXDjV*>Zh`}|HGloR^4L|X z1hNH1SC>m`RB}2TUbsHDZx3JQ#l|gLA@XbLtZ&Ka^2;4Qpzg7JG$4D99nI`<^L9<^ z0aUrXD@+r^SpDRoSl%?oi8+Gd10}}3k*-Nu zn-yscM^=`=##^_5cQ)TO?;Pj#*PL9K{8u>0PSI-^;2MnA7%#7gv3B3JC z6(afWHmc+f6s{{Af5ZDqj)Rx$_x9C_Z{RWJrb_WvRj1d9 zT$L#l6RWbFSJoVRU46~!?u9*E?SJN^5~@j-Ubd7OwId{c3cLQ_ZWJ*e4hj2N z?B-bXUq0w_^-DL$_F_XyW{>SzgN~hYwrWikd}Y8P>~o>3MBjDV;G?+Oprtt8Td#us z%FXQdB$e*=ii-^BmvHW^@9Q_NqRmZpi#5#TKNNE|6^_$WV6Tp?%0R~1>FeKnuMsAm zQa<#uZqR@fLpY*=&1rMI6a3XTt3{pe$}skQbJT&0GR-B0mbzD9zx962W-F)s+6yfL zvnBPnV9(tqoO{dY7ye1BZ{#Nw`&y-59h+zFW{^b>#UhKj5W;I=n$Iaj;oM&SkU>r? zDYOVU=hrFN1S0W$Ln5~n!@gv2?iz6TU2rmIt;q@|3Ae*I0vBsq&h2*cD9dFF#bR$m z7H)n+R+#b;e^Q)@V<#!nC2B$;EQ}rMubL-n3>HP|Cr_|tOo8RP70blcU#KVETgNxt ze*)V$F?_t=^R^aCu08#WJNFGDb^x8bDH2KYg>2TJiDPH<%lXrawI4zOtUahrmws0? zo;by*JP|mD7=)EIFJbK$--wWEi)U%;XEvJ33I*;>!9u;6IQF$4dhVJIJRG4qj2tpR z)c@*7@Y#{nMI7SEX1um;|6)l$`Ia0@Y)MJtO+v~E6UUZiREi0g65qb^{ZK^27B`>& z9npO13;~;?WPQqX3{I>x&p1{|(;*vSZ^T;FZAxYFhO}lua2Nt%8w@`}OcCz8I2b|% zJ`ae_o$Ed3(CW*_zxLFYL>-$sL7dqOuib>{IJPYefKjFm-@kNo(^;oja$YW03eB1Z z-&XOqh_X&~_!jQQ!_D=LtQIr>uGP&;S}$ORmMnS zN!jLu{oRcLST0IzPsQ(&4cUSQbN_Rhpt zo{)zjWRe_n)kGtloF+VvEgtkU6J{=mFqh$Q65lIJmK+Tmp^r{NLZZLv}q8#D=r?J$K zjuzi=>A#_4*2tT1RJ`;pDO3i@tl1FJ)9-}bF z4+|$*vpf`wF1&8(VjAD+GE(7XoSb&F*^6V#ig-pGw)qBk@BT5I%UW(D5+j$JA3;c&{^^h2U0@R_>+jG>z*jT0>sk4RGa7R*&=686E;d+_Gp3vttL zgm`O-5Q^=vndr~CEMB(^E3Vmc>@AIrw|giP_ZtqQ3OVhnmK@uaF-?ZpOE0|?YiMi) zZ%7XCVJk7MTk8~DGBq_7J*0msQh_Oh@njVKn!&Moz`5(MU}%v^n6qFZJUXC`@uJGR z9unfJp9*ouJwkl=nGp4v>CVKiv}NHibhZM_w!B*P!Xuw1^pj)CakjD-@lDD8tH%P^ z^J`aMaKXYypM7>YOt~G#vziRO>wDF;qS|1eMidSwn1q3c!$geY@vED=HqnVZ=kBW! z#b2#RX2)HD?|%~iLkb?Az^O^Nj#%JO3x`FxF9Sc&giHN6&53__!KKH2Fv%JFl=@fP z?*d7;a{8ltcXQ)y2AasxIjfA5)0|fer{ma|k?phq^E8JkQ|z@xePiQ)mX($+ASA}v zYo82LQIGH3&CyCYhE9SG>vDp9$WddJ@=kNtN&$xK0xOnB!QIjna3vbYuFcSUCrzW_ zor0$K3ZfF+oP~~$Wy3E8;}Z7C?o(k~iVf9vN%yX~ChgCqtZ?5|m z0wT1ouI?uW`aD#Yfi{VSJGMk}OrlY|Hh7xDq$IX%*|I=mef_Pa<>gNk5@S>{6MF6W z+rQ;#B^)a&g_}yi5j0`Q(MKvNpJcG#dL+Ey4tU~uTQAtQAa|K9m9o-Mv~!zVxltQ-oQEgC)q?g8&cCb`FW9mOk)Z9aT* z`W4`NLH{%2#RW8GLtnrk$8l`@KhZcJ(K(H9Msd21ZKNES&@j8&`giO0;@;-wMR1Sw znOwnGxRdTJ=$UW{*eS$dTxu&*FpiydLJAfQcyn+1vmxg_{StU8JX|5*b&e$tJL2$* zxajD7`5yDfjywkASnAMQad9GCz-C=jhF7uSiTOAk|7!vsb;B1w{_=-I7<6!WYKcP! z3jy0xtznI<0%iXUFT9Bv9lU#l|4?OiFKMuN%RQUc|CfP`L*Wdh4OnEy#tfZ&hpUu% zd78r{W8pThUw`A^VZ)|FE5pFDHQ?%)Yp?Bagljm=S@#r!jX;Do%poQF-D8 z3vor@wO;QkZS`}2c+C>bdjDjG_(%aA9fvsh)4~`oY*Rl8a4Peo&*Oh+ECzVOSue7< zcLs-X_|3|d>x6*o&?pp=9fZgru5Jna?1vw{L61~yZwzuA$HxB?jq?$m(+H=FQ+Q>^ z)(K{U$4u?&J95;htvhOKZz(P={vWP%4D{OFVcbZ295{{O09?eV3)8MRPf2<+&ADr= zm=oEz8L?-}_2o18aDdlks6DE_c#IW_L!H)P4|-2Z+s3CL*Q^&}4Jt_uSf)b73{onm zI|hbfuk?8K{$~@M3S(>?PBfb-Q^2aX43x-5^0W%JaD6K(?uI*(7x8?t$&O{KhMY!l zps|s_q64-Bj`p>UxRl=a0Z_=orO;nilis#^{Yk9$S%`e3vlduZfC$HxO71rYlXVtc|Z*BI=#=2>yS z;4tSgg_ZIu$2L_+e6nIWE%RCQnUg11L%0N{|7>rqfX1lOEL;RvZy-H(9E8T1`@5fu zuKZwuO@$YK4;!ACn7H)wuSFnn-~juyVn1q$XOIIJT^3(v@e2slvsXZUVbAX8oqlk$ z(;YpZe&EGKk#ud3WG7le+=@*3xJ(M1ttR8fahMFSa6@|a`k<+?@diR-e28Y(U!RRz zIGY8ZdehaSYQhmIctoT-cU=XIKj6t1Y@J0=L%uz*ZLJ*xfJXfA`mf&ocSUKa&E*(b z2`9q}HLfVGD~Va>*jj-k>DGiPKj*XHJ{1-Bg+rk`NmVaA?IMLSfD5zP2_(CRoB|N6Vu#vs&-k8OO6cLqfb1OnAx?Avq6eJfYe6PManjupaM6v=8CObOX+ zHEyI1w(R`b_1FI#UM8)_8DG7_g@f<(>L!ML@TsUzTsm0>^R?&y;bw9CW#8475i?6? z?s^<}a(8s>L@4fbYN`q;4up3%HC+zZDbPC-wJ*h-pW}2e@^c!OPYZT(Y_A!q_&H7m zTet@vcp&=7-FMFer+#Ng;svo6Y#jQ*pnhTuq~CvJp(unQ%B1to5I=bAPBHTMV;l>c z?%efRPti~jXB~WdxpK6%9TH=;;qZ06o_i41b(dUacQeAmjNDX<}^0eb0=o_tYsfqOxYIQaxoR0fL-2H{~? zp8wim>0PB_8r;Zw+OPj;lW;}>U%om+at$=bA~%;ldG8$zOAaQ-$fCk=JgFf*N}I%v zGN}XFWR)nKY3u5AaC~go?AgK3iwh=?-CI3j%HaM_!lUFc+|YC)jHSH8%-O?c$|RWcl>f^FRUpMKhJ z^x=oU6$l20$co+4U&3L6`EUr=OE?Wa_c85vtqY+zC5A7KouRb`pu?Cy;*-~|-mqZ< zA<4Pq80my_f@M9FHi@}@CBM@cn*>~y5F?A-WH_B*ip7)(6Si+!zkW8nP;O^Bjlh>3 zz7VETfE94u!wYRvTlp5EZBQEk(5bIl_2G36PR*^f+Yyi)<~#(u(TR`8MlvRj&6Q>X z%Lef@!4wPFQ?h>j#*HU|b8j-ubU*A^+tU&@Ww-dwfQ6WXP4PK$oUba2EKK^Y0A7>mtelQi=97EB#mHqyiZm5d4}>#}(!ju^3a^@~aQ^#Erw=SCgwKGPll+ZvQX2yH z)qIRD!nKj`H6>5o^OpnyBWf#(IgYWVfSjL*Djd;#iM=>>y2hyFIL;NGHFfIl zC2zboGZG5XIl7d>Z-+w)-UcDqTR&s#!QQ&_eG#eyRup$PH=SF#@V@zW<+wYwYa1$b zF_aO=^KcdL;@Gar92ne;;&df^=9y>KJo)g$r$xdMS{O*m&g;JG)8Mko{KVxqoxOFu zDq&CeM_<kR|NQgeXmit(laD`P zU|xRSkz_j#L-3YVFX6KJ3q@XH=z_c7+WNLsFJ()I7tbo*xcr05uKHjx><_jAcS5gl zIwm;D@cfLrzANP+34-k`FPT`;-$G`k0*<)?aKUkd_j&r^C`My1q z4V)U=f!cz@SdWCKI+fEZ9^!S2Rl3|{EP5tw>bI<{&na!wR&Luisdvww3*o>*Pb%?h z_}cCh@YxOg8kii0!>Z!dzx+KkN4(As(pAPS)h#W*=>F^jtt(T>4$2)$2V>Q8nkucs zA>Jg&`b}gko=ke|v@?aARkAY9DQ(k6_V54U# z+Q)E`JK@y0C*GTr84Phv=!#L8@^t# zWBBcN^@bihhzDBn>|aL@Fphq6PpIX#KF>V(j#O6eJUSRfOle#_m*IF*I8%B1er(eW zReYHmp_7;KJdLoNwruNDQTB(Lnwm2p(RwQkBnH4uQ~UPp|K3~G`)1Weq6-THL9gpM zmi~6~F9tpI3!57nPRM`aAE!%B&FhZCSTwm#m-vxvwOM}ig!e& zx^(g~-YEU$s#OCA3>x%UUVi@3Sd?%my!QL!PdS;2_3Oa{ibhqG-Bgg5cLDU^m4t8C zaX>VMBGG3zw>17~=%V>wNoA28hNn4POkJ0Cxv#hDtVlb7+B<~UVa zj2$sz%m2OYw&`$C*gEaeP`&Tvyg)F9f01CUY3!?yZYX@}o*QplyY`TpQ0Nlq;a-Lj zO?&Lcv3Gv2E*iT2=`9-uLzym@oLW^sa{ZA*xbY$%mnAtTJm+zOb$Xp-v^2T*(=vJ> zWU5mqufoeXWqNCM_3VASs<;1s?v>jjEh2wM)4qL+H++us-%0%M&79kNT$hUTON03r z0%4qoGUuEXykJdpG_qh-ea(U+Uw&ev!T{M({7&;MW!;=+0%t0pl1Ea*rcl#I_@P&) zLxq=d%JkufA1;Q5yB2-fyfp+{G3ClklKFV%x&230R8A|-%byO*?bCsHNcz>`gJeML z3`b+{z*f@5n;L5tAO6x4aJytmkjsP&GR|vSrGqk-brIf6?1zq&{E`|og_=IXFTFZF zD!d6!=8@A>;uQSKGv`(H&o7x?loy-=C)h^K6}x>9OUSJXDThf-~X4ELD6?c#WA#v`)8@*$XnI0lf&j@cO0ONso$Vf-~Wv;;DEo z8V+5Cmz9ht%_|rI3qd2{mf?Z0zsoK=Ll9NYs?fm+x>R|n}@xD>u# z1Y)%bcza7UvbrG>UA4KXe$}}vKiV<#t2(K5lI?J9XEyw~#T^n2B#<-bc7Qyki$;`M49@#|uzJajUi@qRRhX{LVW<)lkT zQ{h!OERPOPWp$$ypC7TCBk1TVyb6al>hNwfujO;f$Ez+!{#-T?8scYuZn|`IuXrzZ z>vTIdLV{@8=uUh(npZs8tCJ(Tm)K8TuK8xt5U$EK41VY7rcX!L;n8d-nh9M~^t8}! z4&g-C(R6q+(2Y)frm^4pT=R8nKvxB6GWeaZi9RQubZNTcJL!{Uyf(TUzZ2bwhIYBp zW!p{C+0f~lua^dJRpyZ)8+n`PbmMWOV=+y5JXVL6-NZ56c--iixe1TfNCm-feTppf zs9ZLX&Wdc%wr%pN-z&clRp6?^s}p(UcQrs_$hLkdJNIN;Y&5bu7q+FFN4j!U zHZO6yPLr-&E^PCXM_RnOY@l=u%%y#P=H*3~pAP7!E~oa&RX$EOIMTc{fTN-;6LW26 zuJg;J`f}}Lxy~=Gx@k`hhy^@Q_8zEw(2hKBl9W?*1o`T6kypRQXnB|5axHRcHTJXZ}=X|9y)7 zRA=i}V)#>I|5j%6QepK`WByfT?Yh5%FgKh!LjV8&|5axH=j#9C=Koo0|L*YrU2gyR z`Tv2A|F5_I`~3gw?f>cQ|5j)J&eQ*+tpCT&|GUEfaex17djHzq|6+3gm!kiTnE%z; z|7Lan;N$mns|B##id58axo2@V$B>(^b zKXg(~Qvd=63K9+!?ic>n%1d4)lJ@A|ziwDQF8cZ5zp-xK($1}@o0gP~W>+XBAjow% zF7oV^XZ|)6ud0(stBfTd+0VD|000O8Nkl-`8Ete@5fd+Hv{6EN=XGHsZA4gKD6V9QwA!sGlrd+7F)oUY7Ro6Dy%Ay& zsF!I9@^TTZHYpF~l|fz(tIH|}Wz1Y=F~2aMcIK?vS!>Qo&oAT`GdaeU!|IlLow@A& zv<1Sf^!;qktHrJ1r5uzw*DK4nZ3xW1ywyw%vKm&jP9dUGUY(Ci&h?oO6rwOF5& ziJ)@xpOL0k90--OlJX8VytVP1`1GuK0ljexLU-#%iW_Vwt5L5J-)b-D(a1P3QBKBm zo7DQWOad#vG1u-0fO4{lCk-Jnv` zx(iyeD&eh9OGK*SSJ0B3PldD^Wg=O35A>9#OTbxCYMn?o08JIEqa{$YHfr+J)(&XO z%7m~!7m<4HcCSVFPC-|NEVly~^$8Kw1GgR#bPT$(Z!oLeScPY*4Q_4W$pU@x)I}4HXO*mVRq6orRmiZTg|BN#mHHhtW>uLL8*788QppZztay`Ik+E*8Qx8FB z>6B+(eW_dO)N{~Uo*pf31$b&%o!SMh*%jXv5S=Rai~>QP=hhJPX5HjgKuF#6Jfrxy z=hg{m?g3p_bgVV*86~PcHha+BLw*H#sxcK*YfWOT#xyJdz&(kv8dGqr-0X~LB2>eO z|HF#rq_D9XM*NR}%ljZkjs3y;w_7Q(l}U}5uPdyT;ISHR@m>O14*L-BqsDZ#=F57< z%2Q+d!oqil-2`~5L5t~YAYavItc)7dmutQylxnl}5z_4h!kB6|$@QI%f= z5yd*ccR{9AHdY^MLiP0;QEvZ38}RN5H-Jf9YC`d)B?-~VM?fpA`)vTDD!vLPVQL)$ zTE#R2sR=i=7wjZlxOJJ^0G^tZ{<8(6_ID*ZKKOieIahQCZp%=UO>_r_m&aJ~*7Bo! zv9H+KvUB{h^3>$pGIFB6f+CgmX`j$ONZbPuD*e;+%!^vUp&0Bzcq;Tq)_v^r^*-AG z0X1M^19Avkuff~lsN0k@sQ^X~AZ)jAn=&krd`p8Bpsdkcwgrp`u2JssV8 zzCduZ@l*elcXmB#1W_2i6A+9gQAm2x@1||4ciz8SmMy`8fDut76r=tBf1%B?&4kQM z-)&zOchbi@ubv#wx;tmioEb$aONgq)C%{8O>K!BjcK28fle{e&&!6_6Rd+hb-T1P< z^H;!^en$6pbsa|;BT(wQe6jkugF%0>>Ypn@ix&A@Dd;26CSD;Ahr9l?w&~r%Li@CC z6r=iM2n(`c;mg3StHzhT`8gPJu}{tx9DDfb8)mv#nJn_%?( z-=A|*?oqab?F@Ja#=XDY>Wr+Rl}&bAwFSn|TP%MV2t7kBzp9-9Yu8sG^po|Ux#mfY zK^IPhh7eC!55Rcz^oC_^8E0@Jx7pYa7Ow_$2F`ZJRrc!{T!_s}?y!CUV;ZfQeuYVk zi-;7agqAR022@{w(7npEZpN8xe{~tHi92wjG}`&YdIZKSjxyrq#e9BuokXODqO>pC zs^&GY55`!iq5M@-C<|+&2F5sci4HubLaQwa>)snsW>>apG6F$pVD^OdQw0Q5jI{RR zZG^UP9@bNU(|JscXS^geX|37bAJ*y#^3WgN_a;d)=}kuq5QHNP-ms>w?FtHq9}MAP zO;=ep6b?Ub;}5Gz0a|R;;fI)bShIAkqX78PFs^E+K)VSY@xYxwtedW_3RI+Hj6AHy zwebuh^5IY(*6h(bs6j$Ma+}}v2nxzUW}@nH)#9oj59jG>azMye@z6b2-F&q68Wl+B zqYU!9wwe&o2SjjJlLPHKRP?bMM%C+@zGDw-*dlzGiQu|-TtR;H5iyc$`vkd>2k(fk z)zfl}Gcu}9*HpGFL!x}HMz%bow}@-02AbKfMz(Zg;(V^99KPppE$v9dkOoDDG=4Lr zp{5~?iVbN1Z%AW}LmCzx(g^OL2AhX8E`F;+`2C{)-_-`{g%PE@-J&elaPZ4bI3>7= z<+p8lu8eWpa^EuE8f2`0{XG5kMnPQ~71UK+VO?+**0phgUBN* zO^_f;kzPXx1OmvuIo~&P=l;C!%wBu%Sb$Yk;l6NhmFyB2NJJY_9+cX!Ix zpL<^Cc3uPm;qKkLWLwV@Th9Y)_kF0_s`&#v9zQoXSA9z_Qc59ATFHP{Fh4&Z4u@ad z^S<~`ou8kdo}Qkaol%$%4-ePY)@EjAFc?frON$n_z=fR`g`WbZ&{8lY8`uHVjq-7F zaQN`!h4tlcQ0+m!yV>&iMZE zf9i+HeTpb07tZ8v?YHNwV=cw05VYJF)Q~+ro~lJud$I0Ro-^#6zH@2I%Ui zH0t2s;J?`^9RqwK{u_ZrA{|ol6NwaS7rABU4gUbBTHu5XZ10|Bmt3r@0YhWQpPElz z6_FnX0H3>n_^fm1AmBkD!4~#sW1G0R1kC=r`1=cRM7r1~oULz?ey;$vO-Gq;ju2^p zTPR@f3rx-c=$_O1*5j&=q>}2RHx|JAKY%>~DE@yg9=&e>UKIl=xj+)hOP)(hen@@hV$5@LxcLG+kL&L$kGOB6qoHt>|7dsV zS8qpC63k3NR`!HM`aS(^eE4(2r<%g_06zy4Jv}v9@hkhg8_Q!Y4S6qb-&8z3AmBGv zmgoA>^&e2Bg}Ipt$j6VIwFM4|gw>XUjKrsrA$QgIJWVV>AXa`8{kwMXA76h)M%o$h z)9>Tdm}h?>Ap#Y8pcLa**TsypJ?_#`bh0W4iLLpczI> z&rsHKd^BUwZ|$;@(-ZKIC>6?3Qwg8aoR!FE8~~DPQ`Q2JB_SrXLs^OfDHp_lsM7O6Qn^Kon#d2e{oQ&4F(H?gn@RCtj)d(F0TeTl!op?spR2XUlw6D#!z4 zkxbS)UCXx@@`2G|v@bWiE1E_x z3zf=eee-u%yH}y8$}AQVPMxqJzub_}@1LKis?`c985SO@enP7hryD?qANdkq%nCi= zdGnZjjW3aI!U>B#(I?Z^5w+bmUTZeWO7-z7iR!rMbPfBnzmTCZf{Oi$&m2mNg;QGxH+Pv{Y>n6LMC^TxS~uGyd1=sM4RE*BNjlhNIniE4|(f6#PZ%DVDR zBt7L$$LLHOR&Ye%bDPTFE=*zt>$b3JbG@Z`Ex7oneLnuuCI@m{QvS-%O22p8 zC8h9z_COoz!RVZJ@Dl9IOw$UznU~J08ua38pY}u}X!AmAM1oz#Gu(lZD%?~*zL$C= zyf^;+c;SP#O0{0;Hi%tE$Y@6)(is`K4?^|8o|Ts zrUR-|OL)b?TbFHuHr?Df&sI1bp*pflv!Tq5r*bG}{zw;yA7Bs;jfhf7medqS^`H?Y z89D`gwM934`qDKgqp}O2R(8Dmf!3I3IUU#VPQ;7NXpzRfDL%pDYQfVP`xk+)$;wk) z(?XWs*NQ)WT9E1;&?+Po*Yk68bMy1_^5h+$j*gDjgyFKJxa%HWb&*vJ*Z8=+`in@32-t_cBi0td03M-Wwi4_YSdn>!hH_rM_GSQ%J1{bil534n7lHXxo%%U@l>#;uach zKBD@kcvrrrHE*Drvm`m_&PTBytg$Cg2yw};-fe}hQ*$YPXK?wGH;pa!wm-~>Mw?t? zVuO5Nf+hwhxeOq>lMWuukJ3n&is}(@QoGV9OKF9!OD#H}^&3g-=u?`oi4{y9Io}xRoPsk z-kwdu#;u*x`vj8k2YJa)lWDx*Za88`JiCHK<$E*@P?h!k99I_>MMN7KZXmw#O>XyZ z@h@byV`B=Nzq3$bIa+7P)e4m}t<(1x8gBoVVc$>i<)y}rg5+f9ZnAXjHe+FutG)@K zRA)(eL0^B|>a)c;wIsOZShQJwt_1D=)60ymOWn$s(!YD@jFI1C`FSadQ@wvIU$ z4)~GM71TJ>T^PoOIb9BujqPkgGg-7Kh_)28++O@^%#6>@M&#(DtfWr0QAY(5E!g#F#WVu2e7^$58*1A};pzbQ8h9><)5@riM3u_~O}XS=P#5%$C3bqZS!G zFJKnAQypB5aaHHKw}!47Yc+fBV)xc1VFraHVTc4R)f*ZzYonJOEUbTsYlZs^bC2=wwv(1UPn!4(K98>>? z+am}mGt*QyOjU?%SmO?Jkels0Z@J_#H@ug(WgSxaJpGx04c8n8A`Rv!JX^{b=i0KIntJ<>0T3ae%jqiNzHi+jMP&(v%Gqvht~RPhKl5{6%$7KKC) z_Uy(bwS&Ieng=uCEKr(GDFO&QhsA zqy6pl*FbY>1~gbXhCPJl=L$IaTe{dE6-W;BCqP1nVBRJYMJ8S8kQ|X5)vd=hy=z>m zlNRmtRNTW^!stX5+So<9xB94*tzxYF+8Q9QMrg&%7a#pz!RJLbH0CZ8)U5h+V{htp9rlOh_u+mu&<|$da|m*f0{StGbk#mw)x$opZ(UOcgZ$@L8#A9HCV(@;xswXe?t{Dm^cunaC_^?&sJ5- z1?c-8kU#?Z>#OS|@j^j4H?q(2b=_2T!G~jG&xe<3JN&omS&>itMGYLM`8B5a}4 zuD>x>uejq1D(RjNgmDa}Yba>0@}6AXMZT<~=OoMQOFaZwL$0E}c6;$IeE$NEnaMDs zat4W3Qp^_JJL^>fYOBr!OPlJ=h9O~0jzv*mVzP|X+NY?HK{2U?RLcQ--f^ZZ=F1K0 z1nn3oL>R!QH+;FJ*bluU!> z)KTGw^y|v?oTtQ|IQ6WTBS2foUx}wH*}NhM%LHm^q=r4*`8m4t3w_&lQDo5Gv05k0 zycP9~m)=R8SPx``;c3Rj1=YKbj@}k^Gn7Y)Udf%`8)Ybw9*bv(yj2`ur(f?VwU>^DyU6#^(m@;@EQp>@5b0(Vr!F3kTQ6hRy$LqP zmD>^)iLQ*-vXcKI&M{QHl1A10!S~6sv|vLGZ=vW|7I*y|wf*zsyS~a|h=TBavZ=}y zp$&{#7RRHwcm;yKexgJv1Im@E4$RftiE~IXF@}jt_EtB5vjZpL=_XsnQJ#~RjbSal cea~^v8Tc2uW0&gwa{)Iou+;yg>-OS*0E6`b7ytkO diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index acb76b81..ac98dd19 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -201,7 +201,7 @@ class VideoRepliesScreen extends PureComponent { - Replies to {ReduxGetters.getUserName(this.userId)} + {ReduxGetters.getVideoReplyCount(this.videoId)} Repl{ReduxGetters.getVideoReplyCount(this.videoId) > 1 ? 'ies' : 'y'} {/*Send a reply with{' '}*/} {/**/} From d186a7fecf3c4b6a1f0cb3d616fb7c9d4ddc3381 Mon Sep 17 00:00:00 2001 From: Aniket Date: Wed, 27 Nov 2019 22:15:08 +0530 Subject: [PATCH 231/302] user icon bubble size modified --- ios/Pepo2/AppDelegate.m | 1 + src/constants/AppConfig.js | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ios/Pepo2/AppDelegate.m b/ios/Pepo2/AppDelegate.m index 0920b269..4bd3bbec 100644 --- a/ios/Pepo2/AppDelegate.m +++ b/ios/Pepo2/AppDelegate.m @@ -146,6 +146,7 @@ - (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull N restorationHandler:restorationHandler]; return handled; + } diff --git a/src/constants/AppConfig.js b/src/constants/AppConfig.js index ede3146f..ed346209 100644 --- a/src/constants/AppConfig.js +++ b/src/constants/AppConfig.js @@ -340,11 +340,11 @@ export default { thumbnailListConstants: { separatorHeight: 25, // this is height of profile icon + shadow around it. - iconHeight:44, + iconHeight:50, // this is width of profile icon + shadow around it. - iconWidth: 44, - parentIconHeight: 40, - parentIconWidth: 40 + iconWidth: 50, + parentIconHeight: 42, + parentIconWidth: 42 }, VideoScreenObject : { ...ifIphoneX( From d9885b0f3cb1ae1867a8af57745f55aae1ce50d0 Mon Sep 17 00:00:00 2001 From: Shraddha Date: Wed, 27 Nov 2019 22:29:00 +0530 Subject: [PATCH 232/302] border instead of shadow in android --- .../ReplyThumbnailItem.js | 28 +++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js index 178e2345..2013bd35 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js @@ -2,6 +2,7 @@ import React, { Component } from 'react'; import { connect } from 'react-redux'; import deepGet from 'lodash/get'; import {View} from 'react-native'; +import { Platform } from 'react-native'; import ProfilePicture from "../../ProfilePicture"; import reduxGetters from '../../../services/ReduxGetters'; @@ -58,29 +59,46 @@ class ReplyThumbnailItem extends Component { const inlineStyle= { iconStyle: { height: AppConfig.thumbnailListConstants.iconHeight - 8, width: AppConfig.thumbnailListConstants.iconWidth - 8, - borderRadius: (AppConfig.thumbnailListConstants.iconWidth - 8)/ 2 + borderRadius: (AppConfig.thumbnailListConstants.iconWidth - 8)/ 2, + ...Platform.select({ + android: { + marginLeft: -4, + marginTop: -4, + }, + }) }, borderStyle: { borderWidth: 1, borderColor: '#fff' }, wrapperStyle: { - width: AppConfig.thumbnailListConstants.iconWidth , - height:AppConfig.thumbnailListConstants.iconHeight , + width: AppConfig.thumbnailListConstants.iconWidth, + height:AppConfig.thumbnailListConstants.iconHeight, borderRadius: (AppConfig.thumbnailListConstants.iconWidth)/ 2, padding: 4, shadowColor: 'transparent', - shadowOffset: { width: 0, height: 2 }, + shadowOffset: { width: 0, height: 0 }, shadowOpacity: 1, shadowRadius: 4, - elevation: 5, overflow: 'hidden', + ...Platform.select({ + android: { + borderWidth: 2, + borderColor: 'transparent', + width: AppConfig.thumbnailListConstants.iconWidth - 4, + height:AppConfig.thumbnailListConstants.iconHeight - 4, + zIndex: 1, + borderRadius: (AppConfig.thumbnailListConstants.iconWidth - 4) / 2 + }, + }) }, active: { shadowColor: '#fff', + borderColor: '#fff', }, unseen: { shadowColor: 'red', + borderColor: 'red', }, miniSeparator: { position: 'absolute', From 2316f412faaeb11ee4ffa6875d50dfaa94b929ce Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Wed, 27 Nov 2019 22:59:53 +0530 Subject: [PATCH 233/302] Bug fixes --- src/components/CustomTab/index.js | 13 ++++++++++++- src/components/Home/HomeFeedRow.js | 4 ++-- src/services/NavigationService.js | 21 +++++++++++++++++++++ 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/src/components/CustomTab/index.js b/src/components/CustomTab/index.js index 8e5277b7..cc0fb464 100644 --- a/src/components/CustomTab/index.js +++ b/src/components/CustomTab/index.js @@ -20,6 +20,9 @@ import { LoginPopoverActions } from '../../components/LoginPopover'; import appConfig from '../../constants/AppConfig'; import reduxGetter from '../../services/ReduxGetters'; import Colors from '../../theme/styles/Colors'; +import NavigationService from '../../services/NavigationService'; + +const commonStack = ["FullScreenReplyCollection"]; const mapStateToProps = (state, ownProps) => { return { @@ -51,7 +54,15 @@ function loginInFlow(navigation, tab) { navigation.navigate(tab.rootStack); } else if (utilities.getLastChildRoutename(navigation.state) !== tab.childStack) { try { - navigation.dispatch(StackActions.popToTop()); + let popStackCount = NavigationService.getStackNumber(navigation.state.routes , tab.navigationIndex, 0 , commonStack.splice(0) ); + if(!popStackCount){ + navigation.dispatch(StackActions.popToTop()); + return; + } + popStackCount++; + for(let cnt = 0 ; cnt <= popStackCount ; cnt++){ + navigation.dispatch(StackActions.popToTop()); + } } catch { console.log('Catch error'); } diff --git a/src/components/Home/HomeFeedRow.js b/src/components/Home/HomeFeedRow.js index d3d216a3..8a16f02a 100644 --- a/src/components/Home/HomeFeedRow.js +++ b/src/components/Home/HomeFeedRow.js @@ -72,9 +72,9 @@ class HomeFeedRow extends PureComponent { - + {/* - + */} diff --git a/src/services/NavigationService.js b/src/services/NavigationService.js index 354dcc9c..fc166760 100644 --- a/src/services/NavigationService.js +++ b/src/services/NavigationService.js @@ -43,6 +43,26 @@ const findCurrentRoute = (navState) => { } } +const getStackNumber = (routes , index , num , whiteListedStacks) => { + if (typeof index !== "number" || !whiteListedStacks.length) { + return num; + } else { + const currentRoute = routes[index] || {}; + const innerRoutes = currentRoute["routes"] || [] + for(let cnt = 0 ; cnt < innerRoutes.length ; cnt++){ + const route = innerRoutes[cnt]; + const routeName = route["routeName"]; + const indexOfItem = whiteListedStacks.indexOf(routeName); + if(indexOfItem > -1){ + num ++; + whiteListedStacks.splice(indexOfItem, 1); + } + num = getStackNumber( route["routes"], route["index"], num , whiteListedStacks); + } + return num; + } +} + function reset(navigation) { if(!navigation) return; navigation.dispatch(StackActions.popToTop("Notification")); @@ -56,5 +76,6 @@ export default { getTopLevelNavigator, findCurrentRoute, getActiveTab, + getStackNumber, reset }; From 89a11b9ac88bdef258b31e1d89bacb88e88976db Mon Sep 17 00:00:00 2001 From: Akshay Raje Date: Wed, 27 Nov 2019 23:01:04 +0530 Subject: [PATCH 234/302] Fixed warnings, version bumped to 1.0.0 --- android/app/build.gradle | 2 +- ios/Pepo2.xcodeproj/project.pbxproj | 5 +++-- src/components/BottomStatus/Base.js | 2 +- .../CommonComponents/BottomReplyBar/index.js | 10 +++++----- .../CommonComponents/BottomReplyBar/styles.js | 6 +++--- src/components/CommonComponents/UserInfo/index.js | 4 ++-- .../FullScreenVideoCollection/FullScreenVideoRow.js | 9 ++++----- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 9a553b9c..c04dc204 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -127,7 +127,7 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode 19 - versionName "0.9.6" + versionName "1.0.0" missingDimensionStrategy 'react-native-camera', 'general' } splits { diff --git a/ios/Pepo2.xcodeproj/project.pbxproj b/ios/Pepo2.xcodeproj/project.pbxproj index ac12b9eb..f18b5999 100644 --- a/ios/Pepo2.xcodeproj/project.pbxproj +++ b/ios/Pepo2.xcodeproj/project.pbxproj @@ -5,6 +5,7 @@ }; objectVersion = 46; objects = { + /* Begin PBXBuildFile section */ 00029B4323329B55009E6919 /* TrustKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B76D86A2318FAAC007316D4 /* TrustKit.framework */; }; 00029B4423329B63009E6919 /* OstWalletSdk.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0050FDA022A8226800C2634F /* OstWalletSdk.framework */; }; @@ -2313,7 +2314,7 @@ "$(inherited)", "\"$(SRCROOT)/Pepo2\"", ); - MARKETING_VERSION = 0.9.7; + MARKETING_VERSION = 1.0.0; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -2376,7 +2377,7 @@ "$(inherited)", "\"$(SRCROOT)/Pepo2\"", ); - MARKETING_VERSION = 0.9.7; + MARKETING_VERSION = 1.0.0; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", diff --git a/src/components/BottomStatus/Base.js b/src/components/BottomStatus/Base.js index e5a8ed7a..9fdc77c6 100644 --- a/src/components/BottomStatus/Base.js +++ b/src/components/BottomStatus/Base.js @@ -117,7 +117,7 @@ class BottomStatus extends PureComponent { this.navigateToUserProfile())} pointerEvents={'auto'}> - {!!this.props.userName && + {!!this.props.userName && {`@${this.props.userName}`} } diff --git a/src/components/CommonComponents/BottomReplyBar/index.js b/src/components/CommonComponents/BottomReplyBar/index.js index bc932db3..402a2340 100644 --- a/src/components/CommonComponents/BottomReplyBar/index.js +++ b/src/components/CommonComponents/BottomReplyBar/index.js @@ -18,7 +18,7 @@ class BottomReplyBar extends PureComponent { if(!this.props.videoId || !this.props.userId) return; if( replyPreValidationAndMessage( this.props.videoId , this.props.userId) ) { navigateToCamera( this.props.videoId , this.props.userId , this.props.navigation ) ; - } + } } render(){ @@ -26,15 +26,15 @@ class BottomReplyBar extends PureComponent { this.replyVideo())} > - + Add a reply... - + - + ); } } -export default withNavigation( BottomReplyBar ) \ No newline at end of file +export default withNavigation( BottomReplyBar ) diff --git a/src/components/CommonComponents/BottomReplyBar/styles.js b/src/components/CommonComponents/BottomReplyBar/styles.js index 23c7caca..97d9048f 100644 --- a/src/components/CommonComponents/BottomReplyBar/styles.js +++ b/src/components/CommonComponents/BottomReplyBar/styles.js @@ -4,8 +4,8 @@ import { CUSTOM_TAB_Height } from "../../../theme/constants"; let stylesMap = { wrapper : { - flex: 1, - height: CUSTOM_TAB_Height, + flex: 1, + height: CUSTOM_TAB_Height, backgroundColor: Colors.darkShadeOfGray, paddingHorizontal: 10, justifyContent: 'center', @@ -17,7 +17,7 @@ let stylesMap = { marginLeft: 10, fontFamily: 'AvenirNext-Medium' }, - replyIcon : { + replyIconSkipFont : { height:10, width:15 } diff --git a/src/components/CommonComponents/UserInfo/index.js b/src/components/CommonComponents/UserInfo/index.js index 5e0f86f7..dd552a7e 100644 --- a/src/components/CommonComponents/UserInfo/index.js +++ b/src/components/CommonComponents/UserInfo/index.js @@ -161,7 +161,7 @@ class UserInfo extends React.PureComponent { if (this.isValidBioTag(this.props.userId, hashTag)) { let tagText = hashTag.replace("#", ""); return ( - + {prevText} + {prevText + hashTag} ) diff --git a/src/components/FullScreenVideoCollection/FullScreenVideoRow.js b/src/components/FullScreenVideoCollection/FullScreenVideoRow.js index b85e2fc5..062f5978 100644 --- a/src/components/FullScreenVideoCollection/FullScreenVideoRow.js +++ b/src/components/FullScreenVideoCollection/FullScreenVideoRow.js @@ -1,5 +1,5 @@ import React, { PureComponent } from 'react'; -import { View, TouchableOpacity, Image , Dimensions} from 'react-native'; +import { View , Dimensions} from 'react-native'; import { withNavigation } from 'react-navigation'; import FanVideo from '../VideoWrapper/FanVideo'; import ShareIcon from "../CommonComponents/ShareIcon"; @@ -20,7 +20,6 @@ import assignIn from 'lodash/assignIn'; import AppConfig from "../../constants/AppConfig"; import CommonStyle from "../../theme/styles/Common"; -import InvertedReplyList from "../CommonComponents/InvertedReplyThumbnailList"; import BubbleList from "../CommonComponents/BubbleList"; @@ -42,10 +41,10 @@ class FullScreeVideoRow extends PureComponent { }; getPixelDropData = () => { - const parentData = this.props.getPixelDropData(); + const parentData = this.props.getPixelDropData(); const pixelParams = { e_entity: 'video' , video_id : this.videoId}; return assignIn({}, pixelParams, parentData); - } + } render() { return ( @@ -110,6 +109,6 @@ FullScreeVideoRow.defaultProps = { return {}; } }; - + export default withNavigation(FullScreeVideoRow); From e5715ea52c356a44cd0b21d5cf43b5a3616d3db2 Mon Sep 17 00:00:00 2001 From: sachinchauhan Date: Wed, 27 Nov 2019 22:40:33 +0530 Subject: [PATCH 235/302] Bug fix: Video details page , adding dot(.) under price bar shows - NaN --- src/components/FanVideoDetails/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/FanVideoDetails/index.js b/src/components/FanVideoDetails/index.js index 75a80e70..8937db43 100644 --- a/src/components/FanVideoDetails/index.js +++ b/src/components/FanVideoDetails/index.js @@ -276,6 +276,8 @@ class FanVideoDetails extends Component { replyAmountChange = ( value )=>{ this.replyAmount = pricer.getToDecimal(value); + if (isNaN(this.replyAmount)) this.replyAmount = ""; + let formattedUsdVal = this.weiToUSD( pricer.getToDecimal(value) ); //Done for the value to be accessible in static navigationOptions this.props.navigation.setParams({ From b313eb4810cd43190e3d1ba13a3fe0264c0102a0 Mon Sep 17 00:00:00 2001 From: sachinchauhan Date: Wed, 27 Nov 2019 23:08:50 +0530 Subject: [PATCH 236/302] Bug fix: Should not show 'Workflow cancel' --- src/helpers/TransactionHelper.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/helpers/TransactionHelper.js b/src/helpers/TransactionHelper.js index 415ca30c..473d872d 100644 --- a/src/helpers/TransactionHelper.js +++ b/src/helpers/TransactionHelper.js @@ -106,8 +106,7 @@ const _getWorkflowDelegate = function (callback) { delegate.userCancelled = (ostWorkflowContext, ostError) => { //Do nothing. LoadingModal.hide(); - let userCancelledMsg = ostErrors.getErrorMessage(ostError); - callback(userCancelledMsg, false); + callback(ON_USER_CANCLLED_ERROR_MSG, false); }; delegate.saltFetchFailed = ( response ) => { From 73bbc89bad6dbc1aab990662dae1eefd6173e81c Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Wed, 27 Nov 2019 23:18:00 +0530 Subject: [PATCH 237/302] camera fixes --- src/components/CaptureVideo/index.js | 2 + src/helpers/cameraHelper.js | 3 +- src/services/CameraWorker.js | 87 ++++++++++++++++++++-------- src/services/TransactionExecutor.js | 10 +--- 4 files changed, 70 insertions(+), 32 deletions(-) diff --git a/src/components/CaptureVideo/index.js b/src/components/CaptureVideo/index.js index 8cb832cb..134fc670 100644 --- a/src/components/CaptureVideo/index.js +++ b/src/components/CaptureVideo/index.js @@ -57,6 +57,7 @@ class CaptureVideo extends Component { this.replyReceiverVideoId = this.props.navigation.getParam("videoId"); this.amountToSendWithReply = this.props.navigation.getParam("amount"); this.isChargeble = this.props.navigation.getParam("isChargeble"); + this.toTokenHolderAddress = this.props.navigation.getParam("toTokenHolderAddress"); } else { // Do nothing. @@ -126,6 +127,7 @@ class CaptureVideo extends Component { replyOptions['replyReceiverVideoId'] = this.replyReceiverVideoId; replyOptions['amountToSendWithReply'] = this.amountToSendWithReply; replyOptions['isChargeble'] = this.isChargeble; + replyOptions['toTokenHolderAddress'] = this.toTokenHolderAddress; } return replyOptions; } diff --git a/src/helpers/cameraHelper.js b/src/helpers/cameraHelper.js index d30128fd..8399de6e 100644 --- a/src/helpers/cameraHelper.js +++ b/src/helpers/cameraHelper.js @@ -16,7 +16,8 @@ const getVideoReplyObject = (videoId, creatorUserId) => { userId: creatorUserId, amount: ReduxGetters.getBtAmountForReply(videoId), videoReplyCount: ReduxGetters.getVideoReplyCount(videoId), - isChargeble: ReduxGetters.isVideoIsChargeable(videoId) + isChargeble: ReduxGetters.isVideoIsChargeable(videoId), + toTokenHolderAddress: ReduxGetters.getUser( creatorUserId ).ost_token_holder_address }; }; diff --git a/src/services/CameraWorker.js b/src/services/CameraWorker.js index f2860c52..7b24f315 100644 --- a/src/services/CameraWorker.js +++ b/src/services/CameraWorker.js @@ -98,10 +98,12 @@ class CameraWorker extends PureComponent { } VideoUploadStatusToProcessing = () => { - if (this.props.recorded_video.do_upload){ - Store.dispatch(videoInProcessing(true)); - videoUploaderComponent.emit('show'); - }; + if (this.isCleanUpCalled || this.props.recorded_video.do_discard || ! this.props.recorded_video.do_upload) { + console.log('VideoUploadStatusToProcessing:: return condition'); + return; + } + Store.dispatch(videoInProcessing(true)); + videoUploaderComponent.emit('show'); }; VideoUploadStatusToNotProcessing = () => { @@ -136,7 +138,7 @@ class CameraWorker extends PureComponent { if (this.props.recorded_video.do_upload) { if (!ReduxGetters.getVideoProcessingStatus()) { - console.log('-----------------------processVideo:::VideoUploadStatusToProcessing------------------------------------'); + console.log('processVideo :: VideoUploadStatusToProcessing'); this.VideoUploadStatusToProcessing(); } @@ -209,7 +211,16 @@ class CameraWorker extends PureComponent { onFlowInterrupt = (ostWorkflowContext, error) => { console.log('CameraWorker.onFlowInterrupt', ostWorkflowContext, error); - console.log('-----------------------onFlowInterrupt:::VideoUploadStatusToNotProcessing------------------------------------'); + console.log('onFlowInterrupt::VideoUploadStatusToNotProcessing'); + this.executionFailed(); + Toast.show({ + text: ostSdkErrors.getErrorMessage(ostWorkflowContext, error), + icon: 'error' + }); + }; + + + executionFailed = () => { Store.dispatch( upsertRecordedVideo({ do_upload: false, @@ -219,11 +230,7 @@ class CameraWorker extends PureComponent { this.executeTx = false; this.VideoUploadStatusToNotProcessing(); this.executingTx = false; - Toast.show({ - text: ostSdkErrors.getErrorMessage(ostWorkflowContext, error), - icon: 'error' - }); - }; + } getSdkMetaProperties = () => { @@ -251,16 +258,20 @@ class CameraWorker extends PureComponent { executeTransaction = () => { + if (this.checkIfDiscardedAndClean()){ + return; + } let goForTx = this.props.recorded_video.go_for_tx, doDiscard = this.props.recorded_video.do_discard, receiverUserId = deepGet (this.props.recorded_video, 'reply_obj.replyReceiverUserId'), - amountToSendWithReply = deepGet(this.props.recorded_video, 'reply_obj.amountToSendWithReply'); + amountToSendWithReply = deepGet(this.props.recorded_video, 'reply_obj.amountToSendWithReply'), + toTokenHolderAddress = deepGet(this.props.recorded_video,'reply_obj.toTokenHolderAddress' ); if (! goForTx || ! receiverUserId || doDiscard || this.executeTx ){ return; } this.executeTx = true; - console.log('-----------------------executeTransaction:::VideoUploadStatusToProcessing------------------------------------'); + console.log('executeTransaction::VideoUploadStatusToProcessing'); this.VideoUploadStatusToProcessing(); console.log('CameraWorker.executeTransaction'); @@ -274,16 +285,24 @@ class CameraWorker extends PureComponent { }); - - let callbacks = {onRequestAcknowledge: this.videoUploadedSuccessCallback, onFlowInterrupt: this.onFlowInterrupt}; - let config = {metaProperties: this.getSdkMetaProperties()}; - - let txExecutor = new TransactionExecutor(config, callbacks); - txExecutor.sendTransactionToSdk( amountToSendWithReply, receiverUserId, false); + let callbacks = {onRequestAcknowledge: this.videoUploadedSuccessCallback, onFlowInterrupt: this.onFlowInterrupt}; + let config = {metaProperties: this.getSdkMetaProperties()}; + let txExecutor = new TransactionExecutor(config, callbacks); + txExecutor.sendTransactionToSdk( amountToSendWithReply, toTokenHolderAddress, false); // todo : Execute transaction code. call clean up after that. }; + checkIfDiscardedAndClean = () => { + if (this.props.recorded_video.do_discard) { + console.log( + 'processVideo :: Discarding video... Cleaning up Async, Stop Compression, remove files from cache, cleanup Redux' + ); + this.cleanUp(); + return true; + } + }; + uploadReplyVideo = async () => { console.log('CameraWorker.uploadReplyVideo'); @@ -295,6 +314,10 @@ class CameraWorker extends PureComponent { postReplyVideoToPepoApi = async () => { + if (this.checkIfDiscardedAndClean()){ + return; + } + let readyForTx = deepGet(this.props.recorded_video , 'go_for_tx' ), parentVideoId = deepGet(this.props.recorded_video , 'reply_obj.replyReceiverVideoId'); @@ -380,7 +403,7 @@ class CameraWorker extends PureComponent { text: responseData.err.msg, icon: 'error' }); - console.log('-----------------------/replies:::VideoUploadStatusToNotProcessing------------------------------------'); + console.log('/replies:::VideoUploadStatusToNotProcessing'); this.VideoUploadStatusToNotProcessing(); Store.dispatch( upsertRecordedVideo({ @@ -408,7 +431,8 @@ class CameraWorker extends PureComponent { async cleanUp() { // stop ffmpge processing - console.log('-----------------------cleanUp:::VideoUploadStatusToNotProcessing------------------------------------'); + this.isCleanUpCalled = true; + console.log('cleanUp:::VideoUploadStatusToNotProcessing'); this.VideoUploadStatusToNotProcessing(); FfmpegProcesser.cancel(); // remove files from cache, @@ -419,6 +443,7 @@ class CameraWorker extends PureComponent { utilities.removeItem(this.getCurrentUserRecordedVideoKey()); // cleanup Redux Store.dispatch(clearRecordedVideo()); + this.isCleanUpCalled = false; } async removeFile(file) { @@ -484,7 +509,7 @@ class CameraWorker extends PureComponent { compression_processing: true }) ); - console.log('-----------------------compressVideo:::VideoUploadStatusToProcessing------------------------------------'); + console.log('compressVideo:::VideoUploadStatusToProcessing'); this.VideoUploadStatusToProcessing(); FfmpegProcesser.init(this.props.recorded_video.raw_video); @@ -537,6 +562,10 @@ class CameraWorker extends PureComponent { } async uploadVideo() { + if (this.checkIfDiscardedAndClean()){ + return; + } + !this.props.recorded_video.compressed_video && (await this.compressVideo()); if ( @@ -549,7 +578,7 @@ class CameraWorker extends PureComponent { video_s3_upload_processing: true }) ); - console.log('-----------------------uploadVideo:::VideoUploadStatusToProcessing------------------------------------'); + console.log('uploadVideo:::VideoUploadStatusToProcessing'); this.VideoUploadStatusToProcessing(); return this.uploadToS3(this.props.recorded_video.compressed_video, 'video') .then((s3Video) => { @@ -573,6 +602,11 @@ class CameraWorker extends PureComponent { } async uploadCoverImage() { + + if (this.checkIfDiscardedAndClean()){ + return; + } + !this.props.recorded_video.cover_image && (await this.createThumbnail()); if ( this.props.recorded_video.cover_image && @@ -613,6 +647,11 @@ class CameraWorker extends PureComponent { } async postVideoToPepoApi() { + + if (this.checkIfDiscardedAndClean()){ + return; + } + if ( this.props.recorded_video.s3_video && !this.props.recorded_video.pepo_api_posting && @@ -672,7 +711,7 @@ class CameraWorker extends PureComponent { }) ); } else { - console.log('-----------------------/fanvideo:::VideoUploadStatusToNotProcessing------------------------------------'); + console.log('/fanvideo:::VideoUploadStatusToNotProcessing'); this.VideoUploadStatusToNotProcessing(); } this.postToPepoApi = false; diff --git a/src/services/TransactionExecutor.js b/src/services/TransactionExecutor.js index 861635b8..e28b9da0 100644 --- a/src/services/TransactionExecutor.js +++ b/src/services/TransactionExecutor.js @@ -35,9 +35,9 @@ class TransactionExecutor { this.callbacks = callbacks || {}; } - sendTransactionToSdk(btInDecimal, toUserId , validateSession=true ) { + sendTransactionToSdk(btInDecimal, toTokenHolderAddress , validateSession=true ) { if(!btInDecimal) return ; - this.setToUser( toUserId ); + this.toTokenHolderAddress = toTokenHolderAddress; if( !validateSession ){ return this._executeTransaction(btInDecimal); @@ -50,10 +50,6 @@ class TransactionExecutor { }); } - setToUser( toUserId ){ - this.toUser = ReduxGetters.getUser( toUserId ) || {}; - } - _deviceUnauthorizedCallback(device){ this.callbacks.onDeviceUnauthorized && this.callbacks.onDeviceUnauthorized( device ); } @@ -73,7 +69,7 @@ class TransactionExecutor { this.workflow = new ExecuteTransactionWorkflow(this); OstWalletSdk.executeTransaction( CurrentUser.getOstUserId(), - [this.toUser.ost_token_holder_address], + [this.toTokenHolderAddress], [btInDecimal], this.config.ruleName || AppConfig.ruleTypeMap.directTransfer, this.getSdkMetaProperties(), From 0d17a25fa74450ae5534f067d45d4ba6d24cdc84 Mon Sep 17 00:00:00 2001 From: Shraddha Date: Wed, 27 Nov 2019 23:30:00 +0530 Subject: [PATCH 238/302] reply thread fix --- .../InvertedReplyThumbnailList/ReplyThumbnailItem.js | 4 ++-- .../CommonComponents/InvertedReplyThumbnailList/index.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js index 2013bd35..fff1d188 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js @@ -41,12 +41,12 @@ class ReplyThumbnailItem extends Component { } render() { return - {this._renderTopMiniSeperator()} + {/*{this._renderTopMiniSeperator()}*/} { this.props.onClickHandler();})} style={[inlineStyle.wrapperStyle, !this.props.seen && inlineStyle.unseen, this.props.isActive && inlineStyle.active]}> - {this._renderBottomMiniSeperator()} + {/*{this._renderBottomMiniSeperator()}*/} } diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index 4e127fb1..a0885e7e 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -232,7 +232,7 @@ class InvertedReplyList extends PureComponent { }; getItemSeperatorComponent = () => { - return + return }; getAvailableHeight = () => { From 78336063d8fb65249d75011170be1c2d86e12c36 Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Wed, 27 Nov 2019 23:38:42 +0530 Subject: [PATCH 239/302] fix for reply list thread on above i phone X devices --- .../CommonComponents/InvertedReplyThumbnailList/index.js | 3 ++- src/components/VideoReplies/index.js | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index a0885e7e..143c5118 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -9,6 +9,7 @@ import ReplyHelper from '../../../helpers/ReplyHelper'; import AppConfig from "../../../constants/AppConfig"; import DataContract from '../../../constants/DataContract'; import ReduxGetters from '../../../services/ReduxGetters'; +import { isIphoneX } from 'react-native-iphone-x-helper'; // const ITEM_HEIGHT = AppConfig.thumbnailListConstants.iconHeight + AppConfig.thumbnailListConstants.iconWidth; @@ -239,7 +240,7 @@ class InvertedReplyList extends PureComponent { const area = AppConfig.MaxDescriptionArea; let height = ( area / Dimensions.get('window').width ) + 20, //70 is height of top section - availableHeight = AppConfig.VideoScreenObject.height - height - 70 ; + availableHeight = AppConfig.VideoScreenObject.height - height - (isIphoneX ? 116 : 70) ; return this.props.parentIconHeight ? availableHeight - this.props.parentIconHeight : availableHeight; } diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index ac98dd19..dd03d147 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -36,8 +36,6 @@ const bottomReplyViewHeight = isIphoneX() ? 89 : 54; const listBottomPadding = height - (height/1.5)+bottomReplyViewHeight ; const bottomSpace = getBottomSpace([true]); -console.log('bottomSpace', bottomSpace); - class VideoRepliesScreen extends PureComponent { From 75c616f969921c21f125be3d6069c8bd9bc95adf Mon Sep 17 00:00:00 2001 From: Shraddha Date: Wed, 27 Nov 2019 23:54:10 +0530 Subject: [PATCH 240/302] home feed ui fix --- src/components/Home/HomeFeedRow.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Home/HomeFeedRow.js b/src/components/Home/HomeFeedRow.js index 8a16f02a..fa44dbfa 100644 --- a/src/components/Home/HomeFeedRow.js +++ b/src/components/Home/HomeFeedRow.js @@ -70,7 +70,7 @@ class HomeFeedRow extends PureComponent { /> - + {/* From 3ab4d460f1e438fe2aed6818f8d068a8837b8be5 Mon Sep 17 00:00:00 2001 From: Aniket Date: Thu, 28 Nov 2019 00:31:38 +0530 Subject: [PATCH 241/302] reply count formatter added. --- src/components/CommonComponents/ReplyIcon/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/CommonComponents/ReplyIcon/index.js b/src/components/CommonComponents/ReplyIcon/index.js index 1d1f9386..5e6353f1 100644 --- a/src/components/CommonComponents/ReplyIcon/index.js +++ b/src/components/CommonComponents/ReplyIcon/index.js @@ -10,6 +10,7 @@ import Utilities from '../../../services/Utilities'; import NavigationService from "../../../services/NavigationService"; import utilities from "../../../services/Utilities"; import {getVideoReplyObject, replyPreValidationAndMessage} from "../../../helpers/cameraHelper"; +import Pricer from "../../../services/Pricer"; const mapStateToProps = (state , ownProps) => { return { @@ -43,7 +44,7 @@ class ReplyIcon extends PureComponent { render(){ return ( - {this.props.videoReplyCount} + {Pricer.toDisplayAmount(this.props.videoReplyCount)} this.replyVideo())} > From a791f6d57f0fb5257794740c29e3e465bb94d069 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Thu, 28 Nov 2019 00:35:47 +0530 Subject: [PATCH 242/302] Share Complete --- .../ShareIcon/{index.js => Base.js} | 20 ++++--------------- .../CommonComponents/ShareIcon/ReplyShare.js | 12 +++++++++++ .../CommonComponents/ShareIcon/VideoShare.js | 13 ++++++++++++ .../VideoReplyRow.js | 6 ++---- .../FullScreenVideoRow.js | 4 ++-- src/components/Home/HomeFeedRow.js | 17 ++-------------- .../UserVideoHistory/UserVideoHistoryRow.js | 4 ++-- src/services/ReduxGetters.js | 10 ++++++++++ 8 files changed, 47 insertions(+), 39 deletions(-) rename src/components/CommonComponents/ShareIcon/{index.js => Base.js} (61%) create mode 100644 src/components/CommonComponents/ShareIcon/ReplyShare.js create mode 100644 src/components/CommonComponents/ShareIcon/VideoShare.js diff --git a/src/components/CommonComponents/ShareIcon/index.js b/src/components/CommonComponents/ShareIcon/Base.js similarity index 61% rename from src/components/CommonComponents/ShareIcon/index.js rename to src/components/CommonComponents/ShareIcon/Base.js index 6dc52b88..510569c0 100644 --- a/src/components/CommonComponents/ShareIcon/index.js +++ b/src/components/CommonComponents/ShareIcon/Base.js @@ -1,20 +1,13 @@ import React, { PureComponent } from 'react'; import {TouchableOpacity , Image} from "react-native"; -import { connect } from 'react-redux'; -import reduxGetter from '../../../services/ReduxGetters'; import multipleClickHandler from "../../../services/MultipleClickHandler"; import ShareVideo from "../../../services/shareVideo"; import share_icon from '../../../assets/social-share-icon.png'; import share_icon_disabled from '../../../assets/social-disabled-share-icon.png'; -const mapStateToProps = (state , ownProps) => { - return { - isCreatorApproved : reduxGetter.isCreatorApproved(ownProps.userId) - } -}; -class ShareIcon extends PureComponent { +class Base extends PureComponent { constructor(props){ super(props); @@ -27,19 +20,14 @@ class ShareIcon extends PureComponent { render(){ return ( this.shareVideo())} > - + ); } }; -ShareIcon.defaultProps = { - isDisabled: function() { - return this.props.isCreatorApproved != 1; - } -} -export default connect(mapStateToProps)(ShareIcon); +export default Base; diff --git a/src/components/CommonComponents/ShareIcon/ReplyShare.js b/src/components/CommonComponents/ShareIcon/ReplyShare.js new file mode 100644 index 00000000..463750ca --- /dev/null +++ b/src/components/CommonComponents/ShareIcon/ReplyShare.js @@ -0,0 +1,12 @@ +import reduxGetter from '../../../services/ReduxGetters'; +import { connect } from 'react-redux'; +import Base from "./Base" + +const mapStateToProps = (state , ownProps) => { + return { + canReply : reduxGetter.isReplyShareable(ownProps.entityId , state) + } +}; + +const ReplyShareIcon = connect(mapStateToProps)(Base); +export default ReplyShareIcon; \ No newline at end of file diff --git a/src/components/CommonComponents/ShareIcon/VideoShare.js b/src/components/CommonComponents/ShareIcon/VideoShare.js new file mode 100644 index 00000000..aaf37675 --- /dev/null +++ b/src/components/CommonComponents/ShareIcon/VideoShare.js @@ -0,0 +1,13 @@ +import reduxGetter from '../../../services/ReduxGetters'; +import { connect } from 'react-redux'; +import Base from "./Base" + + +const mapStateToProps = (state , ownProps) => { + return { + canReply : reduxGetter.isVideoShareable(ownProps.entityId , state) + } +}; + +const VideoShareIcon = connect(mapStateToProps)(Base); +export default VideoShareIcon; \ No newline at end of file diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index a1428625..62037894 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -2,7 +2,6 @@ import React, { PureComponent } from 'react'; import { View , Dimensions, TouchableOpacity} from 'react-native'; import { withNavigation } from 'react-navigation'; import FanVideo from "../VideoWrapper/FanVideo"; -import ShareIcon from "../CommonComponents/ShareIcon"; import ReportVideo from "../CommonComponents/ReportVideo"; import BottomReplyBar from "../CommonComponents/BottomReplyBar"; import PepoApi from '../../services/PepoApi'; @@ -29,6 +28,7 @@ const marginTopForParentIcon = 15; const AREA = AppConfig.MaxDescriptionArea; const height = AREA / Dimensions.get('window').width + 20; import { fetchVideo } from '../../helpers/helpers'; +import ReplyShareIcon from '../CommonComponents/ShareIcon/ReplyShare'; class VideoReplyRow extends PureComponent { constructor(props) { @@ -148,9 +148,7 @@ class VideoReplyRow extends PureComponent { }} /> - {return false}} - /> + diff --git a/src/components/FullScreenVideoCollection/FullScreenVideoRow.js b/src/components/FullScreenVideoCollection/FullScreenVideoRow.js index 062f5978..c6351a0d 100644 --- a/src/components/FullScreenVideoCollection/FullScreenVideoRow.js +++ b/src/components/FullScreenVideoCollection/FullScreenVideoRow.js @@ -2,7 +2,6 @@ import React, { PureComponent } from 'react'; import { View , Dimensions} from 'react-native'; import { withNavigation } from 'react-navigation'; import FanVideo from '../VideoWrapper/FanVideo'; -import ShareIcon from "../CommonComponents/ShareIcon"; import ReportVideo from "../CommonComponents/ReportVideo"; import PepoApi from '../../services/PepoApi'; import deepGet from 'lodash/get'; @@ -21,6 +20,7 @@ import assignIn from 'lodash/assignIn'; import AppConfig from "../../constants/AppConfig"; import CommonStyle from "../../theme/styles/Common"; import BubbleList from "../CommonComponents/BubbleList"; +import VideoShareIcon from '../CommonComponents/ShareIcon/VideoShare'; const AREA = AppConfig.MaxDescriptionArea; @@ -78,7 +78,7 @@ class FullScreeVideoRow extends PureComponent { getPixelDropData={this.getPixelDropData} /> - + diff --git a/src/components/Home/HomeFeedRow.js b/src/components/Home/HomeFeedRow.js index fa44dbfa..07e1f7c6 100644 --- a/src/components/Home/HomeFeedRow.js +++ b/src/components/Home/HomeFeedRow.js @@ -3,7 +3,6 @@ import {View, Dimensions} from 'react-native'; import { withNavigation } from 'react-navigation'; import FanVideo from '../VideoWrapper/FanVideo'; -import ShareIcon from "../CommonComponents/ShareIcon"; import PepoApi from '../../services/PepoApi'; import reduxGetter from '../../services/ReduxGetters'; import assignIn from 'lodash/assignIn'; @@ -16,14 +15,7 @@ import ReplyIcon from '../CommonComponents/ReplyIcon'; import PepoTxBtn from '../PepoTransactionButton/PepoTxBtn'; import VideoSupporterStat from '../CommonComponents/VideoSupporterStat/VideoSupporterStat'; import DataContract from '../../constants/DataContract'; - -import InvertedReplyList from '../CommonComponents/InvertedReplyThumbnailList'; -import AppConfig from "../../constants/AppConfig"; -import BubbleList from "../CommonComponents/BubbleList"; - -const AREA = AppConfig.MaxDescriptionArea; -const height = AREA / Dimensions.get('window').width + 20; - +import VideoShareIcon from '../CommonComponents/ShareIcon/VideoShare'; class HomeFeedRow extends PureComponent { constructor(props) { @@ -72,10 +64,6 @@ class HomeFeedRow extends PureComponent { - {/* - - */} - - - + diff --git a/src/components/UserVideoHistory/UserVideoHistoryRow.js b/src/components/UserVideoHistory/UserVideoHistoryRow.js index f9b09a3a..783578f8 100644 --- a/src/components/UserVideoHistory/UserVideoHistoryRow.js +++ b/src/components/UserVideoHistory/UserVideoHistoryRow.js @@ -2,7 +2,6 @@ import React, { PureComponent } from 'react'; import { View, Dimensions } from 'react-native'; import { withNavigation } from 'react-navigation'; import FanVideo from '../VideoWrapper/FanVideo'; -import ShareIcon from "../CommonComponents/ShareIcon"; import ReportVideo from "../CommonComponents/ReportVideo"; import PepoApi from '../../services/PepoApi'; @@ -20,6 +19,7 @@ import assignIn from 'lodash/assignIn'; import InvertedReplyList from "../CommonComponents/InvertedReplyThumbnailList"; import AppConfig from "../../constants/AppConfig"; import BubbleList from '../CommonComponents/BubbleList'; +import VideoShareIcon from '../CommonComponents/ShareIcon/VideoShare'; const AREA = AppConfig.MaxDescriptionArea; @@ -90,7 +90,7 @@ class UserVideoHistoryRow extends PureComponent { getPixelDropData={this.getPixelDropData} /> - + diff --git a/src/services/ReduxGetters.js b/src/services/ReduxGetters.js index 0583aada..ee17206a 100644 --- a/src/services/ReduxGetters.js +++ b/src/services/ReduxGetters.js @@ -495,6 +495,16 @@ class ReduxGetters { } + isReplyShareable(id , state){ + state = state || Store.getState(); + return !!Number( deepGet(state, `current_user_reply_detail_relation_entities.id_${id}.is_shareable` , 0)); + } + + isVideoShareable(id ,state){ + state = state || Store.getState(); + return !!Number( deepGet(state, `current_user_video_relation_entities.id_${id}.is_shareable` , 0) ); + } + getReplyDescriptionId(id, state) { state = state || Store.getState(); return deepGet(state, `reply_detail_entities.id_${id}.description_id`); From aae5be6371ede90bb6dc8b19e964852ee7818aa5 Mon Sep 17 00:00:00 2001 From: sachinchauhan Date: Thu, 28 Nov 2019 00:55:01 +0530 Subject: [PATCH 243/302] Bug fix: back button fix --- .../CommonComponents/SlidingUpPanel/index.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/components/CommonComponents/SlidingUpPanel/index.js b/src/components/CommonComponents/SlidingUpPanel/index.js index 4c3e62ef..5dbf5bde 100644 --- a/src/components/CommonComponents/SlidingUpPanel/index.js +++ b/src/components/CommonComponents/SlidingUpPanel/index.js @@ -2,9 +2,14 @@ import SlidingUpPanel from "rn-sliding-up-panel"; class Panel extends SlidingUpPanel{ - constructor(props){ - super(props); - } -} + constructor(props) { + super(props); + } -export default Panel ; \ No newline at end of file + _onBackButtonPress() { + return false; + } + +} + +export default Panel ; From 386f54e61c5fa4b572bf54d578e07a6e4b477c01 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Thu, 28 Nov 2019 01:01:44 +0530 Subject: [PATCH 244/302] Minor fix --- src/components/CustomTab/index.js | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/components/CustomTab/index.js b/src/components/CustomTab/index.js index cc0fb464..4d7cb08d 100644 --- a/src/components/CustomTab/index.js +++ b/src/components/CustomTab/index.js @@ -20,9 +20,6 @@ import { LoginPopoverActions } from '../../components/LoginPopover'; import appConfig from '../../constants/AppConfig'; import reduxGetter from '../../services/ReduxGetters'; import Colors from '../../theme/styles/Colors'; -import NavigationService from '../../services/NavigationService'; - -const commonStack = ["FullScreenReplyCollection"]; const mapStateToProps = (state, ownProps) => { return { @@ -54,17 +51,9 @@ function loginInFlow(navigation, tab) { navigation.navigate(tab.rootStack); } else if (utilities.getLastChildRoutename(navigation.state) !== tab.childStack) { try { - let popStackCount = NavigationService.getStackNumber(navigation.state.routes , tab.navigationIndex, 0 , commonStack.splice(0) ); - if(!popStackCount){ - navigation.dispatch(StackActions.popToTop()); - return; - } - popStackCount++; - for(let cnt = 0 ; cnt <= popStackCount ; cnt++){ - navigation.dispatch(StackActions.popToTop()); - } - } catch { - console.log('Catch error'); + navigation.dispatch(StackActions.popToTop()); + } catch(e) { + console.log('Catch error', e); } } else { clearTimeout(refreshTimeOut); From c84a84afe713dde4046303778f25108b2b66fee0 Mon Sep 17 00:00:00 2001 From: Akshay Raje Date: Thu, 28 Nov 2019 01:24:53 +0530 Subject: [PATCH 245/302] Logout flyer, fanvideo catch --- src/components/BottomStatus/Base.js | 6 ++++-- src/components/FanVideoDetails/index.js | 1 + src/components/FanVideoReplyDetails/index.js | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/BottomStatus/Base.js b/src/components/BottomStatus/Base.js index 9fdc77c6..9d8d788d 100644 --- a/src/components/BottomStatus/Base.js +++ b/src/components/BottomStatus/Base.js @@ -79,6 +79,8 @@ class BottomStatus extends PureComponent { } onIncludesPressed = (tag) => { + if(!Utilities.checkActiveUser()) return; + let tapEntity = reduxGetter.getTappedIncludesEntity(this.props.entityDescriptionId, tag); if (!tapEntity) { return; @@ -116,8 +118,8 @@ class BottomStatus extends PureComponent { - this.navigateToUserProfile())} pointerEvents={'auto'}> - {!!this.props.userName && + this.navigateToUserProfile())} pointerEvents={'auto'}> + {!!this.props.userName && {`@${this.props.userName}`} } diff --git a/src/components/FanVideoDetails/index.js b/src/components/FanVideoDetails/index.js index 8937db43..db8bd20a 100644 --- a/src/components/FanVideoDetails/index.js +++ b/src/components/FanVideoDetails/index.js @@ -188,6 +188,7 @@ class FanVideoDetails extends Component { }; showError = (err) => { + if(!err.error_data) return; for (let error of err.error_data){ switch (error.parameter) { case "link": diff --git a/src/components/FanVideoReplyDetails/index.js b/src/components/FanVideoReplyDetails/index.js index 43b7df5f..387ba4f4 100644 --- a/src/components/FanVideoReplyDetails/index.js +++ b/src/components/FanVideoReplyDetails/index.js @@ -230,6 +230,7 @@ class FanVideoReplyDetails extends Component { showError = (err) => { + if(!err.error_data) return; for (let error of err.error_data){ switch (error.parameter) { case "link": @@ -275,6 +276,9 @@ class FanVideoReplyDetails extends Component { return reject(res.err); } }) + .catch((err)=>{ + return reject(err); + }) }); }; From 7820bc921f2c9a01b97dee7cbd5bce97bf5858f2 Mon Sep 17 00:00:00 2001 From: Aniket Date: Thu, 28 Nov 2019 01:31:04 +0530 Subject: [PATCH 246/302] nav title fix after fetch request --- src/components/UsersProfile/index.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/components/UsersProfile/index.js b/src/components/UsersProfile/index.js index f4d6952b..1a4c00ee 100644 --- a/src/components/UsersProfile/index.js +++ b/src/components/UsersProfile/index.js @@ -23,8 +23,9 @@ const userActionEvents = new EventEmitter(); export default class UsersProfile extends Component { static navigationOptions = ({ navigation }) => { + const name = navigation.getParam('headerTitle') || reduxGetter.getName(navigation.getParam('userId')); return { - title: reduxGetter.getName(navigation.getParam('userId')), + title: name, headerBackTitle: null, headerStyle: { backgroundColor: '#ffffff', @@ -81,7 +82,17 @@ export default class UsersProfile extends Component { onUserResponse = ( res ) => { if(utilities.isEntityDeleted(res)){ this.setState({isDeleted: true}); + return } + let userName = ""; + + const data = res.data + , users = data.users + , user = users[this.userId] + ; + + userName = user["name"]; + this.props.navigation.setParams({ headerTitle: userName}); } _headerComponent() { From 8232861838b4bf405797724c0ea9cbaee3eb0eac Mon Sep 17 00:00:00 2001 From: Aniket Date: Thu, 28 Nov 2019 01:36:27 +0530 Subject: [PATCH 247/302] fix --- src/components/UsersProfile/index.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/components/UsersProfile/index.js b/src/components/UsersProfile/index.js index 1a4c00ee..6143b769 100644 --- a/src/components/UsersProfile/index.js +++ b/src/components/UsersProfile/index.js @@ -17,6 +17,7 @@ import utilities from '../../services/Utilities'; import inlineStyles from './styles'; import UserProfileActionSheet from './userProfileActionSheet'; import CommonStyle from "../../theme/styles/Common"; +import deepGet from "lodash/get"; import EventEmitter from "eventemitter3"; const userActionEvents = new EventEmitter(); @@ -84,14 +85,7 @@ export default class UsersProfile extends Component { this.setState({isDeleted: true}); return } - let userName = ""; - - const data = res.data - , users = data.users - , user = users[this.userId] - ; - - userName = user["name"]; + let userName = deepGet(res, `data.users.${this.userId}.name` , ""); this.props.navigation.setParams({ headerTitle: userName}); } From 7ebce601e9701a584dfeab28757cc33817606c48 Mon Sep 17 00:00:00 2001 From: rachinkapoor Date: Thu, 28 Nov 2019 01:39:10 +0530 Subject: [PATCH 248/302] Fix for Android Suggest List Click --- .../CommonComponents/TagsInput/index.js | 42 ++++++++++++++++--- .../FanVideoDetails/VideoDescription.js | 2 + src/components/FanVideoDetails/index.js | 36 +++++++++++++--- src/components/FanVideoReplyDetails/index.js | 35 ++++++++++++++-- 4 files changed, 99 insertions(+), 16 deletions(-) diff --git a/src/components/CommonComponents/TagsInput/index.js b/src/components/CommonComponents/TagsInput/index.js index 8aa968c2..6e2e07a2 100644 --- a/src/components/CommonComponents/TagsInput/index.js +++ b/src/components/CommonComponents/TagsInput/index.js @@ -1,5 +1,5 @@ import React, { PureComponent } from 'react'; -import { View, Dimensions, Text} from 'react-native'; +import { View, Dimensions, Text, Animated} from 'react-native'; import { FlatList, TouchableOpacity, TouchableWithoutFeedback } from 'react-native-gesture-handler'; import PepoApi from '../../../services/PepoApi'; @@ -133,7 +133,16 @@ class TagsInput extends PureComponent { if (!this.isTrackingStarted) return; if ( deepGet(res , "data.meta.search_kind") === "tags" ) { let resultTypeTags = res.data.result_type; - resultTypeTags && this.setState({ mentionsData:[], hashTagsData: res.data[resultTypeTags]}); + if ( !resultTypeTags ) { + return; + } + let results = res.data[resultTypeTags]; + this.setState({ mentionsData:[], hashTagsData: results}); + if ( results && results.length ) { + this.triggerOnSuggestionsPanelOpen(); + } else { + this.triggerOnSuggestionsPanelClose(); + } } } @@ -141,13 +150,36 @@ class TagsInput extends PureComponent { if (!this.isTrackingStarted) return; if ( deepGet(res , "data.meta.search_kind") == "users") { let resultTypeMentions = res.data.result_type; - resultTypeMentions && this.setState({hashTagsData:[], mentionsData: res.data[resultTypeMentions]}); + if ( !resultTypeMentions ) { + return; + } + let results = res.data[resultTypeMentions]; + this.setState({hashTagsData:[], mentionsData: results}); + this.triggerOnSuggestionsPanelOpen(); + if ( results && results.length ) { + this.triggerOnSuggestionsPanelOpen(); + } else { + this.triggerOnSuggestionsPanelClose(); + } } } closeSuggestionsPanel() { this.stopStracking(); this.setState({ hashTagsData: [], mentionsData: [] }); + this.triggerOnSuggestionsPanelClose(); + } + + triggerOnSuggestionsPanelOpen() { + if( this.props.onSuggestionsPanelOpen ) { + this.props.onSuggestionsPanelOpen(); + } + } + + triggerOnSuggestionsPanelClose() { + if ( this.props.onSuggestionsPanelClose ) { + this.props.onSuggestionsPanelClose(); + } } startTracking() { @@ -266,10 +298,9 @@ class TagsInput extends PureComponent { maxHeight: Dimensions.get('window').height - 300, backgroundColor: '#fff', } , this.props.dropdownStyle ]}> - {this.isHastagData() ? ) } - ); diff --git a/src/components/FanVideoDetails/VideoDescription.js b/src/components/FanVideoDetails/VideoDescription.js index 53b3be1c..f6403627 100644 --- a/src/components/FanVideoDetails/VideoDescription.js +++ b/src/components/FanVideoDetails/VideoDescription.js @@ -20,6 +20,8 @@ class VideoDescription extends PureComponent { return ( { + this.setState({ + isSuggestOpen: false + }); + } + + onSuggestionsPanelOpen = () => { + this.setState({ + isSuggestOpen: true + }); + } + render() { let imageUrl = this.props.recordedVideo.cover_image, value = pricer.getFromDecimal(this.replyAmount, 2) ; @@ -320,15 +339,20 @@ class FanVideoDetails extends Component { - + {this.state.descError } - + Link {this.state.linkError } - + Set Price for replies @@ -346,7 +370,7 @@ class FanVideoDetails extends Component { {this.state.amountError } - + {this.state.error} { @@ -310,6 +311,26 @@ class FanVideoReplyDetails extends Component { return pricer.getToBT(pricer.getFromDecimal(amount), 2); }; + + pointerEventForInPageElement() { + if ( this.state.isSuggestOpen ) { + return "none"; + } + return "auto"; + }; + + onSuggestionsPanelClose = () => { + this.setState({ + isSuggestOpen: false + }); + }; + + onSuggestionsPanelOpen = () => { + this.setState({ + isSuggestOpen: true + }); + }; + render() { let imageUrl = this.props.recordedVideo.cover_image; return ( @@ -333,16 +354,22 @@ class FanVideoReplyDetails extends Component { - + + {this.state.descError } - + Link {this.state.linkError } - + {this.state.error} Date: Thu, 28 Nov 2019 01:53:34 +0530 Subject: [PATCH 249/302] NotchHelper Device List Fix --- src/helpers/NotchHelper.js | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/helpers/NotchHelper.js b/src/helpers/NotchHelper.js index 918cebcb..a4534230 100644 --- a/src/helpers/NotchHelper.js +++ b/src/helpers/NotchHelper.js @@ -1,11 +1,6 @@ import {NativeModules} from "react-native"; const RNDeviceInfo = NativeModules.RNDeviceInfo; -let PepoApi; -import('../services/PepoApi').then((imports) => { - PepoApi = imports.default; -}); - let devicesWithNotch = [ { "brand": "Apple", @@ -140,15 +135,17 @@ let devicesWithNotch = [ class NotchHelper { syncList(){ - let listUrl = "https://d3attjoi5jlede.cloudfront.net/pepo-app/devices-list/notch-devices.json"; - new PepoApi(listUrl).get().then((res)=> { - const devices = res && res.devices; - if( devices && devices instanceof Array && devices.length < 1 ) { - devicesWithNotch = devices; - } - }).catch((error)=> { - console.log("ignore") - }) + fetch(`https://d3attjoi5jlede.cloudfront.net/pepo-app/devices-list/notch-devices-1.json?${Date.now()}`) + .then((response) => response.json()) + .then((responseJson) => { + const devices = responseJson && responseJson.devices; + if( devices && devices instanceof Array && devices.length > 0 ) { + devicesWithNotch = devices; + } + }) + .catch((error) => { + console.log("Notch helper fetch error ignored"); + }); } hasNotch() { From 24f94d662a980c47cbe821ce16dad006585af982 Mon Sep 17 00:00:00 2001 From: Akshay Raje Date: Thu, 28 Nov 2019 02:02:23 +0530 Subject: [PATCH 250/302] Android fan video spacing --- src/components/CommonComponents/NumberInput/index.js | 2 +- src/components/FanVideoDetails/styles.js | 2 +- src/components/FanVideoReplyDetails/styles.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/CommonComponents/NumberInput/index.js b/src/components/CommonComponents/NumberInput/index.js index 15fc3b13..201c2b95 100644 --- a/src/components/CommonComponents/NumberInput/index.js +++ b/src/components/CommonComponents/NumberInput/index.js @@ -53,7 +53,7 @@ export default class NumberInput extends PureComponent{ onChangeText={(value) => {this.onChangeText(value)}} value = {String(this.props.value)} keyboardType = 'decimal-pad' - + style={{paddingVertical: 0}} /> { this.props.errorMsg || this.state.valueError } diff --git a/src/components/FanVideoDetails/styles.js b/src/components/FanVideoDetails/styles.js index 00ca04fd..58e17fb2 100644 --- a/src/components/FanVideoDetails/styles.js +++ b/src/components/FanVideoDetails/styles.js @@ -76,7 +76,7 @@ let stylesMap = { shadowOpacity: 0.2, elevation: 1 }, - linkText: { color: Colors.softBlue, flex: 3}, + linkText: { color: Colors.softBlue, flex: 3, paddingVertical: 0}, replyAmtWrapper : { flex:1, flexDirection:"row", diff --git a/src/components/FanVideoReplyDetails/styles.js b/src/components/FanVideoReplyDetails/styles.js index 4660b8fe..e792ac12 100644 --- a/src/components/FanVideoReplyDetails/styles.js +++ b/src/components/FanVideoReplyDetails/styles.js @@ -73,7 +73,7 @@ let stylesMap = { suggestionTextWrapper: { marginVertical: 9 }, - linkText: { color: Colors.softBlue, flex: 3} + linkText: { color: Colors.softBlue, flex: 3, paddingVertical: 0} }; export default styles = DefaultStyleGenerator.generate(stylesMap); From 823844526ca7f91f972ceb86afb896292b156221 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Thu, 28 Nov 2019 02:40:30 +0530 Subject: [PATCH 251/302] Minor fix --- src/actions/constants.js | 2 ++ src/actions/index.js | 7 +++++++ src/reducers/index.js | 9 +++++++++ src/services/ReduxGetters.js | 2 +- src/services/ReduxSetters.js | 1 + 5 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/actions/constants.js b/src/actions/constants.js index d5817792..3eec4023 100644 --- a/src/actions/constants.js +++ b/src/actions/constants.js @@ -26,6 +26,7 @@ const UPDATE_BALANCE = 'UPDATE_BALANCE'; const UPDATE_IS_PURCHASE = 'UPDATE_IS_PURCHASE'; const UPDATE_EXECUTE_TRANSACTION_STATUS = 'UPDATE_EXECUTE_TRANSACTION_STATUS'; const UPSERT_VIDEO_CONTRIBUTION_ENTITIES = 'UPSERT_VIDEO_CONTRIBUTION_ENTITIES'; +const UPSERT_REPLY_CONTRIBUTION_ENTITIES = 'UPSERT_REPLY_CONTRIBUTION_ENTITIES'; const UPSERT_USER_CONTRIBUTION_ENTITIES = 'UPSERT_USER_CONTRIBUTION_ENTITIES'; const UPSERT_USER_VIDEO_ENTITIES = 'UPSERT_USER_VIDEO_ENTITIES'; const UPDATE_PRICE_POINTS = 'UPDATE_PRICE_POINTS'; @@ -76,6 +77,7 @@ export { UPDATE_IS_PURCHASE, UPDATE_EXECUTE_TRANSACTION_STATUS, UPSERT_VIDEO_CONTRIBUTION_ENTITIES, + UPSERT_REPLY_CONTRIBUTION_ENTITIES, UPSERT_USER_CONTRIBUTION_ENTITIES, UPSERT_USER_VIDEO_ENTITIES, UPDATE_PRICE_POINTS, diff --git a/src/actions/index.js b/src/actions/index.js index a6ab32c7..26a1571b 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -160,6 +160,13 @@ export const upsertVideoContributionEntities = (data) => ({ payload: { video_contribution_entities: data } }); + +export const upsertReplyContributionEntities = (data) => ({ + type: types.UPSERT_REPLY_CONTRIBUTION_ENTITIES, + payload: { reply_contribution_entities: data } +}); + + export const upsertUserContributionEntities = (data) => ({ type: types.UPSERT_USER_CONTRIBUTION_ENTITIES, payload: { user_contribution_entities: data } diff --git a/src/reducers/index.js b/src/reducers/index.js index afd44e36..4743b9e0 100644 --- a/src/reducers/index.js +++ b/src/reducers/index.js @@ -38,6 +38,7 @@ export const { updatePepocorn, updateExecuteTransactionStatus, upsertVideoContributionEntities, + upsertReplyContributionEntities, upsertUserContributionEntities, upsertRecordedVideo, clearRecordedVideo, @@ -231,6 +232,14 @@ export const reducer = handleActions( action.payload.video_contribution_entities ) }), + [upsertReplyContributionEntities]: (state, action) => ({ + ...state, + reply_contribution_entities: assignIn( + {}, + state.reply_contribution_entities, + action.payload.reply_contribution_entities + ) + }), [upsertUserContributionEntities]: (state, action) => ({ ...state, user_contribution_entities: assignIn( diff --git a/src/services/ReduxGetters.js b/src/services/ReduxGetters.js index ee17206a..82d97f9b 100644 --- a/src/services/ReduxGetters.js +++ b/src/services/ReduxGetters.js @@ -527,7 +527,7 @@ class ReduxGetters { isReplySupported(id, state) { state = state || Store.getState(); - let val = deepGet(state, `reply_detail_entities.id_${id}`); + let val = deepGet(state, `reply_contribution_entities.id_${id}`); val = val && Number(val); return !!val; } diff --git a/src/services/ReduxSetters.js b/src/services/ReduxSetters.js index f14eae56..b13c16cb 100644 --- a/src/services/ReduxSetters.js +++ b/src/services/ReduxSetters.js @@ -19,6 +19,7 @@ const knownEntitiesDispatcherMap = { current_user_reply_detail_relations: 'upsertCurrentUserReplyDetailRelationEntities', images: 'upsertImageEntities', current_user_video_contributions: 'upsertVideoContributionEntities', + current_user_reply_detail_contributions: 'upsertReplyContributionEntities', current_user_user_contributions: 'upsertUserContributionEntities', price_points: 'updatePricePoints', token: 'updateToken', From 64c768184235be6fe1a28f756bebb80d0ba4eef3 Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Thu, 28 Nov 2019 02:40:56 +0530 Subject: [PATCH 252/302] ProfileEditScreen UI Fix --- src/components/Profile/ProfileEditScreen.js | 363 ++++++++++---------- 1 file changed, 183 insertions(+), 180 deletions(-) diff --git a/src/components/Profile/ProfileEditScreen.js b/src/components/Profile/ProfileEditScreen.js index fe711ac7..e5e9fe5d 100644 --- a/src/components/Profile/ProfileEditScreen.js +++ b/src/components/Profile/ProfileEditScreen.js @@ -353,205 +353,208 @@ class ProfileEdit extends React.PureComponent { render() { return ( - - - {this.getImageSrc()} - - - - - - - - Name - this.setState({ name, error: null, name_error: null })} - fieldName="name" - textContentType="none" - style={[Theme.TextInput.textInputStyle]} - placeholder="Name" - returnKeyType="next" - returnKeyLabel="Next" - placeholderTextColor="#ababab" - blurOnSubmit={false} - isFocus={this.state.current_formField == this.tabIndex.name} - onFocus={() => { - this.setState({ - current_formField: this.tabIndex.name - }); + + { - this.onSubmitEditing(this.tabIndex.name); - }} - value={this.state.name} - errorMsg={this.state.name_error} - serverErrors={this.state.server_errors} - /> - - Username - this.setState({ user_name, error: null, user_name_error: null })} - fieldName="user_name" - textContentType="none" - style={[Theme.TextInput.textInputStyle]} - placeholder="User Name" - returnKeyType="next" - returnKeyLabel="Next" - placeholderTextColor="#ababab" - blurOnSubmit={false} - onSubmitEditing={() => { - Keyboard.dismiss(); - this.onSubmitEditing(this.tabIndex.username); - }} - isFocus={this.state.current_formField == this.tabIndex.username} - onFocus={() => { - this.setState({ - current_formField: this.tabIndex.username - }); - }} - value={this.state.user_name} - errorMsg={this.state.user_name_error} - serverErrors={this.state.server_errors} - /> - - Email Address - - this.onEmailFocus())} - style={[inlineStyles.clickWrapper,{height : EMAIL_HEIGHT}]} - > - - + showsVerticalScrollIndicator={false} + > + + {this.getImageSrc()} + + + + + + + + Name this.setState({ name, error: null, name_error: null })} + fieldName="name" textContentType="none" - style={[ - Theme.TextInput.textInputStyle, - !this.state.isVerifiedEmail - ? { borderColor: Colors.wildWatermelon2 } - : { backgroundColor: Colors.whiteSmoke } - ]} - placeholder="Email" + style={[Theme.TextInput.textInputStyle]} + placeholder="Name" returnKeyType="next" returnKeyLabel="Next" placeholderTextColor="#ababab" blurOnSubmit={false} - value={this.state.emailAddress} - serverErrors={this.state.server_errors} - autoCapitalize={'none'} - isFocus={false} - /> - { + this.setState({ + current_formField: this.tabIndex.name + }); }} + onSubmitEditing={() => { + this.onSubmitEditing(this.tabIndex.name); + }} + value={this.state.name} + errorMsg={this.state.name_error} + serverErrors={this.state.server_errors} /> - - Bio - - this.onBioFocus())}> - + Username this.setState({ user_name, error: null, user_name_error: null })} + fieldName="user_name" textContentType="none" - style={[Theme.TextInput.textInputStyle, { height: BIO_HEIGHT, paddingVertical: 15 }]} - placeholder="Bio" + style={[Theme.TextInput.textInputStyle]} + placeholder="User Name" returnKeyType="next" returnKeyLabel="Next" placeholderTextColor="#ababab" blurOnSubmit={false} - maxLength={100} - value={this.state.bio} + onSubmitEditing={() => { + Keyboard.dismiss(); + this.onSubmitEditing(this.tabIndex.username); + }} + isFocus={this.state.current_formField == this.tabIndex.username} + onFocus={() => { + this.setState({ + current_formField: this.tabIndex.username + }); + }} + value={this.state.user_name} + errorMsg={this.state.user_name_error} serverErrors={this.state.server_errors} - isFocus={false} - //onFocus={multipleClickHandler(() => this.onBioFocus())} /> - - - - Link - this.setState({ link, error: null, link_error: null })} - fieldName="link" - textContentType="none" - style={[Theme.TextInput.textInputStyle]} - placeholder="Link" - returnKeyType="done" - returnKeyLabel="Done" - placeholderTextColor="#ababab" - blurOnSubmit={false} - onSubmitEditing={() => { - Keyboard.dismiss(); - }} - value={this.state.link} - serverErrors={this.state.server_errors} - /> - - - {this.state.btnText} - - - - {this.state.general_error} - { - this.setState({ - showGalleryAccessModal: false - }); - }} - modalVisibility={this.state.showGalleryAccessModal} - headerText="Library" - accessText="Enable Library Access" - accessTextDesc="Please allow access to photo library to select your profile picture" - imageSrc={GalleryIcon} - imageSrcStyle={{ height: 40, width: 40 }} - /> - { - this.setState({ - showCameraAccessModal: false - }); - }} - modalVisibility={this.state.showCameraAccessModal} - headerText="Camera" - accessText="Enable Camera Access" - accessTextDesc="Allow access to your camera and microphone to take video " - imageSrc={CameraIcon} - /> - + Email Address + + this.onEmailFocus())} + style={[inlineStyles.clickWrapper,{height : EMAIL_HEIGHT}]} + > + + + + + + + Bio + + this.onBioFocus())}> + + this.onBioFocus())} + /> + + + + Link + this.setState({ link, error: null, link_error: null })} + fieldName="link" + textContentType="none" + style={[Theme.TextInput.textInputStyle]} + placeholder="Link" + returnKeyType="done" + returnKeyLabel="Done" + placeholderTextColor="#ababab" + blurOnSubmit={false} + onSubmitEditing={() => { + Keyboard.dismiss(); + }} + value={this.state.link} + serverErrors={this.state.server_errors} + /> + + + + {this.state.btnText} + + + + {this.state.general_error} + { + this.setState({ + showGalleryAccessModal: false + }); + }} + modalVisibility={this.state.showGalleryAccessModal} + headerText="Library" + accessText="Enable Library Access" + accessTextDesc="Please allow access to photo library to select your profile picture" + imageSrc={GalleryIcon} + imageSrcStyle={{ height: 40, width: 40 }} + /> + { + this.setState({ + showCameraAccessModal: false + }); + }} + modalVisibility={this.state.showCameraAccessModal} + headerText="Camera" + accessText="Enable Camera Access" + accessTextDesc="Allow access to your camera and microphone to take video " + imageSrc={CameraIcon} + /> + + ); } } From c358be09f8df2930cf2e3cf8096d42e791d05cf1 Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Thu, 28 Nov 2019 02:45:58 +0530 Subject: [PATCH 253/302] fix for Email screen UI --- src/components/Email/styles.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Email/styles.js b/src/components/Email/styles.js index 0c2447ed..1e899a1f 100644 --- a/src/components/Email/styles.js +++ b/src/components/Email/styles.js @@ -5,8 +5,8 @@ let stylesMap = { container: { flex: 1, backgroundColor: Colors.white, - marginVertical: 20, - marginHorizontal: 10 + paddingVertical: 20, + paddingHorizontal: 10 }, resend: { color: Colors.valhalla, From 8808a7813760b6451546d39faee169a72b310482 Mon Sep 17 00:00:00 2001 From: Akshay Raje Date: Thu, 28 Nov 2019 12:33:51 +0530 Subject: [PATCH 254/302] Report user error --- ios/Pepo2.xcodeproj/project.pbxproj | 1 - package-lock.json | 30 +++++++++---------- .../UsersProfile/userProfileActionSheet.js | 20 ++++++------- 3 files changed, 25 insertions(+), 26 deletions(-) diff --git a/ios/Pepo2.xcodeproj/project.pbxproj b/ios/Pepo2.xcodeproj/project.pbxproj index f18b5999..3c15fe5c 100644 --- a/ios/Pepo2.xcodeproj/project.pbxproj +++ b/ios/Pepo2.xcodeproj/project.pbxproj @@ -5,7 +5,6 @@ }; objectVersion = 46; objects = { - /* Begin PBXBuildFile section */ 00029B4323329B55009E6919 /* TrustKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B76D86A2318FAAC007316D4 /* TrustKit.framework */; }; 00029B4423329B63009E6919 /* OstWalletSdk.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0050FDA022A8226800C2634F /* OstWalletSdk.framework */; }; diff --git a/package-lock.json b/package-lock.json index 3a9fbedd..93f5ac3e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3353,9 +3353,9 @@ }, "dependencies": { "acorn": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.3.0.tgz", - "integrity": "sha512-/czfa8BwS88b9gWQVhc8eknunSA2DoJpJyTQkhheIf5E48u1N0R4q/YxxsAeqRrmK9TQ/uYfgLDfZo91UlANIA==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.0.tgz", + "integrity": "sha512-gac8OEcQ2Li1dxIEWGZzsp2BitJxwkwcOm0zHAJLcPJaVvm58FRnk6RkuLRpU1EujipU2ZFODv2P9DLMfnV8mw==", "dev": true } } @@ -3877,9 +3877,9 @@ "dev": true }, "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.0.tgz", + "integrity": "sha512-Uvq6hVe90D0B2WEnUqtdgY1bATGz3mw33nH9Y+dmA+w5DHvUmBgkr5rM/KCHpCsiFNRUfokW/szpPPgMK2hm4A==", "dev": true }, "babel-jest": { @@ -6377,9 +6377,9 @@ "dev": true }, "uglify-js": { - "version": "3.6.9", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.9.tgz", - "integrity": "sha512-pcnnhaoG6RtrvHJ1dFncAe8Od6Nuy30oaJ82ts6//sGSXOP5UjBMEthiProjXmMNHOfd93sqlkztifFMcb+4yw==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.7.0.tgz", + "integrity": "sha512-PC/ee458NEMITe1OufAjal65i6lB58R1HWMRcxwvdz1UopW0DYqlRL3xdu3IcTvTXsB02CRHykidkTRL+A3hQA==", "dev": true, "optional": true, "requires": { @@ -11343,9 +11343,9 @@ }, "dependencies": { "@types/node": { - "version": "10.17.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.5.tgz", - "integrity": "sha512-RElZIr/7JreF1eY6oD5RF3kpmdcreuQPjg5ri4oQ5g9sq7YWU8HkfB3eH8GwAwxf5OaCh0VPi7r4N/yoTGelrA==", + "version": "10.17.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.6.tgz", + "integrity": "sha512-0a2X6cgN3RdPBL2MIlR6Lt0KlM7fOFsutuXcdglcOq6WvLnYXgPQSh0Mx6tO1KCAE8MxbHSOSTWDoUxRq+l3DA==", "dev": true, "optional": true } @@ -12250,9 +12250,9 @@ "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" }, "resolve": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.2.tgz", - "integrity": "sha512-cAVTI2VLHWYsGOirfeYVVQ7ZDejtQ9fp4YhYckWDEkFfqbVjaT11iM8k6xSAfGFMM+gDpZjMnFssPu8we+mqFw==", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.13.1.tgz", + "integrity": "sha512-CxqObCX8K8YtAhOBRg+lrcdn+LK+WYOS8tSjqSFbjtrI5PnS63QPhZl4+yKfrU9tdsbMu9Anr/amegT87M9Z6w==", "requires": { "path-parse": "^1.0.6" } diff --git a/src/components/UsersProfile/userProfileActionSheet.js b/src/components/UsersProfile/userProfileActionSheet.js index fee0026b..01d2aac6 100644 --- a/src/components/UsersProfile/userProfileActionSheet.js +++ b/src/components/UsersProfile/userProfileActionSheet.js @@ -18,7 +18,7 @@ const ACTION_SHEET_BLOCK_UNBLOCK_INDEX = 1; const mapStateToProps = (state, ownProps) => { return { - canBlockUser: ReduxGetters.canBlockUser(ownProps.userId , state) + canBlockUser: ReduxGetters.canBlockUser(ownProps.userId , state) }; }; @@ -37,12 +37,12 @@ class UserProfileActionSheet extends PureComponent { } }) .catch((err) => { - console.log('Report user failed', err); + Toast.show({text: `Unable to report user right now.`, icon: 'error' }); }); } blockUser = () => { - const oThis =this; + const oThis = this; new PepoApi(`/users/${this.props.userId}/block`) .post() .then((response) => { @@ -50,11 +50,11 @@ class UserProfileActionSheet extends PureComponent { oThis.onBlockUnblockSuccessToast(true); oThis.onBlockUnBlockSuccess(true); }else{ - oThis.onBlockUnblockErrorToast(true); + oThis.onBlockUnblockErrorToast(true); } }) .catch((err) => { - oThis.onBlockUnblockErrorToast(true); + oThis.onBlockUnblockErrorToast(true); }); } @@ -67,11 +67,11 @@ class UserProfileActionSheet extends PureComponent { oThis.onBlockUnblockSuccessToast(); oThis.onBlockUnBlockSuccess(); }else{ - oThis.onBlockUnblockErrorToast(); + oThis.onBlockUnblockErrorToast(); } }) .catch((err) => { - oThis.onBlockUnblockErrorToast(); + oThis.onBlockUnblockErrorToast(); }); } @@ -116,7 +116,7 @@ class UserProfileActionSheet extends PureComponent { } ], {cancelable: true}, - ); + ); } showActionSheet = () => { @@ -124,7 +124,7 @@ class UserProfileActionSheet extends PureComponent { blockAction = this.showBlockAlert; if(!this.props.canBlockUser){ actionOptions = ['Report', 'Unblock' ,'Cancel'] ; //Mutate via code later. - blockAction = this.unBlockUser; + blockAction = this.unBlockUser; } ActionSheet.show( { @@ -153,4 +153,4 @@ class UserProfileActionSheet extends PureComponent { } -export default connect(mapStateToProps)(UserProfileActionSheet); \ No newline at end of file +export default connect(mapStateToProps)(UserProfileActionSheet); From 1ce56288958cb9c2343aa7fb3356208949ff06bc Mon Sep 17 00:00:00 2001 From: Aniket Date: Thu, 28 Nov 2019 12:42:20 +0530 Subject: [PATCH 255/302] content config modified. --- src/theme/ostsdk/ost-sdk-content-config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/theme/ostsdk/ost-sdk-content-config.js b/src/theme/ostsdk/ost-sdk-content-config.js index 4d2d0d70..b558ca3f 100644 --- a/src/theme/ostsdk/ost-sdk-content-config.js +++ b/src/theme/ostsdk/ost-sdk-content-config.js @@ -56,7 +56,7 @@ export default { "text": "Authorize New Session" }, "lead_label": { - "text": "Add a 6-digit PIN to secure your wallet" + "text": "Enter your 6-digit PIN to verify wallet" }, "info_label":{ "text": "" From a4a33df6acaf1ef200e9b2f1238299b1fa236113 Mon Sep 17 00:00:00 2001 From: Akshay Raje Date: Thu, 28 Nov 2019 12:47:07 +0530 Subject: [PATCH 256/302] Action sheet title --- src/components/UsersProfile/userProfileActionSheet.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/UsersProfile/userProfileActionSheet.js b/src/components/UsersProfile/userProfileActionSheet.js index 01d2aac6..2bd5e47d 100644 --- a/src/components/UsersProfile/userProfileActionSheet.js +++ b/src/components/UsersProfile/userProfileActionSheet.js @@ -130,7 +130,8 @@ class UserProfileActionSheet extends PureComponent { { options: actionOptions, cancelButtonIndex: ACTION_SHEET_CANCEL_INDEX, - destructiveButtonIndex: ACTION_SHEET_DESCTRUCTIVE_INDEX + destructiveButtonIndex: ACTION_SHEET_DESCTRUCTIVE_INDEX, + title: "Select user action" }, (buttonIndex) => { if (buttonIndex == ACTION_SHEET_REPORT_INDEX) { From 2fb15d9f8919294b070e5223adbc05099ded5768 Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Thu, 28 Nov 2019 13:21:15 +0530 Subject: [PATCH 257/302] copy changes and remove bubble --- src/components/CaptureVideo/index.js | 2 +- .../FullScreenVideoCollection/FullScreenVideoRow.js | 6 +----- src/components/UserVideoHistory/UserVideoHistoryRow.js | 6 ++---- src/components/VideoRecorder/index.js | 8 ++++---- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/components/CaptureVideo/index.js b/src/components/CaptureVideo/index.js index 134fc670..23208b81 100644 --- a/src/components/CaptureVideo/index.js +++ b/src/components/CaptureVideo/index.js @@ -147,7 +147,7 @@ class CaptureVideo extends Component { getActionSheetText = (videoObject) => { if (videoObject.video_type ===AppConfig.videoTypes.reply ){ - return 'You were replying to ' + this.getName(); + return 'You have a pre-recorded reply'; } else if (videoObject.video_type === AppConfig.videoTypes.post ) { return 'You have already recorded video'; } diff --git a/src/components/FullScreenVideoCollection/FullScreenVideoRow.js b/src/components/FullScreenVideoCollection/FullScreenVideoRow.js index c6351a0d..bbd181b1 100644 --- a/src/components/FullScreenVideoCollection/FullScreenVideoRow.js +++ b/src/components/FullScreenVideoCollection/FullScreenVideoRow.js @@ -63,11 +63,7 @@ class FullScreeVideoRow extends PureComponent { {!!this.videoId && !!this.userId && ( - - - - - + diff --git a/src/components/UserVideoHistory/UserVideoHistoryRow.js b/src/components/UserVideoHistory/UserVideoHistoryRow.js index 783578f8..153a41ec 100644 --- a/src/components/UserVideoHistory/UserVideoHistoryRow.js +++ b/src/components/UserVideoHistory/UserVideoHistoryRow.js @@ -75,11 +75,9 @@ class UserVideoHistoryRow extends PureComponent { {!!this.props.videoId && !!this.props.userId && ( - + + - - - diff --git a/src/components/VideoRecorder/index.js b/src/components/VideoRecorder/index.js index 5c245398..65dfc97c 100644 --- a/src/components/VideoRecorder/index.js +++ b/src/components/VideoRecorder/index.js @@ -29,7 +29,7 @@ import Theme from "../../theme/styles"; import multipleClickHandler from "../../services/MultipleClickHandler"; import TouchableButton from "../FanVideoReplyDetails/TouchableButton"; import Pricer from "../../services/Pricer"; -const ACTION_SHEET_BUTTONS = ['Reshoot', 'Continue with already recorded']; +const ACTION_SHEET_BUTTONS = ['Reshoot', 'Continue']; const ACTION_SHEET_CONTINUE_INDEX = 1; const ACTION_SHEET_RESHOOT_INDEX = 0; const PROGRESS_FACTOR = 0.01; @@ -170,9 +170,9 @@ class VideoRecorder extends Component { return Pricer.getToBT(Pricer.getFromDecimal(amount), 2); }; - getUserName = () => { + getUserFullName = () => { let userId = reduxGetters.getVideoCreatorUserId(this.props.videoId); - return reduxGetters.getUserName(userId) + return reduxGetters.getName(userId) }; @@ -196,7 +196,7 @@ class VideoRecorder extends Component { - You are replying to @{this.getUserName()}’s video. Once you post the reply, you will pay {this.getPepoAmount()} Pepo Coins + Reply to {this.getUserFullName()}'s video for {this.getPepoAmount()} Pepo Coins Date: Thu, 28 Nov 2019 13:40:56 +0530 Subject: [PATCH 258/302] replacing reply icon --- src/assets/video-reply.png | Bin 2538 -> 7528 bytes .../CommonComponents/ReplyIcon/index.js | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/assets/video-reply.png b/src/assets/video-reply.png index 8a3b5292bfd2b2aa070d90e19cd86c6e92aedf43..d78e5a67f78eb86b0547c869422e16a2360f4609 100644 GIT binary patch literal 7528 zcmV-u9hc&XP)m00004XF*Lt006O% z3;baP0012yNklpWzM<9`UTIbH6q1wfEU;-F=38@3|cV{&uOOpX^#sKN&|`htXdqx0Ri0Wgl8; z%a~g!j8@vx|3<-fOx%VXc%$Pj>tEK-?`zqlm-SQZMtuEPHaOqRgl*_SmK|f3UzT3` zk!LHjpLvOH*5>=oi{bq?IN$2T_0@pOj4S3-R>!zw{@BW5UUEZQDAPxl9=ouNkN59W zz8w?St^t-AOXyQ1YiwnFVt#r1m6gO$AIgg9b)Kicm<}6Q#s}X%!EjRhq?3Z6MPmr< zUiQ4Y@p2Z=aJ(HI7}|;w723U=#j7uGD*$&oP{!KJT#BK~cY<-OHX=IOGu7 zmm)oWt)Nd}BfR%j|HvR?3T5GCb{L7$(QdG2ZJG zPcph9#NVTM5p8>=`qw;Ly=Rk>pTs6Z6gJE2!`os!x)@4_o;%@gswt|h*a$!esdthinu37wY+<|5Pw_v@GiZWMh{g>kZE^g@yPj8T?8=DVJbiCoW6Qjyi(>)}0$ z&yvGc#mgF&mx+T;c614zefHTSCQqKc zq@)cnA0Jz)l+5SD4?g(dH7lx@-hco7C00;NUw--JrT5);-%B%Q%y`QjDHOGV&q9g> zUu5}v9=ng@b?`Bi&XZy^MI^78##wE>9$pyo=+KiO^r0-h*THM-;zgYoU3Ae7M;vj) zUZY2k-fPP(x7=sYph4Toph_@UYlYBdNS`vbgA~3l_D3Im^!nRxzy0WvB}*3Ge*5hU zFTC)=H>@LH06y{XF}v4!UgM@+h}b-aykwEuHcZVTAnqGs#zhu`OZ7<%zxp97k>Yp z?|kRM-~RTuADGP-0?9`Q7U{8j)Gi>y3q{h06w`%1bux*pQx*tWZP3S1y1b2I0p$xX zgim6O88c?ktXZ@6n>caeR4bMP%|6IB-torvPhwRvTy2N7dGqJbzx&u@k6mErO>1q$ zN}h^EB&2Xa3c=fa8|)z}o^+xRd$ql<*t{;2S0WmrEPwPdl#WdWAo4Or0m>$xE%lu} zd-iUVCQUkg#E21x*~+p7iBP~zkdoDC&6+iDzyA8`cinsMy?1~8>tA1F`{4`47YV#} z6<*2q{*q&x+E5rF$_8OW&O{}pEM@tk_b8rC@hJ+=Qy4<@UPt@RU;p~o2kf`se%}~6 zbm*ry@nWg%YCW(|c7nao_VwB?e({S7%)=K1g@P^*6&$-SBIzlN5M_g~AxDv9M~#6p z=8Mjw_`HqckdJr}eWJ6g;m&#U<{h-xUVDARu7EyeldE$U+5VPEhpa9upl2U>SS-S4O z|NcXF-+lLQ3?4jqNAuB6%l5G$-XwOJzi7dN1wZ-x=Rg0T?L0+6K_Cl5o#diT^C=$@ z*emtE#&oHjq^F7q6Z1jmQG9Gm3c_qcHu=G)c-2)`jsNObzxr=>NSa`i*JCRT@y-2X zNy(e$z4zXGeCEuVKREZ?bC=pIgoUD2%IlPH$>=0!ZDvY~CRQjho!TUcPMD0BSmMxm z6z?|`gGeZSS{xC+<1?T6%+O!{@|P#uy_XZsu7c6MmWpaKVDF)%IP7lq)pj%Uf9&4S zM`ofhC>&&=-(p20yNJRFvDdoJj+`RNPZa?Z+L1kq_nR*oUoi4PR$++m_|>m|wfA9% z9d@4Gs2f?+8B~-p13h-9dhyLS-#pD$=I6}E7l?Qjk%}PHhs7hiFBZ?6sgAJKDJg(D zWlf0L&ybK&QRs~9Q9K(11K9!DrIW0!3g(4?;k>wL3^dLT=oE~m)07FN~=-@$$MY4Db1(~AJeVKjj9Wvc^bg*sG zSJdJR=)~E!6?5jyIqRsSj(Xa{`9qfH!^4(8TydxZHLCCsRVORCA%!|*VQiytC>oDx z(b)Znsh|DqXV15t)S-!(Vc(V9#0=EV5xecK^Er0a^*ake!GIKvm(>%+14>t_c$DNk zBEcZO6cFtt`+^Zq(RA2Kv%lQ|{+{VnGhr-ZR@meW*pw#oeel5t|G-wBJuD2lP!7b$ z@}u6!g%IBB#YZVTT=>RnfJ|VIu>mQbd?=bu`!34FLk~UlN49g=6t|-G&w$>O9lPwZ z%ak2<*x{kMbLYO3(}h3mkmHzprY)~6-UUH6wcLGU;U|LjydKE`y_j_ zn$4i1KAeFLo9j+n-48LC_rL=Wtgybwox1e}6B~xN`*!%II$t=cvgU;>^c%$?x3FlE zf-!y9`RAX%{h4Q;`QNq!n@g5+MH^%Wl#{^+9B{xSyVrBilTSXmI-^&LB*f62I;hio zrRU}3i$$^qB%Md`+Ef@|mwndM`PaYx^~Z*L)(%l-u4qHffUdUetE<1+ZoBRN)%xY6 zSO~8ZVt5q~C&-{LD0p*As7J|;QC<=Gf{GPV#}iLHakTwfV6UoZVpF?ebeenna{fW~ z^^C);N8aEdIh0JUJz{6D*pTZEA>K$sbadcRJSz=+*X5UAK6dKVsk&EF9iGx@-e^qE zs8OT#u}|0UwgOri83ii|h)XD=Pm#g^Wq=p@O~v60CoGzQ_PNu*#fukTV|RsjtqMm| zx$#MdtmVs>KW5)^I@3nOp-Ep`6|VvjqL=IsRg(Q?VnUgRDjbBqctTmWw4m&^_px>x z{L@v@Xqx&5DHmI9wbj0lJ@(k)HX{GVhbMw z&R;WU{AgF<#-D+nJ@?%66e}PdC6piD>>3$4ByS<&BTPvFJkcoBp%;c*Qn}Y%cioY8 z>Aj_ISn>U420HBfPNVFm;6XN`aHa9G&#eZJEWVCp5XDeBf_hZda(l&R&SJY2upmv2d->$I!#fHdgqt!<%3o@&W5S|qWER|?qbrclXdHU(6Z(~I> z!8)mm#wMXZldiDrK@5A_j{^qR#z`I}!V4kKqf5{yJ9LW4($#JDv(_KbqW}QcG!)-Z30^*ZXz>a zpPDOo%4M3*KxR*{BPUq4aOj{e$nfFA_1LuP#JFxsHx0qgO_e*SF0Ux_FspD%1+v@M z+t^upatk`IlgifbW?+pyp0~`=BC`&%3a4mKlYsX8nr-bYz1bK=eN^^7ngPAp?XkUE zw-Uakq}!+Ax&zr#j8+C;wQYI^?ET)MU!F8gEhXI^!MfavSD$fIw294tJ>_CqD?@I! zaFX*HdtAMK^i`eXw3301)3(dLhn)9=y~0st6;4uZbDX!)URUt*9_=5 zWrg#$8&#NZOj-J-l1{K5E1Y+14EmZyMVr_R*zewSs3Mmdy?8dsxm2`T_`p6;qJQ?; zXBT;8#cw(@U=Oy^pOlDV#p3hs`Q8@xs>^Dw)!{)Em3Sc=U*gh-nqB(J=v!~SHP2R^ zp(a>4cm|Hn>pj2TIZoIBSpj{+RBy-1Cu}fOA{|%Qe`lcU#TQ?k zU&|*sC7+-lJwE6Xx#%3nI};R?t;e2*FuyuMW}5mxTCN7%aKjD0aL6afPDsuq&S!8y z2J_BybiR|E>)5k*Z?=yg#+a;j74_p8uzPQ>*iW>Nu_5|%8h9N!#H(n;Yonk%u6L+1 zzdG_&SJ%+IQrVuva*G|V>Kax;znp;{J51f`b64XTY?@Q2k0w?tO3Xk21%!`bQjr&2 zaKWACSAD%gv(=BuuBKL=cG_vT+Yo&&!v?2h zLO#JUUOKj{LzWIx@<|R?Li;=9AKGt}^+P@BD%wahU@J}c8*jXEhy6>>MK%NuM;xkD zKH{Ep8*{XN~R=DA3;I6ywy1+I)U0u0K z^Hbx!j$DEotmh>|(ywlr9!2?+ZoBESZ7Z`Bbv@UGLwR;A1v&KI5xx?P5S6FOT7$LmR3AvPxocSSP_qsa1sBr3>O`wx3 zWN@;JXV7cyuH|L6^5~X#MSU;>_SDy3*!koSEOa{O#`}Db6JIQ`JTf}jJk`nJISr1X z9$Dyl6`o`YP?((C)O5({J)WnZe)`M1@4ovPW*5<}SE^ncodFfW0GrcG?2$A2xPW9uM?T5wV^>{+?bG#>CQO)cl<6v}%|Puu zP~R24)}GsUL#<#a0t!RL6BZ1zBH=Hc-(-_40(+(2*O)G`C~-xU)!6IdL1KDYJo0+H zEx&8*$9;Ni3O>a6SYoYU2H2mJ{eH%b87GV%KmMmyH2Py!Uo0w^W{QS6Wv)T=!k8|# z>)qZADJUxrd<>=2<_Q^Ff@8;y?V31o;+H<|C(0@qn}bgM5v%?A{7+9k_0&JvCH##y-gu~8VYT#lF#>Li zSSy$gE13JPzyA7JXPj}yi?$zOacHiJbn?mDG(ED5z+S0=*Rq8}C$ZuQyJOI_2?vJ^ z4mj?(D-F)u3=lL9 z1^MUapMQSIZMWUF~IlUv&5j!y<|KpbKLmdklHW5d9)IjOkL_aLeKb6jq(5CGs>Yn!fm0K?T#b zV#SK5?0>X=c;0#EEisvi_NehNaiDafQ0~=czv3T5uM^KkG~_&#ueZl!bRI)qGNgDd zQ@aZ%S}csxK2|v1ejIixa+^@^)K2@j;!k#kcIA;r9{IS*S?^xD^pod#*+ZE&U}#5< zAv)qpMh73F?+2T24oB zdg!VtQ>OgRVrXLWiY82ix-FW_JUcc}@kGeNJl@;NwhR3vi-^@L)xYN1>OD(Jtrkw+ z3Zua$1GbaL(c{LAn^u$a+7u33=PcJ`cSOK5UELBYfy98S*~pz&sm14P&c?Q>McnTMdq@UFtSlH0=CpyET8;+_`h- z*oS|Mt#j$K3I@H#C_iE#dklHWdE{fs4>?3^=!uCe^gR9^J&&(+qEPPD_P*xXykAp% zUloo9ofe5*>VDE>T~RecO1xrp*oyM}qD6~t`_{L(UP^`M6%6*<5yQ%iF zT}m&sZ@N8fcU&L2=bn4?r6q_-5&F#+j(lbFI()Ht6kkMYUqs%=^Rz<;O7Hnl&a)BI zW9aW~ea4ggvK@GT__RPQi08Qpm=uvcBk=EzKKkg>?Jn)#uU)%#nXN*L?AvWG+N!d6 z=FFMT*)JbdD8%&RVPZfIQK0liTVA}F&FjkWj1Av*%f$5<_Tg=P&c_m!*Qxi17lyoK zRvpEI4^g(Ty>yHt2=eysn7PYm;RQ^`TsLEU|V)-Jeb{eVzp!1O%B>WR zc8H>&Xkt5w4?E(EhIXKQ;E4swCO)>wCh|7q7)s~K_u=)8@I^6-?7pu?e0{qO#ym1Svm^F+lk>3J185x(DT^PAqz!b->d0;&C+|HcJLdjpLUEjHwN$eTqkFY z`J;=W*Tr}jx{zhkg`QW#EZN({i}3B0+V|R5aoab-Hb!dnZmznf02qds;X!;t)FhXk zXnaA%3VGuDm{~l&p!Y*pVZjU(B{S#7)?9wdmDJ&!#^pIpz&&&!?kRN6vmg8ndKFkUdU0*MN#A`$qbiB`f7 zO^sN@=r2-Dh#Ew^fl*W}VieIPM8TA5TWtYv7->KWtx!OX1W^!Byw&G9?zNr0&+N<0 zp4ofmobOBCvu4)Jto6ZLPINNCbO6EUyAbf|cMX;Qli3WRPcy^Y6}qCz1}j-^V$2FSrxj zmBAhazMuWZ+n^hpx#I}80w-SG!D`aOI!^tERB@gJs`g*u|J7Ia@7Uh~ZUQ$Wtox0# zs);Clg9vvJ7oP&w0EIgQNNf^~&6!yeR|oz8egw9IEeQKJ(wW;#g+x4~>b2ku@CINL z*#zNmW2hxz74f^^8n6pdZ7pVEGZ7L2kL7L^?=4^{NW`$&I!nGkfal)=-$u~er+pVw z6%qkY<_6CL3YiF)_C42GU%Dsz(@!AijdfO*ExUFh5zjj8`xNlSz^2m? z3c9WCo2^Yq1bhO{p9VI7qk;X0d5g)Cpto_;3i|!JZoU>F5%Cxtz687!EJgwQ^-3J< z;=ub6bYK4olkQh4BmzDaht37-fl~)ZrD6YPz&=z_KMuZtpzc>Uua^P2@&j)dbP<9oZfToHNJM-V zHD3;l#)!glGAN*fp!XoAi}|Ijw2+9niW;v1E@nqxSc?AcMMmcy@HWIOwU%2diV$%P zm0k}*L`bN>oL4(V+XA=8l_{^VkW_R!6@48X2qF^8u%3U7T>4CPGaR3kf6Cz8LQN|b zoJdidfS;hSdKj?J{0BIbX7=afRx!4ai1=~}by4^!VC?J0btKN~VZgbjZ!^3JF`cH2 zw6O$1L|1CA1-?pAxH%r_MVyewfCHdEgHsXnzPuB%c_W2H#20XZ!{cXzXi~H6)xYh^ z&+ox0h^eRpZD@2MqC$TbIA07A2hv#E0S7<^(#J;CFjPn`UI(1)$LMqvll2{!`?Uns zn}<~~uxaJOm0b7(;6ixVY#DGQ`v_P~6Z^+JS8^i~5p70oQlmM|V{Q6*2AuQuiw9Mm zDu12HP_Iat{X!bDVeMexpSZa?xtbO7WHMs`ATiVY)Nihxl-!&XlKyce z8Hc9KNL$0ei_mUv;U-1oiq^Ouj%FEfu)55QB;+C4qp{s82IjQO3K;{PR_WJucAk*2 z5YXkOH5&%sJR#%RV{7#5I%@Fs2RGCnA5-KL5kx4g+(q zN2ZAUHJPQqEgO{1jDZJv9=Xrj=Y;IMk@Yk7W56>rO$t}+EMr@`Dn+FGzI5d`fWq3r zfFsr&$g2 zBr5%4-f&sO9Z=Q&Hmn)

Hd08hrl4<-e0pd}aj*^s zJ`DF)k5lkiLRt_7ew4)dW!Q8W_#B*ne%z{t4tDYiVF0v|{B!b-MP4NgIJmhQ5jPYm zZS06lg;K!1g&No&CZeh*VCba|{@T+J^{~EC07y z>~Coytp+iVC;1Za2YKV|0!S!fuAlmUDBp>QyGmR?cgaLTS^{DoLE@)q6^KOxNGM>= z&+h?mMZ~)cTsQC3iJL?mxQ|j#1@@ahxsJsHNEl&qBv)SrubWgv>zX(sEhHJyc`Vz` zH;)FDmYwQY0I34*1^!>GTdKOB%E?AdA4oguT3?lu3#1(TLPfk7T#AVPyh>$O`2a-+ z5!2^pj>INzx+}ZW*%hRK^1K~vgdd}^a;qaEeR0cIEB#5d#cT@b;O~3j5(K=xPBJQw zNSr+jJf}{l8(y{o+7ew0K81jHPQ%|yBa$Z7S3{f&9Rw;Zdm3a+P)BM$?NY7*Uq--v z6O>o@(yAlUh4ll$Vh}Nn0eq{?|Jm@zm57!uoK+qHsbxAv@teuL?WWE zPJRVAf2>PHNp%3R6&wmyfb4%k@VKyk&l|N==(&Cl6T(Gm z_k~}R*av9bTLL#Dri|xSm)I!&Ce!to0*&_HT#}9_{G5f@@5)2e=TGvsB z{a0BLlTgmVz6mxVo{<N9PBUye6<*l?T?sZL;A5m=6){j$NSnboj!}1N zHhp-y6I>5&Ks>*U5>^8Pg_=nE$ffvj128hvhd{B6Qb(LNoqK_+A=|+Ah&))Bf)x@{ ze-QI|B@~07*qoM6N<$f;Ahg Ar~m)} diff --git a/src/components/CommonComponents/ReplyIcon/index.js b/src/components/CommonComponents/ReplyIcon/index.js index 5e6353f1..55f9cf8f 100644 --- a/src/components/CommonComponents/ReplyIcon/index.js +++ b/src/components/CommonComponents/ReplyIcon/index.js @@ -48,7 +48,7 @@ class ReplyIcon extends PureComponent { this.replyVideo())} > - + ); } From b5e6644a6fe42697ba3f0e49e6e889460dec8e4b Mon Sep 17 00:00:00 2001 From: Aniket Date: Thu, 28 Nov 2019 12:47:22 +0530 Subject: [PATCH 259/302] fix --- src/theme/ostsdk/ost-sdk-content-config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/theme/ostsdk/ost-sdk-content-config.js b/src/theme/ostsdk/ost-sdk-content-config.js index b558ca3f..ec563d36 100644 --- a/src/theme/ostsdk/ost-sdk-content-config.js +++ b/src/theme/ostsdk/ost-sdk-content-config.js @@ -56,7 +56,7 @@ export default { "text": "Authorize New Session" }, "lead_label": { - "text": "Enter your 6-digit PIN to verify wallet" + "text": "Enter your 6-digit PIN to authorize yourself" }, "info_label":{ "text": "" From ad53925f1bf6c68b9e551d1bd53eb639671beb4f Mon Sep 17 00:00:00 2001 From: Aniket Date: Thu, 28 Nov 2019 13:55:40 +0530 Subject: [PATCH 260/302] ost wallet sdk back icon color fix. --- src/theme/ostsdk/ost-sdk-theme-config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/theme/ostsdk/ost-sdk-theme-config.js b/src/theme/ostsdk/ost-sdk-theme-config.js index 9c660b55..5e1934ef 100644 --- a/src/theme/ostsdk/ost-sdk-theme-config.js +++ b/src/theme/ostsdk/ost-sdk-theme-config.js @@ -91,7 +91,7 @@ export default { "tint_color": colors.paynesGrey }, "back":{ - "tint_color": "#438bad" + "tint_color": colors.paynesGrey } }, From eef5e1b1afd861c1813028ede846cde9561ec93d Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Thu, 28 Nov 2019 14:48:51 +0530 Subject: [PATCH 261/302] Minor fix --- RootNavigationContainer.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/RootNavigationContainer.js b/RootNavigationContainer.js index 51299c1b..30e17876 100644 --- a/RootNavigationContainer.js +++ b/RootNavigationContainer.js @@ -105,10 +105,21 @@ const cardStackConfig = { cardStyle: { backgroundColor: 'rgba(0,0,0,0)' }, transitionConfig: ( transitionProps, prevTransitionProps ) => { const scenes = transitionProps["scenes"]; + const prevScene = scenes[scenes.length - 2]; const nextScene = scenes[scenes.length - 1]; + if (nextScene.route.routeName === 'VideoReplies') { return NavigationAnimation.fromBottom(); } + + if(Platform.OS = "ios"){ + if (prevScene + && prevScene.route.routeName === 'VideoReplies' + && nextScene.route.routeName === 'FullScreenReplyCollection') { + return NavigationAnimation.fromBottom(); + } + } + } } From 8d3a93e8c136a73657dec521890b626e34a63307 Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Thu, 28 Nov 2019 15:46:00 +0530 Subject: [PATCH 262/302] Copy text need to change on Invite page. --- src/components/ReferAndEarn/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ReferAndEarn/index.js b/src/components/ReferAndEarn/index.js index 60d42d37..182b57de 100644 --- a/src/components/ReferAndEarn/index.js +++ b/src/components/ReferAndEarn/index.js @@ -127,7 +127,7 @@ class ReferAndEarn extends Component { style={[styles.heading, { textAlign: 'center' }]} >{`You have ${this.state.inviteText} invites remaining`} - Pepo is currently invite only. Invite your friends and you will get 5% commission on their earnings. + Invite your friends and you will get 5% commission on their earnings. From c2907960950f23f259e6761f8dc704cb8cd871d3 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Thu, 28 Nov 2019 16:10:09 +0530 Subject: [PATCH 263/302] minor fix --- src/components/UsersProfile/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/UsersProfile/index.js b/src/components/UsersProfile/index.js index 6143b769..3bb9acb2 100644 --- a/src/components/UsersProfile/index.js +++ b/src/components/UsersProfile/index.js @@ -18,6 +18,7 @@ import inlineStyles from './styles'; import UserProfileActionSheet from './userProfileActionSheet'; import CommonStyle from "../../theme/styles/Common"; import deepGet from "lodash/get"; +import unescape from'lodash/unescape'; import EventEmitter from "eventemitter3"; const userActionEvents = new EventEmitter(); @@ -86,7 +87,7 @@ export default class UsersProfile extends Component { return } let userName = deepGet(res, `data.users.${this.userId}.name` , ""); - this.props.navigation.setParams({ headerTitle: userName}); + this.props.navigation.setParams({ headerTitle: unescape(userName)}); } _headerComponent() { From ff282a19c686c31bd42653452404b560e333d826 Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Thu, 28 Nov 2019 16:11:36 +0530 Subject: [PATCH 264/302] Copy change suggested for - twitter login screen --- src/components/LoginPopover/index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/LoginPopover/index.js b/src/components/LoginPopover/index.js index c65cd885..13a77c34 100644 --- a/src/components/LoginPopover/index.js +++ b/src/components/LoginPopover/index.js @@ -147,15 +147,14 @@ class loginPopover extends React.Component { /> - By signing up, you confirm that you agree to - our + By signing up you confirm that you agree to our { this.closeModal(); InAppBrowser.openBrowser( `${WEB_ROOT}/terms` ); })}>Terms of use - and have read and agree to our + and { this.closeModal(); InAppBrowser.openBrowser( From 5ee658ffe9f391f6b3709307ef293217ddcdefc1 Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Thu, 28 Nov 2019 16:31:04 +0530 Subject: [PATCH 265/302] fix --- src/components/FanVideoDetails/index.js | 2 +- src/components/FanVideoReplyDetails/index.js | 2 +- src/services/CameraWorker.js | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/FanVideoDetails/index.js b/src/components/FanVideoDetails/index.js index 0e0a59b8..7fd63a39 100644 --- a/src/components/FanVideoDetails/index.js +++ b/src/components/FanVideoDetails/index.js @@ -321,7 +321,7 @@ class FanVideoDetails extends Component { return ( Date: Thu, 28 Nov 2019 17:31:05 +0530 Subject: [PATCH 266/302] fix for android ScrollView and bubbles thread UI --- RootNavigationContainer.js | 2 +- .../CommonComponents/InvertedReplyThumbnailList/index.js | 2 +- src/constants/AppConfig.js | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/RootNavigationContainer.js b/RootNavigationContainer.js index 30e17876..34600f8a 100644 --- a/RootNavigationContainer.js +++ b/RootNavigationContainer.js @@ -112,7 +112,7 @@ const cardStackConfig = { return NavigationAnimation.fromBottom(); } - if(Platform.OS = "ios"){ + if(Platform.OS == "ios"){ if (prevScene && prevScene.route.routeName === 'VideoReplies' && nextScene.route.routeName === 'FullScreenReplyCollection') { diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index 143c5118..57b8d6e7 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -240,7 +240,7 @@ class InvertedReplyList extends PureComponent { const area = AppConfig.MaxDescriptionArea; let height = ( area / Dimensions.get('window').width ) + 20, //70 is height of top section - availableHeight = AppConfig.VideoScreenObject.height - height - (isIphoneX ? 116 : 70) ; + availableHeight = AppConfig.VideoScreenObject.height - height - (isIphoneX ? 78 : Platform.OS === 'ios' ? 28 : 80) ; return this.props.parentIconHeight ? availableHeight - this.props.parentIconHeight : availableHeight; } diff --git a/src/constants/AppConfig.js b/src/constants/AppConfig.js index ed346209..60309a0e 100644 --- a/src/constants/AppConfig.js +++ b/src/constants/AppConfig.js @@ -340,11 +340,11 @@ export default { thumbnailListConstants: { separatorHeight: 25, // this is height of profile icon + shadow around it. - iconHeight:50, + iconHeight:54, // this is width of profile icon + shadow around it. - iconWidth: 50, - parentIconHeight: 42, - parentIconWidth: 42 + iconWidth: 54, + parentIconHeight: 46, + parentIconWidth: 46 }, VideoScreenObject : { ...ifIphoneX( From 443efb556555613419e0236a7558dd15ae1a17be Mon Sep 17 00:00:00 2001 From: Akshay Raje Date: Thu, 28 Nov 2019 18:00:58 +0530 Subject: [PATCH 267/302] Notch helper --- RootNavigationContainer.js | 12 +++++------- index.js | 1 - src/components/AuthLoading/index.js | 2 +- src/helpers/NotchHelper.js | 20 ++++++++++++++++---- 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/RootNavigationContainer.js b/RootNavigationContainer.js index 34600f8a..bd5bc646 100644 --- a/RootNavigationContainer.js +++ b/RootNavigationContainer.js @@ -1,11 +1,10 @@ import React from 'react'; -import { View, Platform} from 'react-native'; +import { View } from 'react-native'; import { Root } from 'native-base'; import { createSwitchNavigator, createAppContainer } from 'react-navigation'; -import { createStackNavigator , StackViewTransitionConfigs} from 'react-navigation-stack'; +import { createStackNavigator } from 'react-navigation-stack'; import NavigationAnimation from "./src/helpers/NavigationAnimation"; import { createBottomTabNavigator } from 'react-navigation-tabs'; -import deepGet from 'lodash/get'; import NavigationService from './src/services/NavigationService'; import AuthLoading from './src/components/AuthLoading'; @@ -41,7 +40,6 @@ import SocketManager from './src/services/SocketManager'; import SearchScreen from './src/components/Search'; import FanVideoDetails from './src/components/FanVideoDetails'; import FanVideoReplyDetails from './src/components/FanVideoReplyDetails'; - import WalletSettingScreen from './src/components/WalletSetting'; import StoreProductsScreen from './src/components/StoreProducts'; import PaymentWorker from './src/components/PaymentWorker'; @@ -72,7 +70,7 @@ const customTabHiddenRoutes = [ 'InAppBrowserComponent', 'CouchMarks', 'VideoReplies', - 'FullScreenReplyCollection', + 'FullScreenReplyCollection', 'FullScreenVideoCollection', 'UserVideoHistory', 'VideoPlayer', @@ -91,11 +89,11 @@ const modalStackConfig = { } }; -const txModalConfig = { +const txModalConfig = { transparentCard: true, cardStyle: { backgroundColor: 'rgba(0,0,0,0)' }, gesturesEnabled: false, - transitionConfig: (transitionProps, prevTransitionProps) => { + transitionConfig: (transitionProps, prevTransitionProps) => { return NavigationAnimation.defaultTransition(); } }; diff --git a/index.js b/index.js index 83b27449..226255de 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,6 @@ /** * @format */ -import * as foo from "./src/helpers/Logger"; import { AppRegistry } from 'react-native'; import AppContainer from './AppContainer'; import { name as appName } from './app.json'; diff --git a/src/components/AuthLoading/index.js b/src/components/AuthLoading/index.js index 6ff180bf..1278f4ff 100644 --- a/src/components/AuthLoading/index.js +++ b/src/components/AuthLoading/index.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import { View, StatusBar, Alert, Platform, Linking } from 'react-native'; +import { View, StatusBar, Alert } from 'react-native'; import Toast from '../../theme/components/NotificationToast'; import styles from './styles'; diff --git a/src/helpers/NotchHelper.js b/src/helpers/NotchHelper.js index a4534230..005da3bd 100644 --- a/src/helpers/NotchHelper.js +++ b/src/helpers/NotchHelper.js @@ -1,5 +1,4 @@ -import {NativeModules} from "react-native"; -const RNDeviceInfo = NativeModules.RNDeviceInfo; +import DeviceInfo from 'react-native-device-info'; let devicesWithNotch = [ { @@ -135,7 +134,7 @@ let devicesWithNotch = [ class NotchHelper { syncList(){ - fetch(`https://d3attjoi5jlede.cloudfront.net/pepo-app/devices-list/notch-devices-1.json?${Date.now()}`) + fetch(`https://d3attjoi5jlede.cloudfront.net/pepo-app/devices-list/notch-devices.json?${Date.now()}`) .then((response) => response.json()) .then((responseJson) => { const devices = responseJson && responseJson.devices; @@ -148,8 +147,21 @@ class NotchHelper { }); } + hasNotchRemote(){ + if(devicesWithNotch.length > 0){ + return ( + devicesWithNotch.findIndex( + item => + item.brand.toLowerCase() === DeviceInfo.getBrand().toLowerCase() && + (item.model.toLowerCase() === DeviceInfo.getDeviceName().toLowerCase() || item.model.toLowerCase() === DeviceInfo.getModel().toLowerCase()) + ) !== -1 + ); + } + return false; + } + hasNotch() { - return devicesWithNotch.findIndex(item => item.brand === RNDeviceInfo.brand && ( item.model === RNDeviceInfo.deviceName || item.model === RNDeviceInfo.model )) !== -1; + return DeviceInfo.hasNotch() || this.hasNotchRemote(); } } From 4b2b67d7e4579dcee686d3c4d60aefa173d83927 Mon Sep 17 00:00:00 2001 From: rachinkapoor Date: Thu, 28 Nov 2019 18:49:07 +0530 Subject: [PATCH 268/302] isChargable update --- src/services/CameraWorker.js | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/services/CameraWorker.js b/src/services/CameraWorker.js index 601ec059..af2e645c 100644 --- a/src/services/CameraWorker.js +++ b/src/services/CameraWorker.js @@ -255,6 +255,15 @@ class CameraWorker extends PureComponent { return isChargeable && amountToSendWithReply != '0'; }; + onPlatfromAcknowledgeComplete = (videoId) => { + new PepoApi(`/videos/${videoId}`) + .get() + .then((res) => {}) + .catch((error) => {}); + }; + + + executeTransaction = () => { @@ -266,7 +275,8 @@ class CameraWorker extends PureComponent { doDiscard = this.props.recorded_video.do_discard, receiverUserId = deepGet (this.props.recorded_video, 'reply_obj.replyReceiverUserId'), amountToSendWithReply = deepGet(this.props.recorded_video, 'reply_obj.amountToSendWithReply'), - toTokenHolderAddress = deepGet(this.props.recorded_video,'reply_obj.toTokenHolderAddress' ); + toTokenHolderAddress = deepGet(this.props.recorded_video,'reply_obj.toTokenHolderAddress' ), + parentVideoId = deepGet(this.props.recorded_video , 'reply_obj.replyReceiverVideoId'); if (! goForTx || ! receiverUserId || doDiscard || this.executeTx ){ return; } @@ -285,10 +295,14 @@ class CameraWorker extends PureComponent { }); - let callbacks = {onRequestAcknowledge: this.videoUploadedSuccessCallback, onFlowInterrupt: this.onFlowInterrupt}; - let config = {metaProperties: this.getSdkMetaProperties()}; - let txExecutor = new TransactionExecutor(config, callbacks); - txExecutor.sendTransactionToSdk( amountToSendWithReply, toTokenHolderAddress, false); + let callbacks = { + onRequestAcknowledge: this.videoUploadedSuccessCallback, + onFlowInterrupt: this.onFlowInterrupt, + onPlatfromAcknowledgeComplete: () => {this.onPlatfromAcknowledgeComplete(parentVideoId)} + }; + let config = {metaProperties: this.getSdkMetaProperties()}; + let txExecutor = new TransactionExecutor(config, callbacks); + txExecutor.sendTransactionToSdk( amountToSendWithReply, toTokenHolderAddress, false); // todo : Execute transaction code. call clean up after that. }; From 07140519cb218cc95469fcac95cedcd36e982d5c Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Thu, 28 Nov 2019 19:11:56 +0530 Subject: [PATCH 269/302] Platform in InvertedReplyThumbnailList --- .../CommonComponents/InvertedReplyThumbnailList/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index 57b8d6e7..69f4e7e9 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -1,5 +1,5 @@ import React, { PureComponent } from 'react'; -import { Text, View, ScrollView, ListView, Dimensions} from 'react-native'; +import { Text, View, ScrollView, ListView, Dimensions, Platform} from 'react-native'; import { withNavigation } from 'react-navigation'; import Pagination from "../../../services/Pagination"; From ae1bd1c2afe850a39529fdd24de4a4c9e6772f1b Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Thu, 28 Nov 2019 19:20:41 +0530 Subject: [PATCH 270/302] Platform --- RootNavigationContainer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RootNavigationContainer.js b/RootNavigationContainer.js index bd5bc646..2030f387 100644 --- a/RootNavigationContainer.js +++ b/RootNavigationContainer.js @@ -1,5 +1,5 @@ import React from 'react'; -import { View } from 'react-native'; +import { View, Platform } from 'react-native'; import { Root } from 'native-base'; import { createSwitchNavigator, createAppContainer } from 'react-navigation'; import { createStackNavigator } from 'react-navigation-stack'; From f8547abd7c9352e9227179bea90e6d817efaa830 Mon Sep 17 00:00:00 2001 From: Akshay Raje Date: Thu, 28 Nov 2019 19:42:52 +0530 Subject: [PATCH 271/302] Report user toast --- src/components/UsersProfile/userProfileActionSheet.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/UsersProfile/userProfileActionSheet.js b/src/components/UsersProfile/userProfileActionSheet.js index 2bd5e47d..9dc9c371 100644 --- a/src/components/UsersProfile/userProfileActionSheet.js +++ b/src/components/UsersProfile/userProfileActionSheet.js @@ -34,6 +34,8 @@ class UserProfileActionSheet extends PureComponent { .then((response) => { if (response && response.success){ Toast.show({text:'User reported successfully!', icon: 'success' }); + } else { + Toast.show({text: `Unable to report user right now.`, icon: 'error' }); } }) .catch((err) => { From ce2acc0e039a16e18c6ed4fc0343eec7bc9010b9 Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Thu, 28 Nov 2019 20:13:40 +0530 Subject: [PATCH 272/302] replt icon --- src/components/CommonComponents/ReplyIcon/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/CommonComponents/ReplyIcon/index.js b/src/components/CommonComponents/ReplyIcon/index.js index 55f9cf8f..693865bd 100644 --- a/src/components/CommonComponents/ReplyIcon/index.js +++ b/src/components/CommonComponents/ReplyIcon/index.js @@ -48,7 +48,7 @@ class ReplyIcon extends PureComponent { this.replyVideo())} > - + ); } From 4ba9a7d6f154cdeddb5d1d1fab8fd2729dd69b00 Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Thu, 28 Nov 2019 21:26:40 +0530 Subject: [PATCH 273/302] fix for reply count in sliding panel not updating --- src/components/VideoReplies/index.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index dd03d147..2ce7238a 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -62,7 +62,8 @@ class VideoRepliesScreen extends PureComponent { showBackdrop : false, addRepliesVisible : true, videoUploaderVisible: false, - currentHeight : this.initialHeight + currentHeight : this.initialHeight, + videoReplyCount : ReduxGetters.getVideoReplyCount(this.videoId) } } @@ -147,6 +148,12 @@ class VideoRepliesScreen extends PureComponent { return wrapStyles; }; + onRefresh = ()=> { + this.setState({ + videoReplyCount : ReduxGetters.getVideoReplyCount(this.videoId) + }) + }; + render(){ return ( @@ -199,7 +206,7 @@ class VideoRepliesScreen extends PureComponent { - {ReduxGetters.getVideoReplyCount(this.videoId)} Repl{ReduxGetters.getVideoReplyCount(this.videoId) > 1 ? 'ies' : 'y'} + {this.state.videoReplyCount} Repl{this.state.videoReplyCount > 1 ? 'ies' : 'y'} {/*Send a reply with{' '}*/} {/**/} @@ -209,7 +216,7 @@ class VideoRepliesScreen extends PureComponent { this.initialHeight? topPadding+bottomPadding+bottomReplyViewHeight : listBottomPadding} - + onRefresh={this.onRefresh} /> From 20c12f40a0b46e33a9ba309c644cad3332eeeec0 Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Thu, 28 Nov 2019 22:12:36 +0530 Subject: [PATCH 274/302] Semicolon fix --- src/components/Notification/NotificationItem.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/Notification/NotificationItem.js b/src/components/Notification/NotificationItem.js index 48af9c04..abeba325 100644 --- a/src/components/Notification/NotificationItem.js +++ b/src/components/Notification/NotificationItem.js @@ -183,8 +183,10 @@ class NotificationItem extends Component { let includesObj = this.props.heading && this.props.heading["includes"] || {} , userObj ; for(let key in includesObj ){ - userObj = includesObj[key] || null; - break ; + if ( includesObj[key] && includesObj[key].kind === 'users'){ + userObj = includesObj[key] || null; + break; + } } if(userObj){ return this.includesTextNavigate(userObj))}> @@ -195,7 +197,7 @@ class NotificationItem extends Component { }else { return( - ; + ) From 3a4d9f08900e6d8ea6b37524e67f8d2f8849b713 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Thu, 28 Nov 2019 22:24:49 +0530 Subject: [PATCH 275/302] No pendant intial code --- .../BaseVideoReplyRow.js | 193 ++++++++++++++++++ .../NoPendantsVideoReplyRow.js | 16 ++ .../VideoReplyRow.js | 183 +---------------- .../FullScreenReplyCollection/index.js | 16 +- 4 files changed, 228 insertions(+), 180 deletions(-) create mode 100644 src/components/FullScreenReplyCollection/BaseVideoReplyRow.js create mode 100644 src/components/FullScreenReplyCollection/NoPendantsVideoReplyRow.js diff --git a/src/components/FullScreenReplyCollection/BaseVideoReplyRow.js b/src/components/FullScreenReplyCollection/BaseVideoReplyRow.js new file mode 100644 index 00000000..46aeb62a --- /dev/null +++ b/src/components/FullScreenReplyCollection/BaseVideoReplyRow.js @@ -0,0 +1,193 @@ +import React, { PureComponent } from 'react'; +import { View , Dimensions, TouchableOpacity} from 'react-native'; +import { withNavigation } from 'react-navigation'; +import FanVideo from "../VideoWrapper/FanVideo"; +import ReportVideo from "../CommonComponents/ReportVideo"; +import BottomReplyBar from "../CommonComponents/BottomReplyBar"; +import PepoApi from '../../services/PepoApi'; +import deepGet from 'lodash/get'; + +import inlineStyles from './styles'; + +import ReplyPepoTxBtn from '../PepoTransactionButton/ReplyPepoTxBtn'; +import VideoReplySupporterStat from '../CommonComponents/VideoSupporterStat/VideoReplySupporterStat'; + +import ReplyVideoBottomStatus from '../BottomStatus/ReplyVideoBottomStatus'; +import DataContract from '../../constants/DataContract'; +import ReduxGetters from '../../services/ReduxGetters'; +import CommonStyle from "../../theme/styles/Common"; +import assignIn from 'lodash/assignIn'; +import InvertedReplyList from "../CommonComponents/InvertedReplyThumbnailList"; + +import AppConfig from "../../constants/AppConfig"; +import ProfilePicture from "../ProfilePicture"; +import multipleClickHandler from '../../services/MultipleClickHandler'; + + +const marginTopForParentIcon = 15; +const AREA = AppConfig.MaxDescriptionArea; +const height = AREA / Dimensions.get('window').width + 20; +import { fetchVideo } from '../../helpers/helpers'; +import ReplyShareIcon from '../CommonComponents/ShareIcon/ReplyShare'; + +class BaseVideoReplyRow extends PureComponent { + constructor(props) { + super(props); + this.state = { + parentVideoId : ReduxGetters.getReplyParentVideoId( props.replyDetailId ), + parentUserId : ReduxGetters.getReplyParentUserId( props.replyDetailId ) + } + this.onParentClickDelegate = this.props.parentClickHandler || this.defaultParentClickHandler; + } + + componentDidMount(){ + if(this.props.doRender && this.state.parentVideoId && !this.state.parentUserId ){ + this.fetchParentVideo = fetchVideo(this.state.parentVideoId, this.onParentVideoFetch , null , this.onParentVideoFetchComplete); + } + } + + componentDidUpdate(prevProps){ + if(!this.fetchParentVideo && this.props.doRender && this.props.doRender !== prevProps.doRender && !this.state.parentUserId ){ + fetchVideo(this.state.parentVideoId, this.onParentVideoFetch , null , this.onParentVideoFetchComplete); + } + } + + componentWillUnmount(){ + this.onParentVideoFetch = () => {}; + this.onParentVideoFetchComplete = () => {}; + } + + onParentProfileIconClick() { + if(this.state.parentVideoId){ + this.onParentClickDelegate(); + } + } + + onParentVideoFetchComplete() { + this.fetchParentVideo = null; + } + + onParentVideoFetch = (res) => { + const users = deepGet(res , "data.users") || {} , + userKeys = Object.keys(users) || [] , + userId = userKeys[0] || null; + if(userId){ + this.setState({ + parentUserId: userId + }); + } + } + + refetchVideoReply = () => { + new PepoApi(`/replies/${this.props.replyDetailId}`) + .get() + .then((res) => {}) + .catch((error) => {}); + }; + + getPixelDropData = () => { + const parentData = this.props.getPixelDropData(); + const pixelParams = { e_entity: 'reply' , parent_video_id : this.state.parentVideoId , reply_detail_id :this.props.replyDetailId }; + return assignIn({}, pixelParams, parentData); + } + + defaultParentClickHandler(){ + this.props.navigation.goBack(null); + } + + _renderInvertedFlatList = () => { + if( this.state.parentVideoId ){ + return ( + + + + ) + } + return null; + } + + render() { + const videoId = ReduxGetters.getReplyEntityId(this.props.replyDetailId); + return ( + + + + + + + {!!videoId && !!this.props.userId && ( + + + + + {this._renderInvertedFlatList()} + + + + + {this.onParentProfileIconClick()})}> + + + + + + + + + + + + + + )} + + + + + + ); + } +} + +BaseVideoReplyRow.defaultProps = { + getPixelDropData: function(){ + console.warn("getPixelDropData props is mandatory for Video component"); + return {}; + }, + paginationService : null, + currentIndex: 0 + }; + +export default BaseVideoReplyRow diff --git a/src/components/FullScreenReplyCollection/NoPendantsVideoReplyRow.js b/src/components/FullScreenReplyCollection/NoPendantsVideoReplyRow.js new file mode 100644 index 00000000..a2325106 --- /dev/null +++ b/src/components/FullScreenReplyCollection/NoPendantsVideoReplyRow.js @@ -0,0 +1,16 @@ +import BaseVideoReplyRow from "./BaseVideoReplyRow"; +import { withNavigation } from "react-navigation"; + +class NoPendantsVideoReplyRow extends BaseVideoReplyRow { + constructor(props){ + super(props); + } + + _renderInvertedFlatList =() => { + return null; + } +} + +NoPendantsVideoReplyRow.defaultProps = BaseVideoReplyRow.defaultProps; + +export default withNavigation( NoPendantsVideoReplyRow ); diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index 62037894..5a606b04 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -1,187 +1,14 @@ -import React, { PureComponent } from 'react'; -import { View , Dimensions, TouchableOpacity} from 'react-native'; -import { withNavigation } from 'react-navigation'; -import FanVideo from "../VideoWrapper/FanVideo"; -import ReportVideo from "../CommonComponents/ReportVideo"; -import BottomReplyBar from "../CommonComponents/BottomReplyBar"; -import PepoApi from '../../services/PepoApi'; -import deepGet from 'lodash/get'; -import inlineStyles from './styles'; -import ReplyPepoTxBtn from '../PepoTransactionButton/ReplyPepoTxBtn'; -import VideoReplySupporterStat from '../CommonComponents/VideoSupporterStat/VideoReplySupporterStat'; +import BaseVideoReplyRow from "./BaseVideoReplyRow"; +import { withNavigation } from "react-navigation"; -import ReplyVideoBottomStatus from '../BottomStatus/ReplyVideoBottomStatus'; -import DataContract from '../../constants/DataContract'; -import ReduxGetters from '../../services/ReduxGetters'; -import CommonStyle from "../../theme/styles/Common"; -import assignIn from 'lodash/assignIn'; -import InvertedReplyList from "../CommonComponents/InvertedReplyThumbnailList"; - -import AppConfig from "../../constants/AppConfig"; -import ProfilePicture from "../ProfilePicture"; -import multipleClickHandler from '../../services/MultipleClickHandler'; - - -const marginTopForParentIcon = 15; -const AREA = AppConfig.MaxDescriptionArea; -const height = AREA / Dimensions.get('window').width + 20; -import { fetchVideo } from '../../helpers/helpers'; -import ReplyShareIcon from '../CommonComponents/ShareIcon/ReplyShare'; - -class VideoReplyRow extends PureComponent { +class VideoReplyRow extends BaseVideoReplyRow { constructor(props) { super(props); - this.state = { - parentVideoId : ReduxGetters.getReplyParentVideoId( props.replyDetailId ), - parentUserId : ReduxGetters.getReplyParentUserId( props.replyDetailId ) - } - this.onParentClickDelegate = this.props.parentClickHandler || this.defaultParentClickHandler; - } - - componentDidMount(){ - if(this.props.doRender && this.state.parentVideoId && !this.state.parentUserId ){ - this.fetchParentVideo = fetchVideo(this.state.parentVideoId, this.onParentVideoFetch , null , this.onParentVideoFetchComplete); - } - } - - componentDidUpdate(prevProps){ - if(!this.fetchParentVideo && this.props.doRender && this.props.doRender !== prevProps.doRender && !this.state.parentUserId ){ - fetchVideo(this.state.parentVideoId, this.onParentVideoFetch , null , this.onParentVideoFetchComplete); - } - } - - componentWillUnmount(){ - this.onParentVideoFetch = () => {}; - this.onParentVideoFetchComplete = () => {}; - } - - onParentProfileIconClick() { - if(this.state.parentVideoId){ - this.onParentClickDelegate(); - } - } - - onParentVideoFetchComplete() { - this.fetchParentVideo = null; - } - - onParentVideoFetch = (res) => { - const users = deepGet(res , "data.users") || {} , - userKeys = Object.keys(users) || [] , - userId = userKeys[0] || null; - if(userId){ - this.setState({ - parentUserId: userId - }); - } - } - - refetchVideoReply = () => { - new PepoApi(`/replies/${this.props.replyDetailId}`) - .get() - .then((res) => {}) - .catch((error) => {}); - }; - - getPixelDropData = () => { - const parentData = this.props.getPixelDropData(); - const pixelParams = { e_entity: 'reply' , parent_video_id : this.state.parentVideoId , reply_detail_id :this.props.replyDetailId }; - return assignIn({}, pixelParams, parentData); - } - - defaultParentClickHandler(){ - this.props.navigation.goBack(null); - } - - render() { - const videoId = ReduxGetters.getReplyEntityId(this.props.replyDetailId); - return ( - - - - - - - {!!videoId && !!this.props.userId && ( - - - - - {this.state.parentVideoId && ( - - - - - )} - - - - - {this.onParentProfileIconClick()})}> - - - - - - - - - - - - - - )} - - - - - - ); } } -VideoReplyRow.defaultProps = { - getPixelDropData: function(){ - console.warn("getPixelDropData props is mandatory for Video component"); - return {}; - }, - paginationService : null, - currentIndex: 0 - }; +VideoReplyRow.defaultProps = BaseVideoReplyRow.defaultProps; -export default withNavigation(VideoReplyRow) +export default withNavigation( VideoReplyRow ) diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index 98848339..acd62cfc 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -1,5 +1,5 @@ import React , {PureComponent} from "react"; -import {FlatList } from "react-native"; +import {FlatList ,View } from "react-native"; import FloatingBackArrow from "../CommonComponents/FlotingBackArrow"; import deepGet from "lodash/get"; @@ -230,8 +230,20 @@ class FullScreenReplyCollection extends PureComponent{ render() { return ( - + + + + + + Date: Thu, 28 Nov 2019 22:25:31 +0530 Subject: [PATCH 276/302] Minor revert --- src/components/FullScreenReplyCollection/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index acd62cfc..99ce328a 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -233,7 +233,7 @@ class FullScreenReplyCollection extends PureComponent{ - + {/* - + */} Date: Thu, 28 Nov 2019 22:27:56 +0530 Subject: [PATCH 277/302] Added cloneWithData with Data. --- src/services/FetchServices.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/services/FetchServices.js b/src/services/FetchServices.js index e5f8c32a..ab4ecbfd 100644 --- a/src/services/FetchServices.js +++ b/src/services/FetchServices.js @@ -23,7 +23,7 @@ class FetchServices { } initVals() { - + //NOTE: If adding removing vals from here, update cloneWithData method. this.isFetching = false; this.hasNextPage = true; this.nextPagePayload = null; @@ -160,6 +160,20 @@ class FetchServices { return new Constructor(this.url, this.extraParams, this.id, this.options); } + cloneWithData() { + let Constructor = this.constructor; + let newInstance = new Constructor(this.url, this.extraParams, this.id); + const seedData = this.result; + + newInstance.processResults( this.results || []); + newInstance.isFetching = false; + newInstance.hasNextPage = this.hasNextPage; + newInstance.nextPagePayload = this.nextPagePayload; + newInstance.meta = Object.assign({}, this.meta); + console.log("newInstance.results.length", newInstance.results.length); + return newInstance; + } + cloneInstance(){ return Object.assign( Object.create( Object.getPrototypeOf(this)), this); } From 9dcd5952f1c59cc169447b9aa01d129cb73b8ca6 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Thu, 28 Nov 2019 23:19:57 +0530 Subject: [PATCH 278/302] Functional code complete --- .../InvertedReplyThumbnailList/index.js | 23 +++++++++++-------- .../BaseVideoReplyRow.js | 7 +++--- .../FullScreenReplyCollection/index.js | 20 ++++++++-------- src/components/ReplyCollection/index.js | 4 ++-- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index 69f4e7e9..6955f0cc 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -10,6 +10,7 @@ import AppConfig from "../../../constants/AppConfig"; import DataContract from '../../../constants/DataContract'; import ReduxGetters from '../../../services/ReduxGetters'; import { isIphoneX } from 'react-native-iphone-x-helper'; +import deepGet from "lodash/get"; // const ITEM_HEIGHT = AppConfig.thumbnailListConstants.iconHeight + AppConfig.thumbnailListConstants.iconWidth; @@ -60,25 +61,27 @@ class InvertedReplyList extends PureComponent { this.props.navigation.goBack(null); } - parentClickHandler =()=>{ - const parentVideoId = this.props.videoId, - parentUserId = ReduxGetters.getVideoCreatorUserId(parentVideoId); - this.props.navigation.push('VideoPlayer', { - userId: parentUserId, - videoId: parentVideoId, - bubbleClickHandler: this.bubbleClickHandler - }); + getParentClickHandler =( videoId )=>{ + return () => { + parentUserId = ReduxGetters.getVideoCreatorUserId(videoId); + this.props.navigation.push('VideoPlayer', { + userId: parentUserId, + videoId: videoId, + bubbleClickHandler: this.bubbleClickHandler + }); + } } defaultChildClickHandler = ( index, item )=> { - const baseUrl = DataContract.replies.getReplyListApi(this.props.videoId), + const videoId = ReduxGetters.getReplyParentVideoId(deepGet(item , "payload.reply_detail_id")); + baseUrl = DataContract.replies.getReplyListApi(videoId), clonedInstance = this.getPagination().fetchServices.cloneInstance(); ReplyHelper.updateEntitySeen( item );     this.props.navigation.push('FullScreenReplyCollection',{       "fetchServices": clonedInstance,       "currentIndex":index,       "baseUrl": baseUrl, - "parentClickHandler": this.parentClickHandler + "parentClickHandler": this.getParentClickHandler( videoId )     });   }; diff --git a/src/components/FullScreenReplyCollection/BaseVideoReplyRow.js b/src/components/FullScreenReplyCollection/BaseVideoReplyRow.js index 46aeb62a..21b22d75 100644 --- a/src/components/FullScreenReplyCollection/BaseVideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/BaseVideoReplyRow.js @@ -1,6 +1,5 @@ import React, { PureComponent } from 'react'; import { View , Dimensions, TouchableOpacity} from 'react-native'; -import { withNavigation } from 'react-navigation'; import FanVideo from "../VideoWrapper/FanVideo"; import ReportVideo from "../CommonComponents/ReportVideo"; import BottomReplyBar from "../CommonComponents/BottomReplyBar"; @@ -98,7 +97,7 @@ class BaseVideoReplyRow extends PureComponent { _renderInvertedFlatList = () => { if( this.state.parentVideoId ){ return ( - + - + + - {/* - + - */} + {this.removeVideo(reply_detail_id , index )}} /> } - {this.onVideoClick(index)}}/> + {this.onVideoClick(index , item)}}/> ); } @@ -212,7 +212,7 @@ class ReplyCollection extends PureComponent { } } - onVideoClick = ( index ) => { + onVideoClick = ( index , item) => { const clonedInstance = this.videoPagination.fetchServices.cloneInstance(); this.props.navigation.push("FullScreenReplyCollection", { "fetchServices" : clonedInstance, From 14f29c4df1e384834494a813aebeeed4a12fcbdd Mon Sep 17 00:00:00 2001 From: Akshay Raje Date: Thu, 28 Nov 2019 23:20:37 +0530 Subject: [PATCH 279/302] parent_video_id = pn in case of video_reply --- .../FullScreenReplyCollection/VideoReplyRow.js | 17 +++++++++++------ .../FullScreenReplyCollection/index.js | 3 +-- .../FullScreenVideoCollection/index.js | 8 ++++---- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/components/FullScreenReplyCollection/VideoReplyRow.js b/src/components/FullScreenReplyCollection/VideoReplyRow.js index 62037894..dd1fa07f 100644 --- a/src/components/FullScreenReplyCollection/VideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/VideoReplyRow.js @@ -44,7 +44,7 @@ class VideoReplyRow extends PureComponent { if(this.props.doRender && this.state.parentVideoId && !this.state.parentUserId ){ this.fetchParentVideo = fetchVideo(this.state.parentVideoId, this.onParentVideoFetch , null , this.onParentVideoFetchComplete); } - } + } componentDidUpdate(prevProps){ if(!this.fetchParentVideo && this.props.doRender && this.props.doRender !== prevProps.doRender && !this.state.parentUserId ){ @@ -62,7 +62,7 @@ class VideoReplyRow extends PureComponent { this.onParentClickDelegate(); } } - + onParentVideoFetchComplete() { this.fetchParentVideo = null; } @@ -75,7 +75,7 @@ class VideoReplyRow extends PureComponent { this.setState({ parentUserId: userId }); - } + } } refetchVideoReply = () => { @@ -87,7 +87,12 @@ class VideoReplyRow extends PureComponent { getPixelDropData = () => { const parentData = this.props.getPixelDropData(); - const pixelParams = { e_entity: 'reply' , parent_video_id : this.state.parentVideoId , reply_detail_id :this.props.replyDetailId }; + const pixelParams = { + e_entity: 'reply', + parent_video_id : this.state.parentVideoId, + p_name: this.state.parentVideoId, + reply_detail_id :this.props.replyDetailId + }; return assignIn({}, pixelParams, parentData); } @@ -101,7 +106,7 @@ class VideoReplyRow extends PureComponent { - + - + )} diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index 98848339..ec319dbf 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -153,8 +153,7 @@ class FullScreenReplyCollection extends PureComponent{ return () => { return { e_entity: 'reply', - p_type: 'video_reply', - p_name: replyDetailId + p_type: 'video_reply' }; } } diff --git a/src/components/FullScreenVideoCollection/index.js b/src/components/FullScreenVideoCollection/index.js index 7a31d27e..43127eea 100644 --- a/src/components/FullScreenVideoCollection/index.js +++ b/src/components/FullScreenVideoCollection/index.js @@ -144,12 +144,12 @@ class FullScreenVideoCollection extends PureComponent{ } } else if( entityHelper.isVideoEntity( item )) { return this._renderVideoRow( item, index); - } - + } + }; getPixelDropData = () => { - return pixelParams = { + return { e_entity: 'video', p_type: 'tag', p_name: this.tagId, @@ -157,7 +157,7 @@ class FullScreenVideoCollection extends PureComponent{ } getReplyPixelDrop = () => { - return pixelParams = { + return { e_entity: 'reply', p_type: 'tag', p_name: this.tagId, From 9270abd0f95b2e6558adec6d6a16e4c690dbec41 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Thu, 28 Nov 2019 23:33:15 +0530 Subject: [PATCH 280/302] Minor fix --- src/components/FullScreenVideoCollection/index.js | 1 + src/components/Home/VideoList.js | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/FullScreenVideoCollection/index.js b/src/components/FullScreenVideoCollection/index.js index 7a31d27e..dd0084c8 100644 --- a/src/components/FullScreenVideoCollection/index.js +++ b/src/components/FullScreenVideoCollection/index.js @@ -268,6 +268,7 @@ class FullScreenVideoCollection extends PureComponent{ showsVerticalScrollIndicator={false} onScrollToTop={this.onScrollToTop} initialScrollIndex={this.state.activeIndex} + nestedScrollEnabled={true} getItemLayout={this.getItemLayout} onScrollToIndexFailed={this.onScrollToIndexFailed} /> diff --git a/src/components/Home/VideoList.js b/src/components/Home/VideoList.js index d1acb457..e8d044bb 100644 --- a/src/components/Home/VideoList.js +++ b/src/components/Home/VideoList.js @@ -83,7 +83,6 @@ class VideoList extends PureComponent { showsVerticalScrollIndicator={false} onScrollToTop={this.onScrollToTop} onScrollToIndexFailed={this.onScrollToIndexFailed} - nestedScrollEnabled={true} ref={(ref) => (this.flatlistRef = ref)} /> From 7dd93b2a54ff50e64170d386856f1644ddb4dd3e Mon Sep 17 00:00:00 2001 From: Akshay Raje Date: Fri, 29 Nov 2019 00:21:22 +0530 Subject: [PATCH 281/302] Minor fixes --- src/components/FullScreenVideoCollection/index.js | 1 - src/components/VideoReplies/index.js | 8 ++++---- src/components/VideoReplies/styles.js | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/components/FullScreenVideoCollection/index.js b/src/components/FullScreenVideoCollection/index.js index 43127eea..78afcd0a 100644 --- a/src/components/FullScreenVideoCollection/index.js +++ b/src/components/FullScreenVideoCollection/index.js @@ -131,7 +131,6 @@ class FullScreenVideoCollection extends PureComponent{ _keyExtractor = (item, index) => { let keyStr = `id_${item.id}`; - console.log("keyStr", keyStr); return keyStr; }; diff --git a/src/components/VideoReplies/index.js b/src/components/VideoReplies/index.js index 2ce7238a..40446c23 100644 --- a/src/components/VideoReplies/index.js +++ b/src/components/VideoReplies/index.js @@ -92,12 +92,12 @@ class VideoRepliesScreen extends PureComponent { videoUploaderVisible: true }); }; - + hideVideoUploader = ( otherStates, callback ) => { otherStates = otherStates || {}; this.setState({ ...otherStates, - videoUploaderVisible: false + videoUploaderVisible: false }, callback); }; @@ -108,7 +108,7 @@ class VideoRepliesScreen extends PureComponent { this.hideVideoUploader({ addRepliesVisible: false },() => { - this.props.navigation.goBack(); + this.props.navigation.goBack(); }); } } , 10) @@ -227,7 +227,7 @@ class VideoRepliesScreen extends PureComponent { - + Add a reply... diff --git a/src/components/VideoReplies/styles.js b/src/components/VideoReplies/styles.js index e86156f5..8c92c774 100644 --- a/src/components/VideoReplies/styles.js +++ b/src/components/VideoReplies/styles.js @@ -88,10 +88,10 @@ let stylesMap = { color:Colors.black, marginLeft:10 }, - addReplyImageDimension : { + addReplyImageDimensionSkipFont : { height:10, width:15 } }; -export default styles = DefaultStyleGenerator.generate(stylesMap); \ No newline at end of file +export default styles = DefaultStyleGenerator.generate(stylesMap); From e47657899b3fdbcdef879d5644b916ede5cb71df Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Fri, 29 Nov 2019 01:31:52 +0530 Subject: [PATCH 282/302] UI for thread of bubble's list --- .../ReplyThumbnailItem.js | 60 ++++++++++--------- .../InvertedReplyThumbnailList/index.js | 33 +++++++++- src/constants/AppConfig.js | 10 +++- 3 files changed, 69 insertions(+), 34 deletions(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js index fff1d188..4a3675b6 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js @@ -60,45 +60,49 @@ const inlineStyle= { iconStyle: { height: AppConfig.thumbnailListConstants.iconHeight - 8, width: AppConfig.thumbnailListConstants.iconWidth - 8, borderRadius: (AppConfig.thumbnailListConstants.iconWidth - 8)/ 2, - ...Platform.select({ - android: { - marginLeft: -4, - marginTop: -4, - }, - }) - }, - borderStyle: { - borderWidth: 1, - borderColor: '#fff' + marginLeft: -2, + marginTop: -2, + // ...Platform.select({ + // android: { + // marginLeft: -4, + // marginTop: -4, + // }, + // }) }, + // borderStyle: { + // borderWidth: 1, + // borderColor: '#fff' + // }, wrapperStyle: { width: AppConfig.thumbnailListConstants.iconWidth, - height:AppConfig.thumbnailListConstants.iconHeight, + height: AppConfig.thumbnailListConstants.iconHeight, borderRadius: (AppConfig.thumbnailListConstants.iconWidth)/ 2, padding: 4, - shadowColor: 'transparent', - shadowOffset: { width: 0, height: 0 }, - shadowOpacity: 1, - shadowRadius: 4, - overflow: 'hidden', - ...Platform.select({ - android: { - borderWidth: 2, - borderColor: 'transparent', - width: AppConfig.thumbnailListConstants.iconWidth - 4, - height:AppConfig.thumbnailListConstants.iconHeight - 4, - zIndex: 1, - borderRadius: (AppConfig.thumbnailListConstants.iconWidth - 4) / 2 - }, - }) + borderWidth: AppConfig.thumbnailListConstants.borderWidth, + borderColor: 'transparent', + // shadowColor: 'transparent', + // shadowOffset: { width: 0, height: 0 }, + // shadowOpacity: 1, + // shadowRadius: 4, + // overflow: 'hidden', + // ...Platform.select({ + // android: { + // borderWidth: 2, + // borderColor: 'transparent', + // width: AppConfig.thumbnailListConstants.iconWidth - 4, + // height:AppConfig.thumbnailListConstants.iconHeight - 4, + // zIndex: 1, + // borderRadius: (AppConfig.thumbnailListConstants.iconWidth - 4) / 2 + // }, + // }) }, active: { shadowColor: '#fff', - borderColor: '#fff', + borderColor: '#fff' }, unseen: { shadowColor: 'red', - borderColor: 'red', + borderColor: 'red' }, miniSeparator: { position: 'absolute', diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index 69f4e7e9..bd480a12 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -10,7 +10,6 @@ import AppConfig from "../../../constants/AppConfig"; import DataContract from '../../../constants/DataContract'; import ReduxGetters from '../../../services/ReduxGetters'; import { isIphoneX } from 'react-native-iphone-x-helper'; - // const ITEM_HEIGHT = AppConfig.thumbnailListConstants.iconHeight + AppConfig.thumbnailListConstants.iconWidth; @@ -232,8 +231,36 @@ class InvertedReplyList extends PureComponent { this.listRef = ref; }; - getItemSeperatorComponent = () => { - return + getItemSeperatorComponent = ({leadingItem}) => { + let styles = {backgroundColor: 'white', + height: AppConfig.thumbnailListConstants.separatorHeight, + width: 1, + alignSelf:'center' + }; + + // Leading Item + let leadingItemIndex = this.state.list.indexOf(leadingItem); + let isLeadingSelected = this.isActiveEntity( leadingItemIndex , leadingItem); + let isLeadingSeen = ReduxGetters.isReplySeen( deepGet(leadingItem.payload,'reply_detail_id')); + + //Top margin is needed if and only if the leading cell is seen and is not selected. + if ( isLeadingSeen && !isLeadingSelected ) { + //Leading does not have border. + styles.marginTop = AppConfig.thumbnailListConstants.marginTop; + } + + let trailingItemIndex = leadingItemIndex + 1; + let trailingItem = this.state.list[trailingItemIndex]; + let isTrailingSelected = this.isActiveEntity( trailingItemIndex , trailingItem); + let isTrailingSeen = ReduxGetters.isReplySeen( deepGet(trailingItem.payload,'reply_detail_id')); + + //Bottom margin is needed if and only if the trailing cell is seen and is not selected. + if ( isTrailingSeen && !isTrailingSelected ) { + //Trailing cell does not have border. + styles.marginBottom = AppConfig.thumbnailListConstants.marginBottom; + } + + return }; getAvailableHeight = () => { diff --git a/src/constants/AppConfig.js b/src/constants/AppConfig.js index 60309a0e..08b509fd 100644 --- a/src/constants/AppConfig.js +++ b/src/constants/AppConfig.js @@ -340,11 +340,15 @@ export default { thumbnailListConstants: { separatorHeight: 25, // this is height of profile icon + shadow around it. - iconHeight:54, + iconHeight: 48, // this is width of profile icon + shadow around it. - iconWidth: 54, + iconWidth: 48, parentIconHeight: 46, - parentIconWidth: 46 + parentIconWidth: 46, + borderWidth: 2, + // this is Margin to place an icon element on top and bottom of the bordered(both red and white colored) wrapper + marginTop: -4, + marginBottom: -4 }, VideoScreenObject : { ...ifIphoneX( From 574e2b57c97b31f51a7388cc7dc12dfe511fc771 Mon Sep 17 00:00:00 2001 From: rachinkapoor Date: Fri, 29 Nov 2019 01:51:32 +0530 Subject: [PATCH 283/302] Added thumbnailListConstants.cellHeight method --- src/constants/AppConfig.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/constants/AppConfig.js b/src/constants/AppConfig.js index 08b509fd..22c83a52 100644 --- a/src/constants/AppConfig.js +++ b/src/constants/AppConfig.js @@ -348,7 +348,10 @@ export default { borderWidth: 2, // this is Margin to place an icon element on top and bottom of the bordered(both red and white colored) wrapper marginTop: -4, - marginBottom: -4 + marginBottom: -4, + cellHeight: function() { + return this.iconHeight + (2 * this.borderWidth); + } }, VideoScreenObject : { ...ifIphoneX( From 6257e78becbd16f0395133b6e12579dcbbf5bf6d Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Fri, 29 Nov 2019 02:31:41 +0530 Subject: [PATCH 284/302] Code complete --- .../InvertedReplyThumbnailList/index.js | 32 +++++++++++-------- .../FullScreenReplyCollection/index.js | 4 ++- src/services/Utilities.js | 23 ++++++++++--- 3 files changed, 40 insertions(+), 19 deletions(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index 816fdf26..764631ad 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -9,11 +9,12 @@ import ReplyHelper from '../../../helpers/ReplyHelper'; import AppConfig from "../../../constants/AppConfig"; import DataContract from '../../../constants/DataContract'; import ReduxGetters from '../../../services/ReduxGetters'; -import { isIphoneX } from 'react-native-iphone-x-helper'; import deepGet from "lodash/get"; +import Utilities from '../../../services/Utilities'; -// -const ITEM_HEIGHT = AppConfig.thumbnailListConstants.iconHeight + AppConfig.thumbnailListConstants.iconWidth; + +const ITEM_HEIGHT = AppConfig.thumbnailListConstants.iconHeight; +const ITEM_SEPERATOR_HEIGHT = AppConfig.thumbnailListConstants.separatorHeight; class InvertedReplyList extends PureComponent { @@ -268,33 +269,35 @@ class InvertedReplyList extends PureComponent { }; getAvailableHeight = () => { - const area = AppConfig.MaxDescriptionArea; - let height = ( area / Dimensions.get('window').width ) + 20, - //70 is height of top section - availableHeight = AppConfig.VideoScreenObject.height - height - (isIphoneX ? 78 : Platform.OS === 'ios' ? 28 : 80) ; - return this.props.parentIconHeight ? availableHeight - this.props.parentIconHeight : availableHeight; + return Utilities.getPendantAvailableHeight(); } - getListHeight = () => { let availableHeight = this.getAvailableHeight(); let noOfItems = this.state.list.length; if (noOfItems > 0){ let heightOfElements = noOfItems * AppConfig.thumbnailListConstants.iconHeight, heightOfSeparator = (noOfItems - 1 ) * AppConfig.thumbnailListConstants.separatorHeight, - heightOfFlatList = heightOfElements + heightOfSeparator; - return availableHeight > heightOfFlatList ? heightOfFlatList : availableHeight; + heightOfFlatList = heightOfElements + heightOfSeparator , + finalHeight = availableHeight > heightOfFlatList ? heightOfFlatList : availableHeight; + return finalHeight - this.props.bottomRounding; } return 0; }; getItemLayout= (data, index) => { - return {length: ITEM_HEIGHT, offset: ITEM_HEIGHT * index, index} ; + let itemLength = ITEM_SEPERATOR_HEIGHT + ITEM_HEIGHT - 8; + let itemOffset = index * (itemLength); + return { + length: itemLength, + offset: itemOffset, + index: index + }; } render() { console.log("InvertedReplyList :: this.props.listKey", this.props.listKey); - return - + diff --git a/src/services/Utilities.js b/src/services/Utilities.js index 5d2283dc..3d9bc648 100644 --- a/src/services/Utilities.js +++ b/src/services/Utilities.js @@ -1,10 +1,9 @@ import AsyncStorage from '@react-native-community/async-storage'; -import { Alert, Platform, Linking } from 'react-native'; +import { Alert, Platform, Linking , Dimensions } from 'react-native'; import deepGet from 'lodash/get'; import pricer from './Pricer'; import reduxGetters from './ReduxGetters'; -import appConfig from '../constants/AppConfig'; import { FlyerEventEmitter } from '../components/CommonComponents/FlyerHOC'; import { LoginPopoverActions } from '../components/LoginPopover'; @@ -13,6 +12,7 @@ import CameraPermissionsApi from '../services/CameraPermissionsApi'; import { allowAcessModalEventEmitter } from '../components/AllowAccessModalScreen'; import AppConfig from '../constants/AppConfig';; import DataContract from '../constants/DataContract'; +import { isIphoneX } from 'react-native-iphone-x-helper'; let CurrentUser, PepoApi; import('../models/CurrentUser').then((imports) => { @@ -86,7 +86,7 @@ export default { getTokenSymbolImageConfig() { let symbol = pricer.getTokenSymbol(); - return appConfig['tokenSymbols'][symbol]; + return AppConfig['tokenSymbols'][symbol]; }, _getIDList(resultData, key = 'id') { @@ -122,7 +122,7 @@ export default { isUserActivated(status) { status = status || ''; - return status.toLowerCase() == appConfig.userStatusMap.activated; + return status.toLowerCase() == AppConfig.userStatusMap.activated; }, getLastChildRoutename(state) { @@ -216,6 +216,21 @@ export default { return pepocornsName.substring(0, length - 1); } return pepocornsName; + }, + + getPendantAvailableHeight(){ + const area = AppConfig.MaxDescriptionArea; + let height = ( area / Dimensions.get('window').width ) + 20; + //70 is height of top section + return AppConfig.VideoScreenObject.height - height - (isIphoneX ? 78 : Platform.OS === 'ios' ? 28 : 80) ; + } , + + getPendantTop(){ + if( isIphoneX ){ + return 60 + 45; + }else{ + return 30+45; + } } }; From 7590c544ce45e2d9f2e0140750f7afb980444fa5 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Fri, 29 Nov 2019 03:43:35 +0530 Subject: [PATCH 285/302] Minor fix --- .../ReplyThumbnailItem.js | 33 ++----------------- .../InvertedReplyThumbnailList/index.js | 8 ++--- .../FullScreenReplyCollection/index.js | 3 +- 3 files changed, 8 insertions(+), 36 deletions(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js index 4a3675b6..d7c2574a 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js @@ -61,47 +61,20 @@ const inlineStyle= { width: AppConfig.thumbnailListConstants.iconWidth - 8, borderRadius: (AppConfig.thumbnailListConstants.iconWidth - 8)/ 2, marginLeft: -2, - marginTop: -2, - // ...Platform.select({ - // android: { - // marginLeft: -4, - // marginTop: -4, - // }, - // }) + marginTop: -2 }, - // borderStyle: { - // borderWidth: 1, - // borderColor: '#fff' - // }, wrapperStyle: { width: AppConfig.thumbnailListConstants.iconWidth, height: AppConfig.thumbnailListConstants.iconHeight, borderRadius: (AppConfig.thumbnailListConstants.iconWidth)/ 2, padding: 4, borderWidth: AppConfig.thumbnailListConstants.borderWidth, - borderColor: 'transparent', - // shadowColor: 'transparent', - // shadowOffset: { width: 0, height: 0 }, - // shadowOpacity: 1, - // shadowRadius: 4, - // overflow: 'hidden', - // ...Platform.select({ - // android: { - // borderWidth: 2, - // borderColor: 'transparent', - // width: AppConfig.thumbnailListConstants.iconWidth - 4, - // height:AppConfig.thumbnailListConstants.iconHeight - 4, - // zIndex: 1, - // borderRadius: (AppConfig.thumbnailListConstants.iconWidth - 4) / 2 - // }, - // }) + borderColor: 'rgba(255, 255, 255, 0)', }, active: { - shadowColor: '#fff', - borderColor: '#fff' + borderColor: '#fff', }, unseen: { - shadowColor: 'red', borderColor: 'red' }, miniSeparator: { diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index 764631ad..133b49cb 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -13,7 +13,7 @@ import deepGet from "lodash/get"; import Utilities from '../../../services/Utilities'; -const ITEM_HEIGHT = AppConfig.thumbnailListConstants.iconHeight; +const ITEM_HEIGHT = AppConfig.thumbnailListConstants.cellHeight(); const ITEM_SEPERATOR_HEIGHT = AppConfig.thumbnailListConstants.separatorHeight; class InvertedReplyList extends PureComponent { @@ -276,11 +276,11 @@ class InvertedReplyList extends PureComponent { let availableHeight = this.getAvailableHeight(); let noOfItems = this.state.list.length; if (noOfItems > 0){ - let heightOfElements = noOfItems * AppConfig.thumbnailListConstants.iconHeight, + let heightOfElements = noOfItems * ITEM_HEIGHT, heightOfSeparator = (noOfItems - 1 ) * AppConfig.thumbnailListConstants.separatorHeight, heightOfFlatList = heightOfElements + heightOfSeparator , finalHeight = availableHeight > heightOfFlatList ? heightOfFlatList : availableHeight; - return finalHeight - this.props.bottomRounding; + return finalHeight; } return 0; }; @@ -297,7 +297,7 @@ class InvertedReplyList extends PureComponent { render() { console.log("InvertedReplyList :: this.props.listKey", this.props.listKey); - return - + From 3d3392842a89b5fb3688b4342910e8215cd632ab Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Fri, 29 Nov 2019 03:44:22 +0530 Subject: [PATCH 286/302] Minor fix --- .../CommonComponents/InvertedReplyThumbnailList/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index 133b49cb..6de257f8 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -297,7 +297,7 @@ class InvertedReplyList extends PureComponent { render() { console.log("InvertedReplyList :: this.props.listKey", this.props.listKey); - return Date: Fri, 29 Nov 2019 03:54:30 +0530 Subject: [PATCH 287/302] Code complete --- .../CommonComponents/InvertedReplyThumbnailList/index.js | 7 ++++--- src/components/FullScreenReplyCollection/index.js | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index 6de257f8..1ff73595 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -269,7 +269,8 @@ class InvertedReplyList extends PureComponent { }; getAvailableHeight = () => { - return Utilities.getPendantAvailableHeight(); + let availableHeight = Utilities.getPendantAvailableHeight(); + return availableHeight - this.props.bottomRounding; } getListHeight = () => { @@ -297,7 +298,7 @@ class InvertedReplyList extends PureComponent { render() { console.log("InvertedReplyList :: this.props.listKey", this.props.listKey); - return From 8f90e76a972b9a2d58d46fc35226da64ca067448 Mon Sep 17 00:00:00 2001 From: rachinkapoor Date: Fri, 29 Nov 2019 05:04:16 +0530 Subject: [PATCH 288/302] Remove un-used code. --- .../ReplyThumbnailItem.js | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js index d7c2574a..46e8a9b5 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js @@ -25,28 +25,12 @@ class ReplyThumbnailItem extends Component { this.userId = reduxGetters.getReplyEntity(this.replyDetailId).creator_user_id; } - _renderTopMiniSeperator() { - //NOTE: Deliberately treating cellIndex as falsey. - if (!this.props.cellIndex) { - return null; - } - - return - } - _renderBottomMiniSeperator() { - if (this.props.cellIndex == this.props.totalCells - 1) { - return null; - } - return - } render() { return - {/*{this._renderTopMiniSeperator()}*/} { this.props.onClickHandler();})} style={[inlineStyle.wrapperStyle, !this.props.seen && inlineStyle.unseen, this.props.isActive && inlineStyle.active]}> - {/*{this._renderBottomMiniSeperator()}*/} } @@ -76,14 +60,6 @@ const inlineStyle= { }, unseen: { borderColor: 'red' - }, - miniSeparator: { - position: 'absolute', - left: '50%', - width: 1, - marginLeft: -0.5, - backgroundColor: 'white', - height: 4 } }; From 3dab4e07d9c71c4a68f9f9f9dbf8916992c224d0 Mon Sep 17 00:00:00 2001 From: rachinkapoor Date: Fri, 29 Nov 2019 05:30:48 +0530 Subject: [PATCH 289/302] Test Veriosn - Get logic working --- .../ReplyThumbnailItem.js | 28 +++++++++++-------- .../InvertedReplyThumbnailList/index.js | 12 +++++--- src/constants/AppConfig.js | 6 ++-- 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js index 46e8a9b5..22280932 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js @@ -40,20 +40,26 @@ class ReplyThumbnailItem extends Component { } +const outterBorderWidth = AppConfig.thumbnailListConstants.borderWidth; +const outterRingDiameter = AppConfig.thumbnailListConstants.iconHeight; +const transparentGap = AppConfig.thumbnailListConstants.transparentGap; + +const profileImageDiameter = outterRingDiameter - (2 * (outterBorderWidth + transparentGap )); + + const inlineStyle= { - iconStyle: { height: AppConfig.thumbnailListConstants.iconHeight - 8, - width: AppConfig.thumbnailListConstants.iconWidth - 8, - borderRadius: (AppConfig.thumbnailListConstants.iconWidth - 8)/ 2, - marginLeft: -2, - marginTop: -2 + iconStyle: { height: profileImageDiameter, + width: profileImageDiameter, + borderRadius: profileImageDiameter/ 2, + marginLeft: transparentGap, + marginTop: transparentGap }, wrapperStyle: { - width: AppConfig.thumbnailListConstants.iconWidth, - height: AppConfig.thumbnailListConstants.iconHeight, - borderRadius: (AppConfig.thumbnailListConstants.iconWidth)/ 2, - padding: 4, - borderWidth: AppConfig.thumbnailListConstants.borderWidth, - borderColor: 'rgba(255, 255, 255, 0)', + width: outterRingDiameter, + height: outterRingDiameter, + borderRadius: outterRingDiameter/ 2, + borderWidth: outterBorderWidth, + borderColor: 'rgba(255, 255, 0, 1)', }, active: { borderColor: '#fff', diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index 1ff73595..1e5f4bb8 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -237,12 +237,14 @@ class InvertedReplyList extends PureComponent { }; getItemSeperatorComponent = ({leadingItem}) => { - let styles = {backgroundColor: 'white', + let styles = {backgroundColor: 'red', height: AppConfig.thumbnailListConstants.separatorHeight, - width: 1, + width: 20, alignSelf:'center' }; + const separatorMargin = AppConfig.thumbnailListConstants.separatorMargin(); + // Leading Item let leadingItemIndex = this.state.list.indexOf(leadingItem); let isLeadingSelected = this.isActiveEntity( leadingItemIndex , leadingItem); @@ -251,7 +253,8 @@ class InvertedReplyList extends PureComponent { //Top margin is needed if and only if the leading cell is seen and is not selected. if ( isLeadingSeen && !isLeadingSelected ) { //Leading does not have border. - styles.marginTop = AppConfig.thumbnailListConstants.marginTop; + styles.marginTop = -1 * separatorMargin; + styles.height = styles.height + separatorMargin; } let trailingItemIndex = leadingItemIndex + 1; @@ -262,7 +265,8 @@ class InvertedReplyList extends PureComponent { //Bottom margin is needed if and only if the trailing cell is seen and is not selected. if ( isTrailingSeen && !isTrailingSelected ) { //Trailing cell does not have border. - styles.marginBottom = AppConfig.thumbnailListConstants.marginBottom; + styles.marginBottom = -1 * separatorMargin; + styles.height = styles.height + separatorMargin; } return diff --git a/src/constants/AppConfig.js b/src/constants/AppConfig.js index 22c83a52..f1476646 100644 --- a/src/constants/AppConfig.js +++ b/src/constants/AppConfig.js @@ -346,11 +346,13 @@ export default { parentIconHeight: 46, parentIconWidth: 46, borderWidth: 2, + transparentGap: 10, // this is Margin to place an icon element on top and bottom of the bordered(both red and white colored) wrapper - marginTop: -4, - marginBottom: -4, cellHeight: function() { return this.iconHeight + (2 * this.borderWidth); + }, + separatorMargin: function () { + return (this.borderWidth + this.transparentGap); } }, VideoScreenObject : { From 14291a94130a120ab0401158d5fa7d83b345e71e Mon Sep 17 00:00:00 2001 From: rachinkapoor Date: Fri, 29 Nov 2019 05:35:55 +0530 Subject: [PATCH 290/302] The code clean up --- .../InvertedReplyThumbnailList/ReplyThumbnailItem.js | 2 +- .../CommonComponents/InvertedReplyThumbnailList/index.js | 2 +- src/constants/AppConfig.js | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js index 22280932..295270e4 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js @@ -59,7 +59,7 @@ const inlineStyle= { height: outterRingDiameter, borderRadius: outterRingDiameter/ 2, borderWidth: outterBorderWidth, - borderColor: 'rgba(255, 255, 0, 1)', + borderColor: 'transparent', }, active: { borderColor: '#fff', diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index 1e5f4bb8..0d21733c 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -239,7 +239,7 @@ class InvertedReplyList extends PureComponent { getItemSeperatorComponent = ({leadingItem}) => { let styles = {backgroundColor: 'red', height: AppConfig.thumbnailListConstants.separatorHeight, - width: 20, + width: AppConfig.thumbnailListConstants.separatorWidth, alignSelf:'center' }; diff --git a/src/constants/AppConfig.js b/src/constants/AppConfig.js index f1476646..bfeb305a 100644 --- a/src/constants/AppConfig.js +++ b/src/constants/AppConfig.js @@ -339,6 +339,7 @@ export default { MaxDescriptionArea: 35250, thumbnailListConstants: { separatorHeight: 25, + separatorWidth: 1, // this is height of profile icon + shadow around it. iconHeight: 48, // this is width of profile icon + shadow around it. @@ -346,7 +347,8 @@ export default { parentIconHeight: 46, parentIconWidth: 46, borderWidth: 2, - transparentGap: 10, + transparentGap: 2, + // this is Margin to place an icon element on top and bottom of the bordered(both red and white colored) wrapper cellHeight: function() { return this.iconHeight + (2 * this.borderWidth); From cb8de4a837cb1d30e0e84dde60f07f6f9299d947 Mon Sep 17 00:00:00 2001 From: rachinkapoor Date: Fri, 29 Nov 2019 06:46:07 +0530 Subject: [PATCH 291/302] Add comments, rename vars. --- .../ReplyThumbnailItem.js | 24 +++++----- .../InvertedReplyThumbnailList/index.js | 3 +- src/constants/AppConfig.js | 46 +++++++++++++------ 3 files changed, 46 insertions(+), 27 deletions(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js index 295270e4..2dd34286 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js @@ -40,25 +40,23 @@ class ReplyThumbnailItem extends Component { } -const outterBorderWidth = AppConfig.thumbnailListConstants.borderWidth; -const outterRingDiameter = AppConfig.thumbnailListConstants.iconHeight; -const transparentGap = AppConfig.thumbnailListConstants.transparentGap; - -const profileImageDiameter = outterRingDiameter - (2 * (outterBorderWidth + transparentGap )); - +const outerRingDiameter = AppConfig.thumbnailListConstants.outerRingDiameter; +const outerBorderWidth = AppConfig.thumbnailListConstants.outerBorderWidth; +const transparentGap = AppConfig.thumbnailListConstants.transparentGap; +const iconImageDiameter = AppConfig.thumbnailListConstants.iconImageDiameter(); const inlineStyle= { - iconStyle: { height: profileImageDiameter, - width: profileImageDiameter, - borderRadius: profileImageDiameter/ 2, + iconStyle: { height: iconImageDiameter, + width: iconImageDiameter, + borderRadius: iconImageDiameter/ 2, marginLeft: transparentGap, marginTop: transparentGap }, wrapperStyle: { - width: outterRingDiameter, - height: outterRingDiameter, - borderRadius: outterRingDiameter/ 2, - borderWidth: outterBorderWidth, + width: outerRingDiameter, + height: outerRingDiameter, + borderRadius: outerRingDiameter/ 2, + borderWidth: outerBorderWidth, borderColor: 'transparent', }, active: { diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index 0d21733c..2cac846c 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -237,7 +237,8 @@ class InvertedReplyList extends PureComponent { }; getItemSeperatorComponent = ({leadingItem}) => { - let styles = {backgroundColor: 'red', + let styles = { + backgroundColor: AppConfig.thumbnailListConstants.separatorColor, height: AppConfig.thumbnailListConstants.separatorHeight, width: AppConfig.thumbnailListConstants.separatorWidth, alignSelf:'center' diff --git a/src/constants/AppConfig.js b/src/constants/AppConfig.js index bfeb305a..e633a791 100644 --- a/src/constants/AppConfig.js +++ b/src/constants/AppConfig.js @@ -338,24 +338,44 @@ export default { MaxDescriptionArea: 35250, thumbnailListConstants: { - separatorHeight: 25, - separatorWidth: 1, - // this is height of profile icon + shadow around it. - iconHeight: 48, - // this is width of profile icon + shadow around it. - iconWidth: 48, - parentIconHeight: 46, - parentIconWidth: 46, - borderWidth: 2, + + + // NOTE: Outer Circle Configs. + // ----------------------------------------------------------------------- + // 1. outerRingDiameter - Replaces old iconHeight/iconWidth. + // + // 2. borderWidth - The border width is applied outside the + // this iconHeight (Diameter). + // + // 3. transparentGap - Gap between the inner edge of Outer-Circle + // and icon itself. + // + // 4. iconImageDiameter - Diameter of icon Image is computed + // using outerRingDiameter, outerBorderWidth + // and transparentGap. + // ----------------------------------------------------------------------- + outerRingDiameter: 48, + outerBorderWidth: 2, transparentGap: 2, + iconImageDiameter: function () { + return this.outerRingDiameter - (2 * (this.outerBorderWidth + this.transparentGap )); + }, - // this is Margin to place an icon element on top and bottom of the bordered(both red and white colored) wrapper + // cellHeight - Gives actual height of cell. cellHeight: function() { - return this.iconHeight + (2 * this.borderWidth); + return this.outerRingDiameter + (2 * this.outerBorderWidth); }, + + separatorHeight: 25, + separatorWidth: 1, + separatorColor: 'white', + //separatorMargin - Margin to draw over the transparent outer ring (to be applied in negative); separatorMargin: function () { - return (this.borderWidth + this.transparentGap); - } + return this.outerBorderWidth + this.transparentGap; + }, + + parentIconHeight: 46, + parentIconWidth: 46 }, VideoScreenObject : { ...ifIphoneX( From cd5fbd526b28d4ba7bfb0693e952910b214e79e7 Mon Sep 17 00:00:00 2001 From: sachinchauhan Date: Fri, 29 Nov 2019 12:45:01 +0530 Subject: [PATCH 292/302] version code bump up from 19 to 20 --- android/app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index c04dc204..1e055172 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -126,7 +126,7 @@ android { applicationId "com.pepo.staging" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 19 + versionCode 20 versionName "1.0.0" missingDimensionStrategy 'react-native-camera', 'general' } From 94c524ee9ee624e70f5454ae9b79a2f139678033 Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Fri, 29 Nov 2019 14:39:02 +0530 Subject: [PATCH 293/302] border color --- .../InvertedReplyThumbnailList/ReplyThumbnailItem.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js index 2dd34286..2fe336cf 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/ReplyThumbnailItem.js @@ -63,7 +63,7 @@ const inlineStyle= { borderColor: '#fff', }, unseen: { - borderColor: 'red' + borderColor: '#FD8691' } }; From 71b8b3069f310de5d641e8ed2e9c86b813e5694a Mon Sep 17 00:00:00 2001 From: Preshita Shirke Date: Fri, 29 Nov 2019 15:48:32 +0530 Subject: [PATCH 294/302] fix activity issue --- .../FullScreenReplyCollection/BaseVideoReplyRow.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/components/FullScreenReplyCollection/BaseVideoReplyRow.js b/src/components/FullScreenReplyCollection/BaseVideoReplyRow.js index 9ed2f30f..2fa98ff2 100644 --- a/src/components/FullScreenReplyCollection/BaseVideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/BaseVideoReplyRow.js @@ -67,14 +67,13 @@ class BaseVideoReplyRow extends PureComponent { } onParentVideoFetch = (res) => { - const users = deepGet(res , "data.users") || {} , - userKeys = Object.keys(users) || [] , - userId = userKeys[0] || null; - if(userId){ + const video_details = deepGet(res, `data.${DataContract.videos.videoDetailsKey}`), + item = video_details[this.state.parentVideoId]; + if( item ){ this.setState({ - parentUserId: userId - }); - } + parentUserId: item[DataContract.videos.creatorUserIdKey] + }) + } } refetchVideoReply = () => { From 1d7e29a4db219b1291b324b255474e12cc0b52fd Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Fri, 29 Nov 2019 15:55:59 +0530 Subject: [PATCH 295/302] align center for elements --- src/components/FullScreenReplyCollection/BaseVideoReplyRow.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/FullScreenReplyCollection/BaseVideoReplyRow.js b/src/components/FullScreenReplyCollection/BaseVideoReplyRow.js index 2fa98ff2..7a89e03e 100644 --- a/src/components/FullScreenReplyCollection/BaseVideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/BaseVideoReplyRow.js @@ -140,7 +140,7 @@ class BaseVideoReplyRow extends PureComponent { {this._renderInvertedFlatList()} - + Date: Fri, 29 Nov 2019 17:26:49 +0530 Subject: [PATCH 296/302] Minor copy fixes --- .../WalletSetting/WalletSettingController.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/WalletSetting/WalletSettingController.js b/src/components/WalletSetting/WalletSettingController.js index 4dffe4b9..781d50cc 100644 --- a/src/components/WalletSetting/WalletSettingController.js +++ b/src/components/WalletSetting/WalletSettingController.js @@ -44,15 +44,15 @@ class WalletSettingController { } _initializeOptions() { - this._createOptionsData(optionIds.addSession, "Add Session", "Add Session to do transaction"); - this._createOptionsData(optionIds.walletDetails, "Wallet Details", "View your wallet details"); - this._createOptionsData(optionIds.recoverDevice, "Recover Device", "Recover your device"); - this._createOptionsData(optionIds.abortRecovery, "Abort Device Recovery", "Abort Device Recovery"); - this._createOptionsData(optionIds.resetPin, "Reset Pin", "Reset your wallet pin"); + this._createOptionsData(optionIds.addSession, "Add Session", "Add Session to do transaction."); + this._createOptionsData(optionIds.walletDetails, "Wallet Details", "View your wallet details."); + this._createOptionsData(optionIds.recoverDevice, "Recover Device", "Recover your device."); + this._createOptionsData(optionIds.abortRecovery, "Abort Device Recovery", "Abort Device Recovery."); + this._createOptionsData(optionIds.resetPin, "Reset Pin", "Reset your wallet pin."); this._createOptionsData(optionIds.viewMnemonics, "Show Mnemonics", "While not required, writing down your 12 word mnemonic phrase provides an additional backup in case you forget your PIN."); - this._createOptionsData(optionIds.authorizeWithMnemonics, "Authorize Device with Mnemonics", "Authorize current device by using mnemonics"); + this._createOptionsData(optionIds.authorizeWithMnemonics, "Authorize Device with Mnemonics", "Authorize current device by using mnemonics."); this._createOptionsData(optionIds.authorizeWithQR, "Add Another Device", "Scan QR Code to add another device."); - this._createOptionsData(optionIds.showQR, "Show Device QR Code", "Scan QR Code from the device authorized device to authorize this device"); + this._createOptionsData(optionIds.showQR, "Show Device QR Code", "Scan QR Code from the device authorized device to authorize this device."); this._createOptionsData(optionIds.updateBiometricPreference, "Enable Biometric", "Use biometrics to authorize new Sessions and to confirm high value transactions."); } From 8a4a22c2140722283e2f6b22019309e4f5f60d08 Mon Sep 17 00:00:00 2001 From: Mayur Patil Date: Fri, 29 Nov 2019 17:35:06 +0530 Subject: [PATCH 297/302] balance fetch on reply --- src/services/TransactionExecutor.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/services/TransactionExecutor.js b/src/services/TransactionExecutor.js index e28b9da0..c33d5328 100644 --- a/src/services/TransactionExecutor.js +++ b/src/services/TransactionExecutor.js @@ -82,6 +82,7 @@ class TransactionExecutor { } onRequestAcknowledge(ostWorkflowContext, ostWorkflowEntity) { + Pricer.getBalance(); this.sendTransactionToPlatform(ostWorkflowEntity); this.callbacks.onRequestAcknowledge && this.callbacks.onRequestAcknowledge( ostWorkflowContext, ostWorkflowEntity ); } From 720fc27411c903cd31288b660fbadb45e21bfa4c Mon Sep 17 00:00:00 2001 From: rachinkapoor Date: Fri, 29 Nov 2019 18:37:27 +0530 Subject: [PATCH 298/302] Major bug fix --- .../FullScreenReplyCollection/index.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/components/FullScreenReplyCollection/index.js b/src/components/FullScreenReplyCollection/index.js index 16161edb..98563d5e 100644 --- a/src/components/FullScreenReplyCollection/index.js +++ b/src/components/FullScreenReplyCollection/index.js @@ -54,7 +54,9 @@ class FullScreenReplyCollection extends PureComponent{ } setVideoPagination(){ - this.fullPagePagination = new Pagination( this.getBaseUrl(), null , this.getPassedFetchServices()); + let fetchService = this.getPassedFetchServices(); + fetchService = fetchService.cloneWithData(); + this.fullPagePagination = new Pagination( this.getBaseUrl(), null , fetchService); } getVideoPagination(){ @@ -175,7 +177,6 @@ class FullScreenReplyCollection extends PureComponent{ onChildClickDelegate={this.childClickHandler} parentClickHandler={this.parentClickHandler} currentIndex={this.state.activeIndex} - // conditional delegate /> ; } @@ -185,21 +186,25 @@ class FullScreenReplyCollection extends PureComponent{ } scrollToIndex = ( index )=>{ - this.flatlistRef.scrollToIndex({index: index}); - this.setActiveIndex( index ); + this.setActiveIndex( index, () => { + this.flatlistRef.scrollToIndex({index: index}); + }); } onViewableItemsChanged = (data) => { let item = deepGet(data, 'viewableItems[0].item'); item && ReplyHelper.updateEntitySeen( item ); - this.currentIndex = deepGet(data, 'viewableItems[0].index') || 0; + let currentIndex = deepGet(data, 'viewableItems[0].index'); + if ( "number" === typeof currentIndex ) { + this.currentIndex = currentIndex; + } } - setActiveIndex( index ) { + setActiveIndex( index, callback ) { if( typeof index === "number"){ this.currentIndex = index; } - this.setState({ activeIndex: this.currentIndex }); + this.setState({ activeIndex: this.currentIndex }, callback); } onMomentumScrollEndCallback = () => { From 022729626c54730f1212065f330c0e0b4d42dd46 Mon Sep 17 00:00:00 2001 From: thahir-reddy Date: Fri, 29 Nov 2019 19:04:37 +0530 Subject: [PATCH 299/302] adding border botton for slidingup panel header --- src/components/VideoReplies/styles.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/VideoReplies/styles.js b/src/components/VideoReplies/styles.js index 8c92c774..1fd35680 100644 --- a/src/components/VideoReplies/styles.js +++ b/src/components/VideoReplies/styles.js @@ -20,7 +20,9 @@ let stylesMap = { backgroundColor: Colors.white, flexDirection: 'row', zIndex: 9, - width: '100%' + width: '100%', + borderBottomWidth: 0.4, + borderColor: 'rgba(0, 0, 0, 0.3)' }, iconWrapper: { flex: 1, From 10a5052560087e217de8bd9c328a75b4ef9ed614 Mon Sep 17 00:00:00 2001 From: Akshay Raje Date: Fri, 29 Nov 2019 19:24:17 +0530 Subject: [PATCH 300/302] Remove -8 from getItemLayout --- .../InvertedReplyThumbnailList/index.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js index 2cac846c..0abbfeee 100644 --- a/src/components/CommonComponents/InvertedReplyThumbnailList/index.js +++ b/src/components/CommonComponents/InvertedReplyThumbnailList/index.js @@ -1,6 +1,7 @@ import React, { PureComponent } from 'react'; -import { Text, View, ScrollView, ListView, Dimensions, Platform} from 'react-native'; +import { View } from 'react-native'; import { withNavigation } from 'react-navigation'; +import deepGet from "lodash/get"; import Pagination from "../../../services/Pagination"; import ReplyThumbnailItem from './ReplyThumbnailItem' @@ -9,7 +10,6 @@ import ReplyHelper from '../../../helpers/ReplyHelper'; import AppConfig from "../../../constants/AppConfig"; import DataContract from '../../../constants/DataContract'; import ReduxGetters from '../../../services/ReduxGetters'; -import deepGet from "lodash/get"; import Utilities from '../../../services/Utilities'; @@ -64,7 +64,7 @@ class InvertedReplyList extends PureComponent { getParentClickHandler =( videoId )=>{ return () => { - parentUserId = ReduxGetters.getVideoCreatorUserId(videoId); + let parentUserId = ReduxGetters.getVideoCreatorUserId(videoId); this.props.navigation.push('VideoPlayer', { userId: parentUserId, videoId: videoId, @@ -74,7 +74,7 @@ class InvertedReplyList extends PureComponent { } defaultChildClickHandler = ( index, item )=> { - const videoId = ReduxGetters.getReplyParentVideoId(deepGet(item , "payload.reply_detail_id")); + const videoId = ReduxGetters.getReplyParentVideoId(deepGet(item , "payload.reply_detail_id")), baseUrl = DataContract.replies.getReplyListApi(videoId), clonedInstance = this.getPagination().fetchServices.cloneInstance(); ReplyHelper.updateEntitySeen( item ); @@ -292,11 +292,11 @@ class InvertedReplyList extends PureComponent { }; getItemLayout= (data, index) => { - let itemLength = ITEM_SEPERATOR_HEIGHT + ITEM_HEIGHT - 8; + let itemLength = ITEM_SEPERATOR_HEIGHT + ITEM_HEIGHT; let itemOffset = index * (itemLength); return { - length: itemLength, - offset: itemOffset, + length: itemLength, + offset: itemOffset, index: index }; } From 8f0d6e6161cf7c1873389476a95701baf9705151 Mon Sep 17 00:00:00 2001 From: Ashutosh Date: Fri, 29 Nov 2019 19:55:36 +0530 Subject: [PATCH 301/302] Minor fix --- .../FullScreenReplyCollection/BaseVideoReplyRow.js | 11 +++-------- src/components/FullScreenVideoCollection/index.js | 5 ++++- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/components/FullScreenReplyCollection/BaseVideoReplyRow.js b/src/components/FullScreenReplyCollection/BaseVideoReplyRow.js index 7a89e03e..13f31018 100644 --- a/src/components/FullScreenReplyCollection/BaseVideoReplyRow.js +++ b/src/components/FullScreenReplyCollection/BaseVideoReplyRow.js @@ -1,5 +1,5 @@ import React, { PureComponent } from 'react'; -import { View , Dimensions, TouchableOpacity} from 'react-native'; +import { View, TouchableOpacity} from 'react-native'; import FanVideo from "../VideoWrapper/FanVideo"; import ReportVideo from "../CommonComponents/ReportVideo"; import BottomReplyBar from "../CommonComponents/BottomReplyBar"; @@ -21,11 +21,6 @@ import InvertedReplyList from "../CommonComponents/InvertedReplyThumbnailList"; import AppConfig from "../../constants/AppConfig"; import ProfilePicture from "../ProfilePicture"; import multipleClickHandler from '../../services/MultipleClickHandler'; - - -const marginTopForParentIcon = 15; -const AREA = AppConfig.MaxDescriptionArea; -const height = AREA / Dimensions.get('window').width + 20; import { fetchVideo } from '../../helpers/helpers'; import ReplyShareIcon from '../CommonComponents/ShareIcon/ReplyShare'; @@ -34,7 +29,7 @@ class BaseVideoReplyRow extends PureComponent { super(props); this.state = { parentVideoId : ReduxGetters.getReplyParentVideoId( props.replyDetailId ), - parentUserId : ReduxGetters.getReplyParentUserId( props.replyDetailId ) + parentUserId : ReduxGetters.getReplyParentUserId( props.replyDetailId ) } this.onParentClickDelegate = this.props.parentClickHandler || this.defaultParentClickHandler; } @@ -99,7 +94,7 @@ class BaseVideoReplyRow extends PureComponent { } _renderInvertedFlatList = () => { - if( this.state.parentVideoId ){ + if( this.state.parentVideoId && this.props.isActive ){ return ( { - this.currentIndex = deepGet(data, 'viewableItems[0].index') || 0; + const currentIndex = deepGet(data, 'viewableItems[0].index'); + if("number" === typeof currentIndex ){ + this.currentIndex = currentIndex; + } } setActiveIndex() { From 089942b96c83c4a039d6a413e01b76c7b63e0cc5 Mon Sep 17 00:00:00 2001 From: Akshay Raje Date: Fri, 29 Nov 2019 20:24:21 +0530 Subject: [PATCH 302/302] Version bump-up --- ios/Pepo2/InfoPlist/com.pepo.staging-Info.plist | 2 +- ios/Pepo2/InfoPlist/com.pepo.v2.production-Info.plist | 2 +- ios/Pepo2/InfoPlist/com.pepo.v2.sandbox-Info.plist | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ios/Pepo2/InfoPlist/com.pepo.staging-Info.plist b/ios/Pepo2/InfoPlist/com.pepo.staging-Info.plist index e0f6f95d..37629cd6 100644 --- a/ios/Pepo2/InfoPlist/com.pepo.staging-Info.plist +++ b/ios/Pepo2/InfoPlist/com.pepo.staging-Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.9.7 + 1.0.0 CFBundleSignature ???? CFBundleURLTypes diff --git a/ios/Pepo2/InfoPlist/com.pepo.v2.production-Info.plist b/ios/Pepo2/InfoPlist/com.pepo.v2.production-Info.plist index 1b3349e1..7c27f3fa 100644 --- a/ios/Pepo2/InfoPlist/com.pepo.v2.production-Info.plist +++ b/ios/Pepo2/InfoPlist/com.pepo.v2.production-Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.9.7 + 1.0.0 CFBundleSignature ???? CFBundleURLTypes diff --git a/ios/Pepo2/InfoPlist/com.pepo.v2.sandbox-Info.plist b/ios/Pepo2/InfoPlist/com.pepo.v2.sandbox-Info.plist index daf3861c..7d1e6a53 100644 --- a/ios/Pepo2/InfoPlist/com.pepo.v2.sandbox-Info.plist +++ b/ios/Pepo2/InfoPlist/com.pepo.v2.sandbox-Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.9.7 + 1.0.0 CFBundleSignature ???? CFBundleURLTypes