Merge pull request #7 from lbryio/release-0.8.0
updates for next release
This commit is contained in:
commit
507c8f0394
3 changed files with 28 additions and 8 deletions
|
@ -1,5 +1,5 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Text, TouchableOpacity, View } from 'react-native';
|
import { NativeModules, Text, TouchableOpacity, View } from 'react-native';
|
||||||
import { DEFAULT_FOLLOWED_TAGS } from 'lbry-redux';
|
import { DEFAULT_FOLLOWED_TAGS } from 'lbry-redux';
|
||||||
import Button from 'component/button';
|
import Button from 'component/button';
|
||||||
import Colors from 'styles/colors';
|
import Colors from 'styles/colors';
|
||||||
|
@ -23,6 +23,7 @@ export default class ModalTagSelector extends React.PureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.props.doToggleTagFollow(tag);
|
this.props.doToggleTagFollow(tag);
|
||||||
|
NativeModules.Firebase.track('tag_follow', { tag });
|
||||||
};
|
};
|
||||||
|
|
||||||
handleRemoveTag = tag => {
|
handleRemoveTag = tag => {
|
||||||
|
@ -31,6 +32,7 @@ export default class ModalTagSelector extends React.PureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.props.doToggleTagFollow(tag);
|
this.props.doToggleTagFollow(tag);
|
||||||
|
NativeModules.Firebase.track('tag_unfollow', { tag });
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
|
@ -2,6 +2,7 @@ import React from 'react';
|
||||||
import {
|
import {
|
||||||
ActivityIndicator,
|
ActivityIndicator,
|
||||||
Clipboard,
|
Clipboard,
|
||||||
|
DeviceEventEmitter,
|
||||||
Image,
|
Image,
|
||||||
NativeModules,
|
NativeModules,
|
||||||
Picker,
|
Picker,
|
||||||
|
@ -72,6 +73,7 @@ class PublishPage extends React.PureComponent {
|
||||||
|
|
||||||
// gallery videos
|
// gallery videos
|
||||||
videos: null,
|
videos: null,
|
||||||
|
galleryThumbnailsChecked: false,
|
||||||
|
|
||||||
// camera
|
// camera
|
||||||
cameraType: RNCamera.Constants.Type.back,
|
cameraType: RNCamera.Constants.Type.back,
|
||||||
|
@ -115,14 +117,20 @@ class PublishPage extends React.PureComponent {
|
||||||
componentWillMount() {
|
componentWillMount() {
|
||||||
const { navigation } = this.props;
|
const { navigation } = this.props;
|
||||||
this.didFocusListener = navigation.addListener('didFocus', this.onComponentFocused);
|
this.didFocusListener = navigation.addListener('didFocus', this.onComponentFocused);
|
||||||
|
DeviceEventEmitter.addListener('onGalleryThumbnailsChecked', this.handleGalleryThumbnailsChecked);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
if (this.didFocusListener) {
|
if (this.didFocusListener) {
|
||||||
this.didFocusListener.remove();
|
this.didFocusListener.remove();
|
||||||
}
|
}
|
||||||
|
DeviceEventEmitter.removeListener('onGalleryThumbnailsChecked', this.handleGalleryThumbnailsChecked);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleGalleryThumbnailsChecked = () => {
|
||||||
|
this.setState({ galleryThumbnailsChecked: true });
|
||||||
|
};
|
||||||
|
|
||||||
onComponentFocused = () => {
|
onComponentFocused = () => {
|
||||||
const { pushDrawerStack, setPlayerVisible } = this.props;
|
const { pushDrawerStack, setPlayerVisible } = this.props;
|
||||||
|
|
||||||
|
@ -513,16 +521,14 @@ class PublishPage extends React.PureComponent {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { balance, navigation, notify, publishFormValues } = this.props;
|
const { balance, navigation, notify, publishFormValues } = this.props;
|
||||||
const { thumbnailPath } = this.state;
|
const { canUseCamera, currentPhase, galleryThumbnailsChecked, thumbnailPath, videos } = this.state;
|
||||||
|
|
||||||
let content;
|
let content;
|
||||||
if (Constants.PHASE_SELECTOR === this.state.currentPhase) {
|
if (Constants.PHASE_SELECTOR === currentPhase) {
|
||||||
content = (
|
content = (
|
||||||
<View style={publishStyle.gallerySelector}>
|
<View style={publishStyle.gallerySelector}>
|
||||||
<View style={publishStyle.actionsView}>
|
<View style={publishStyle.actionsView}>
|
||||||
{this.state.canUseCamera && (
|
{canUseCamera && <RNCamera style={publishStyle.cameraPreview} type={RNCamera.Constants.Type.back} />}
|
||||||
<RNCamera style={publishStyle.cameraPreview} type={RNCamera.Constants.Type.back} />
|
|
||||||
)}
|
|
||||||
<View style={publishStyle.actionsSubView}>
|
<View style={publishStyle.actionsSubView}>
|
||||||
<TouchableOpacity style={publishStyle.record} onPress={this.handleRecordVideoPressed}>
|
<TouchableOpacity style={publishStyle.record} onPress={this.handleRecordVideoPressed}>
|
||||||
<Icon name="video" size={48} color={Colors.White} />
|
<Icon name="video" size={48} color={Colors.White} />
|
||||||
|
@ -542,12 +548,19 @@ class PublishPage extends React.PureComponent {
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
{(!this.state.videos || !thumbnailPath) && (
|
{(!videos || !thumbnailPath || !galleryThumbnailsChecked) && (
|
||||||
<View style={publishStyle.loadingView}>
|
<View style={publishStyle.loadingView}>
|
||||||
<ActivityIndicator size="large" color={Colors.LbryGreen} />
|
<ActivityIndicator size="large" color={Colors.LbryGreen} />
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
{this.state.videos && thumbnailPath && (
|
{thumbnailPath && (!videos || videos.length === 0) && (
|
||||||
|
<View style={publishStyle.centered}>
|
||||||
|
<Text style={publishStyle.noVideos}>
|
||||||
|
We could not find any videos on your device. Take a photo or record a video to get started.
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
{videos && thumbnailPath && galleryThumbnailsChecked && (
|
||||||
<FlatGrid
|
<FlatGrid
|
||||||
style={publishStyle.galleryGrid}
|
style={publishStyle.galleryGrid}
|
||||||
itemDimension={134}
|
itemDimension={134}
|
||||||
|
|
|
@ -369,6 +369,11 @@ const publishStyle = StyleSheet.create({
|
||||||
marginLeft: 8,
|
marginLeft: 8,
|
||||||
marginRight: 8,
|
marginRight: 8,
|
||||||
},
|
},
|
||||||
|
noVideos: {
|
||||||
|
color: Colors.White,
|
||||||
|
fontFamily: 'Inter-UI-Regular',
|
||||||
|
fontSize: 16,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export default publishStyle;
|
export default publishStyle;
|
||||||
|
|
Loading…
Reference in a new issue