about summary refs log tree commit diff
path: root/src/view/com/util/images/Gallery.tsx
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-06-27 09:52:49 -0500
committerGitHub <noreply@github.com>2023-06-27 09:52:49 -0500
commitbfaa6d73f37f251259c521befa9e9ee8ea877560 (patch)
tree8396bbed4ecd8d989c71658aed568ce78be863ad /src/view/com/util/images/Gallery.tsx
parent25b3e14926d2d565b37c3ff715897ca7c513a0d2 (diff)
downloadvoidsky-bfaa6d73f37f251259c521befa9e9ee8ea877560.tar.zst
Improvements to the alt text behaviors in the composer (#910)
* Add an image preview in the alt modal

* Composer: add info about alt text and a green checkmark when done

* Shrink the alt visual indicator a bit so it doesnt obscure the image

* Fix typo

* Fix: avoid requiring multiple tabs to save alt text

* update react-native-screens

* Improve the alt text help tip

* Remove redundant hints

---------

Co-authored-by: Ansh Nanda <anshnanda10@gmail.com>
Diffstat (limited to 'src/view/com/util/images/Gallery.tsx')
-rw-r--r--src/view/com/util/images/Gallery.tsx19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/view/com/util/images/Gallery.tsx b/src/view/com/util/images/Gallery.tsx
index 723db289c..a7a64b171 100644
--- a/src/view/com/util/images/Gallery.tsx
+++ b/src/view/com/util/images/Gallery.tsx
@@ -45,23 +45,28 @@ export const GalleryItem: FC<GalleryItemProps> = ({
           accessibilityIgnoresInvertColors
         />
       </TouchableOpacity>
-      {image.alt === '' ? null : <Text style={styles.alt}>ALT</Text>}
+      {image.alt === '' ? null : (
+        <View style={styles.altContainer}>
+          <Text style={styles.alt}>ALT</Text>
+        </View>
+      )}
     </View>
   )
 }
 
 const styles = StyleSheet.create({
-  alt: {
+  altContainer: {
     backgroundColor: 'rgba(0, 0, 0, 0.75)',
     borderRadius: 6,
-    color: 'white',
-    fontSize: 12,
-    fontWeight: 'bold',
-    letterSpacing: 1,
-    paddingHorizontal: 10,
+    paddingHorizontal: 6,
     paddingVertical: 3,
     position: 'absolute',
     left: 6,
     bottom: 6,
   },
+  alt: {
+    color: 'white',
+    fontSize: 10,
+    fontWeight: 'bold',
+  },
 })