diff options
author | Ansh <anshnanda10@gmail.com> | 2023-04-18 09:19:37 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-18 11:19:37 -0500 |
commit | 10621e86e4379ff05b2262a659b8512d80203a4b (patch) | |
tree | fdc91b7db00526f945d9463b732785da6cceb5c7 /src/view/com/profile/ProfileHeader.tsx | |
parent | 2509290fdd2b20c76c302d4962216f5d2d2b5a73 (diff) | |
download | voidsky-10621e86e4379ff05b2262a659b8512d80203a4b.tar.zst |
APP-70 give profile its own tab mobile (#469)
* add prebuild command to package.json * add ProfileTab navigator and screen * add prop to remove back button from profile * fix MyProfileTabNavigatorParams type * fix dep array for rendering ProfileHeader * just added ts-ignore * enable opening drawer in profile tab * clean up useNavigationTabState * clean up code * fix hideBackButton code flow
Diffstat (limited to 'src/view/com/profile/ProfileHeader.tsx')
-rw-r--r-- | src/view/com/profile/ProfileHeader.tsx | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/view/com/profile/ProfileHeader.tsx b/src/view/com/profile/ProfileHeader.tsx index d520a712f..101b6b833 100644 --- a/src/view/com/profile/ProfileHeader.tsx +++ b/src/view/com/profile/ProfileHeader.tsx @@ -36,8 +36,14 @@ import {FollowState} from 'state/models/cache/my-follows' const BACK_HITSLOP = {left: 30, top: 30, right: 30, bottom: 30} +interface Props { + view: ProfileModel + onRefreshAll: () => void + hideBackButton?: boolean +} + export const ProfileHeader = observer( - ({view, onRefreshAll}: {view: ProfileModel; onRefreshAll: () => void}) => { + ({view, onRefreshAll, hideBackButton = false}: Props) => { const pal = usePalette('default') // loading @@ -80,17 +86,21 @@ export const ProfileHeader = observer( // loaded // = - return <ProfileHeaderLoaded view={view} onRefreshAll={onRefreshAll} /> + return ( + <ProfileHeaderLoaded + view={view} + onRefreshAll={onRefreshAll} + hideBackButton={hideBackButton} + /> + ) }, ) const ProfileHeaderLoaded = observer(function ProfileHeaderLoaded({ view, onRefreshAll, -}: { - view: ProfileModel - onRefreshAll: () => void -}) { + hideBackButton = false, +}: Props) { const pal = usePalette('default') const store = useStores() const navigation = useNavigation<NavigationProp>() @@ -336,7 +346,7 @@ const ProfileHeaderLoaded = observer(function ProfileHeaderLoaded({ </View> ) : undefined} </View> - {!isDesktopWeb && ( + {!isDesktopWeb && !hideBackButton && ( <TouchableWithoutFeedback onPress={onPressBack} hitSlop={BACK_HITSLOP}> <View style={styles.backBtnWrapper}> <BlurView style={styles.backBtn} blurType="dark"> |