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