Add basic swipe functionality through videos
Still need to work on: 1. Progress meter 2. Pause on tap 3. App icon 4. Dark/light mode detection 5. Height not being centered 6. Slide numbers on the bottom color
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import {Dimensions, View} from 'react-native';
|
||||
import {DocumentPickerResponse} from 'react-native-document-picker';
|
||||
import Video from 'react-native-video';
|
||||
import {backgroundColor} from './constants';
|
||||
|
||||
export default function Item({
|
||||
slide,
|
||||
value,
|
||||
index,
|
||||
}: {
|
||||
slide: number;
|
||||
value: DocumentPickerResponse;
|
||||
index: number;
|
||||
}) {
|
||||
const height = Dimensions.get('screen').height;
|
||||
|
||||
return (
|
||||
<View
|
||||
style={{
|
||||
height: '100%',
|
||||
width: '100%',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
backgroundColor,
|
||||
}}>
|
||||
<Video
|
||||
key={value.name}
|
||||
paused={slide !== index}
|
||||
style={{width: 200, height: height / 2}}
|
||||
source={{uri: value.uri}}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user