Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1dc85cc4c9 | ||
|
|
095bc9ed0a | ||
|
|
894b34fd57 | ||
|
|
ced1056596 | ||
|
|
3978753cdb | ||
|
|
7a141c817e | ||
|
|
ad810d5c9e |
No files matched your search
@@ -79,7 +79,6 @@ class PublishPage extends React.PureComponent {
|
||||
state = {
|
||||
canPublish: false,
|
||||
canUseCamera: false,
|
||||
documentPickerOpen: false,
|
||||
editMode: false,
|
||||
titleFocused: false,
|
||||
descriptionFocused: false,
|
||||
@@ -138,8 +137,6 @@ class PublishPage extends React.PureComponent {
|
||||
// this.didFocusListener = navigation.addListener('didFocus', this.onComponentFocused);
|
||||
DeviceEventEmitter.addListener('onGalleryThumbnailChecked', this.handleGalleryThumbnailChecked);
|
||||
DeviceEventEmitter.addListener('onAllGalleryThumbnailsChecked', this.handleAllGalleryThumbnailsChecked);
|
||||
DeviceEventEmitter.addListener('onDocumentPickerFilePicked', this.onFilePicked);
|
||||
DeviceEventEmitter.addListener('onDocumentPickerCanceled', this.onPickerCanceled);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
@@ -148,8 +145,6 @@ class PublishPage extends React.PureComponent {
|
||||
}
|
||||
DeviceEventEmitter.removeListener('onGalleryThumbnailChecked', this.handleGalleryThumbnailChecked);
|
||||
DeviceEventEmitter.removeListener('onAllGalleryThumbnailsChecked', this.handleAllGalleryThumbnailsChecked);
|
||||
DeviceEventEmitter.removeListener('onDocumentPickerFilePicked', this.onFilePicked);
|
||||
DeviceEventEmitter.removeListener('onDocumentPickerCanceled', this.onPickerCanceled);
|
||||
}
|
||||
|
||||
handleGalleryThumbnailChecked = evt => {
|
||||
@@ -411,7 +406,6 @@ class PublishPage extends React.PureComponent {
|
||||
this.setState(
|
||||
{
|
||||
publishStarted: false,
|
||||
documentPickerOpen: false,
|
||||
editMode: false,
|
||||
|
||||
currentMedia: null,
|
||||
@@ -463,36 +457,6 @@ class PublishPage extends React.PureComponent {
|
||||
}
|
||||
};
|
||||
|
||||
handleUploadPressed = () => {
|
||||
if (this.state.documentPickerOpen) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.setState(
|
||||
{
|
||||
documentPickerOpen: true,
|
||||
},
|
||||
() => {
|
||||
NativeModules.UtilityModule.openDocumentPicker('*/*');
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
onFilePicked = evt => {
|
||||
this.setState({ documentPickerOpen: false }, () => {
|
||||
const currentMedia = {
|
||||
id: -1,
|
||||
filePath: `file://${evt.path}`,
|
||||
duration: 0,
|
||||
};
|
||||
this.setCurrentMedia(currentMedia);
|
||||
});
|
||||
};
|
||||
|
||||
onPickerCanceled = () => {
|
||||
this.setState({ documentPickerOpen: false });
|
||||
};
|
||||
|
||||
handleCloseCameraPressed = () => {
|
||||
this.setState({ showCameraOverlay: false, videoRecordingMode: false });
|
||||
};
|
||||
@@ -761,10 +725,12 @@ class PublishPage extends React.PureComponent {
|
||||
<Icon name="camera" size={48} color={Colors.White} />
|
||||
<Text style={publishStyle.actionText}>Take a photo</Text>
|
||||
</TouchableOpacity>
|
||||
<TouchableOpacity style={publishStyle.upload} onPress={this.handleUploadPressed}>
|
||||
<Icon name="file-upload" size={48} color={Colors.White} />
|
||||
<Text style={publishStyle.actionText}>Upload a file</Text>
|
||||
</TouchableOpacity>
|
||||
{false && (
|
||||
<TouchableOpacity style={publishStyle.upload} onPress={this.handleUploadPressed}>
|
||||
<Icon name="file-upload" size={48} color={Colors.White} />
|
||||
<Text style={publishStyle.actionText}>Upload a file</Text>
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
@@ -86,7 +86,7 @@ const publishStyle = StyleSheet.create({
|
||||
marginTop: 8,
|
||||
},
|
||||
photo: {
|
||||
height: 120,
|
||||
height: 240,
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user