diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-01-17 20:40:02 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-17 20:40:02 -0600 |
commit | 065d7ef629c7d991e520fc3dd94cd84b71014902 (patch) | |
tree | 89ed72702a5af85eb8508682edc9f2281d23c2e5 /src/view/com/profile/ProfileHeader.tsx | |
parent | 61682d5846523038d9a28f851d2bd7c16d27a4a9 (diff) | |
download | voidsky-065d7ef629c7d991e520fc3dd94cd84b71014902.tar.zst |
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
Diffstat (limited to 'src/view/com/profile/ProfileHeader.tsx')
-rw-r--r-- | src/view/com/profile/ProfileHeader.tsx | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/src/view/com/profile/ProfileHeader.tsx b/src/view/com/profile/ProfileHeader.tsx index d9151afd0..52a4400a5 100644 --- a/src/view/com/profile/ProfileHeader.tsx +++ b/src/view/com/profile/ProfileHeader.tsx @@ -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> ) }) |