Improve lightbox... and update to React Native 0.71.0 (#49)

* Switch to a better lightbox implementation (close #42)

* Upgrade to react-native 0.71.0

* Update (or remove low-value) tests
This commit is contained in:
Paul Frazee 2023-01-17 20:40:02 -06:00 committed by GitHub
parent 61682d5846
commit 065d7ef629
42 changed files with 2000 additions and 3088 deletions

View file

@ -1,6 +1,11 @@
import React from 'react'
import {observer} from 'mobx-react-lite'
import {StyleSheet, TouchableOpacity, View} from 'react-native'
import {
StyleSheet,
TouchableOpacity,
TouchableWithoutFeedback,
View,
} from 'react-native'
import LinearGradient from 'react-native-linear-gradient'
import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
import {ProfileViewModel} from '../../../state/models/profile-view'
@ -33,7 +38,9 @@ export const ProfileHeader = observer(function ProfileHeader({
const store = useStores()
const onPressAvi = () => {
store.shell.openLightbox(new ProfileImageLightbox(view))
if (view.avatar) {
store.shell.openLightbox(new ProfileImageLightbox(view))
}
}
const onPressToggleFollow = () => {
view?.toggleFollowing().then(
@ -254,17 +261,19 @@ export const ProfileHeader = observer(function ProfileHeader({
</View>
) : undefined}
</View>
<TouchableOpacity
<TouchableWithoutFeedback
testID="profileHeaderAviButton"
style={[pal.view, {borderColor: pal.colors.background}, styles.avi]}
onPress={onPressAvi}>
<UserAvatar
size={80}
handle={view.handle}
displayName={view.displayName}
avatar={view.avatar}
/>
</TouchableOpacity>
<View
style={[pal.view, {borderColor: pal.colors.background}, styles.avi]}>
<UserAvatar
size={80}
handle={view.handle}
displayName={view.displayName}
avatar={view.avatar}
/>
</View>
</TouchableWithoutFeedback>
</View>
)
})