Add slideshow

This commit is contained in:
Adolfo Reyna
2023-05-06 22:58:16 -04:00
parent 022fd75fa5
commit 0b57db225d
5 changed files with 1023 additions and 10766 deletions

View File

@@ -8,6 +8,7 @@ import { WebView } from 'react-native-webview';
import { useSnapshot } from 'valtio';
import GlobalState from '../contexts/GlobalState.js';
import Moment from 'moment';
import { useNavigation } from '@react-navigation/native';
const videoIdF = (content) => {
let vimeoTag = content.match(/@vimeo:[0-9]+/);
@@ -67,6 +68,7 @@ let Media = (props) => {
const [videosFiles, setVideosFiles] = useState([]);
const [poster, setPoster] = useState('');
const [loaded, setLoaded] = useState(false);
const navigation = useNavigation();
useEffect(() => {
let subscribed = true;
let getData = async () => {
@@ -119,9 +121,14 @@ let Media = (props) => {
style={styles.iframe}
source={{ uri: "https://www.youtube.com/embed/" + youtubeId + "?fs=0" }}
/> : <></>;
const renderImages = (({ item }) => {
const renderImages = (({ item, index }) => {
return (
<TouchableWithoutFeedback style={styles.flatlistImages} onLongPress={()=>{
<TouchableWithoutFeedback style={styles.flatlistImages}
onPress={()=>{
//alert("hello");
navigation.navigate('Slideshow', { images: imagesTag, startIndex: index});
}}
onLongPress={()=>{
Share.share({
//message: image[1],
url: item[1],
@@ -157,7 +164,11 @@ let Media = (props) => {
imagesTag.map((image, i) => {
return (
//<Text key={i}>{post.content}</Text>
<TouchableWithoutFeedback onLongPress={()=>{
<TouchableWithoutFeedback
onPress={()=>{
navigation.navigate('Slideshow', { images: imagesTag, startIndex: i });
}}
onLongPress={()=>{
Share.share({
//message: image[1],
url: image[1],