about summary refs log tree commit diff
path: root/src/view/com/util/post-embeds/index.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/post-embeds/index.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/post-embeds/index.tsx')
-rw-r--r--src/view/com/util/post-embeds/index.tsx19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/view/com/util/post-embeds/index.tsx b/src/view/com/util/post-embeds/index.tsx
index 53ef17318..7f2244b7b 100644
--- a/src/view/com/util/post-embeds/index.tsx
+++ b/src/view/com/util/post-embeds/index.tsx
@@ -126,7 +126,11 @@ export function PostEmbeds({
               onPress={() => openLightbox(0)}
               onPressIn={() => onPressIn(0)}
               style={styles.singleImage}>
-              {alt === '' ? null : <Text style={styles.alt}>ALT</Text>}
+              {alt === '' ? null : (
+                <View style={styles.altContainer}>
+                  <Text style={styles.alt}>ALT</Text>
+                </View>
+              )}
             </AutoSizedImage>
           </View>
         )
@@ -201,17 +205,18 @@ const styles = StyleSheet.create({
     borderRadius: 8,
     marginTop: 4,
   },
-  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',
+  },
 })