diff options
Diffstat (limited to 'src/view/com/lightbox/Images.tsx')
-rw-r--r-- | src/view/com/lightbox/Images.tsx | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/view/com/lightbox/Images.tsx b/src/view/com/lightbox/Images.tsx new file mode 100644 index 000000000..6f84dfe7c --- /dev/null +++ b/src/view/com/lightbox/Images.tsx @@ -0,0 +1,35 @@ +import React from 'react' +import {Image, StyleSheet, useWindowDimensions, View} from 'react-native' + +export function Component({uris, index}: {uris: string[]; index: number}) { + const winDim = useWindowDimensions() + const left = index * winDim.width * -1 + return ( + <View style={[styles.container, {left}]}> + {uris.map((uri, i) => ( + <Image + key={i} + style={[styles.image, {left: i * winDim.width}]} + source={{uri}} + /> + ))} + </View> + ) +} + +const styles = StyleSheet.create({ + container: { + position: 'absolute', + top: 0, + left: 0, + width: '100%', + }, + image: { + position: 'absolute', + top: 200, + left: 0, + resizeMode: 'contain', + width: '100%', + aspectRatio: 1, + }, +}) |