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>
This commit is contained in:
Paul Frazee 2023-06-27 09:52:49 -05:00 committed by GitHub
parent 25b3e14926
commit bfaa6d73f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 274 additions and 185 deletions

View file

@ -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',
},
})