Add sharing for pictures.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import { View, TouchableHighlight, Image, StyleSheet, FlatList } from 'react-native';
|
import { View, TouchableHighlight, Image, StyleSheet, FlatList, TouchableWithoutFeedback, Share } from 'react-native';
|
||||||
import { Button, Text, ProgressBar } from 'react-native-paper';
|
import { Button, Text, ProgressBar } from 'react-native-paper';
|
||||||
import API from './../API.js';
|
import API from './../API.js';
|
||||||
import VideoPlayer from './VideoPlayer.js';
|
import VideoPlayer from './VideoPlayer.js';
|
||||||
@@ -120,7 +120,16 @@ let Media = (props) => {
|
|||||||
source={{ uri: "https://www.youtube.com/embed/" + youtubeId + "?fs=0" }}
|
source={{ uri: "https://www.youtube.com/embed/" + youtubeId + "?fs=0" }}
|
||||||
/> : <></>;
|
/> : <></>;
|
||||||
const renderImages = (({ item }) => {
|
const renderImages = (({ item }) => {
|
||||||
return (<Image source={{ uri: item[1] }} style={styles.flatlistImages} />);
|
return (
|
||||||
|
<TouchableWithoutFeedback style={styles.flatlistImages} onLongPress={()=>{
|
||||||
|
Share.share({
|
||||||
|
//message: image[1],
|
||||||
|
url: item[1],
|
||||||
|
});
|
||||||
|
}}>
|
||||||
|
<Image source={{ uri: item[1] }} style={styles.flatlistImages}/>
|
||||||
|
</TouchableWithoutFeedback>
|
||||||
|
);
|
||||||
});
|
});
|
||||||
let progress = <></>;
|
let progress = <></>;
|
||||||
if(viewer.data && viewer.data[props.postId]) {
|
if(viewer.data && viewer.data[props.postId]) {
|
||||||
@@ -148,7 +157,14 @@ let Media = (props) => {
|
|||||||
imagesTag.map((image, i) => {
|
imagesTag.map((image, i) => {
|
||||||
return (
|
return (
|
||||||
//<Text key={i}>{post.content}</Text>
|
//<Text key={i}>{post.content}</Text>
|
||||||
<Image source={{ uri: image[1] }} key={image[1]} style={imageStyle} />
|
<TouchableWithoutFeedback onLongPress={()=>{
|
||||||
|
Share.share({
|
||||||
|
//message: image[1],
|
||||||
|
url: image[1],
|
||||||
|
});
|
||||||
|
}}>
|
||||||
|
<Image source={{ uri: image[1] }} key={image[1]} style={imageStyle} />
|
||||||
|
</TouchableWithoutFeedback>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ let Post = (props) => {
|
|||||||
} else {
|
} else {
|
||||||
changeBookmarked(false);
|
changeBookmarked(false);
|
||||||
post.bookmarks = post.bookmarks.filter(id => id != viewer._id);
|
post.bookmarks = post.bookmarks.filter(id => id != viewer._id);
|
||||||
API.removePostReaction(post._id)
|
API.removePostBookmark(post._id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const renderComment = ({ item }) => (
|
const renderComment = ({ item }) => (
|
||||||
|
|||||||
Reference in New Issue
Block a user