import React, { useEffect, useState } from 'react'; import { IconButton } from 'react-native-paper'; import { View, StyleSheet } from 'react-native'; import GlobalState from '../contexts/GlobalState.js'; import { useSnapshot } from 'valtio'; import VideoPlayer from './VideoPlayer'; const MediaView = (props) => { const gState = useSnapshot(GlobalState); const currentMedia = gState.currentMedia; const mediaPost = gState.mediaPost; const [state, setState] = useState(''); const currentStyles = state === "min" ? styles.min : styles.float; //console.log(mediaPost) return ( <> {currentMedia ? <> { GlobalState.currentMedia = ''; GlobalState.mediaPost = {}; }}> { setState(state=="min" ? "" : 'min') }}> : <> } ) } export default MediaView; const styles = StyleSheet.create({ float: { height: 178, width: 320, position: "absolute", bottom: 80, right: 10, backgroundColor: "#fff", borderRadius: 30, shadowColor: "#000", shadowOffset: { width: 0, height: 2, }, shadowOpacity: 0.25, shadowRadius: 3.84, elevation: 20, zIndex: 1, overflow: "hidden", paddingTop: -10, }, min: { height: 0, width: 0, position: "absolute", bottom: 80, right: 10, backgroundColor: "#fff", borderRadius: 30, shadowColor: "#000", shadowOffset: { width: 0, height: 2, }, shadowOpacity: 0.25, shadowRadius: 3.84, elevation: 20, zIndex: 1, overflow: "hidden", paddingTop: -10, } });