From 4966b2152eb213bac34cbcb0ff01c246b7746f5c Mon Sep 17 00:00:00 2001
From: Paul Frazee <pfrazee@gmail.com>
Date: Wed, 14 Dec 2022 15:35:15 -0600
Subject: Add post embeds (images and external links)

---
 src/view/com/lightbox/Image.tsx | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 src/view/com/lightbox/Image.tsx

(limited to 'src/view/com/lightbox/Image.tsx')

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,
+  },
+})
-- 
cgit 1.4.1

