From 60c72087ff0bc13453d2a1602b92b41baf1c2a6a Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Tue, 15 Nov 2022 13:11:01 -0600 Subject: [PATCH] Add current user profile to header and enlarge the header --- src/view/com/profile/ProfileHeader.tsx | 24 ++++++++++++++++- src/view/com/util/ViewHeader.tsx | 37 +++++++++++++++++--------- src/view/screens/Profile.tsx | 1 + 3 files changed, 49 insertions(+), 13 deletions(-) diff --git a/src/view/com/profile/ProfileHeader.tsx b/src/view/com/profile/ProfileHeader.tsx index 73ddddde..7292deda 100644 --- a/src/view/com/profile/ProfileHeader.tsx +++ b/src/view/com/profile/ProfileHeader.tsx @@ -42,6 +42,11 @@ export const ProfileHeader = observer(function ProfileHeader({ const onPressBack = () => { store.nav.tab.goBack() } + const onPressMyAvatar = () => { + if (store.me.handle) { + store.nav.navigate(`/profile/${store.me.handle}`) + } + } const onPressToggleFollow = () => { view?.toggleFollowing().then( () => { @@ -143,12 +148,21 @@ export const ProfileHeader = observer(function ProfileHeader({ {store.nav.tab.canGoBack ? ( ) : undefined} + {store.me.did ? ( + + + + ) : undefined} { store.nav.tab.goBack() } + const onPressAvatar = () => { + if (store.me.handle) { + store.nav.navigate(`/profile/${store.me.handle}`) + } + } return ( {store.nav.tab.canGoBack ? ( - - + + ) : ( @@ -36,7 +38,17 @@ export function ViewHeader({ ) : undefined} - + {store.me.did ? ( + + + + ) : ( + + )} ) } @@ -47,7 +59,8 @@ const styles = StyleSheet.create({ alignItems: 'center', backgroundColor: colors.white, paddingHorizontal: 12, - paddingBottom: 6, + paddingTop: 2, + paddingBottom: 8, borderBottomColor: colors.gray1, borderBottomWidth: 1, }, @@ -70,8 +83,8 @@ const styles = StyleSheet.create({ }, cornerPlaceholder: { - width: 14, - height: 14, + width: 24, + height: 24, }, - backIcon: {width: 14, height: 14}, + backIcon: {width: 24, height: 24}, }) diff --git a/src/view/screens/Profile.tsx b/src/view/screens/Profile.tsx index d3088a4b..aed482bf 100644 --- a/src/view/screens/Profile.tsx +++ b/src/view/screens/Profile.tsx @@ -115,6 +115,7 @@ export const Profile = observer(({visible, params}: ScreenParams) => { renderItem = (item: any) => (