Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix back button display #477

Merged
merged 1 commit into from
Aug 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/screens/userProfile/PublicProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ const PublicProfileScreen: React.FC<PublicProfileScreenProps> = ({ route, naviga
const { userInfo, setUserInfo } = userContext!;
const isCurrentUser = uid === auth.currentUser?.uid;
const routes = useNavigationState(state => state.routes);
const isInMemberDirectoryStack = routes.some(route => route.name === 'Home');

const isInProfileStack = routes.some(route => route.name === 'PublicProfile') && routes.length === 1;

const fixDarkMode = userInfo?.private?.privateInfo?.settings?.darkMode;
const useSystemDefault = userInfo?.private?.privateInfo?.settings?.useSystemDefault;
Expand Down Expand Up @@ -141,7 +140,7 @@ const PublicProfileScreen: React.FC<PublicProfileScreenProps> = ({ route, naviga
<SafeAreaView edges={['top']}>
{/* Back and Edit Button */}
<View>
{(isInMemberDirectoryStack) &&
{(!isInProfileStack) &&
<TouchableOpacity
onPress={() => navigation.goBack()}
className="mx-4 w-10 h-10 items-center justify-center rounded-full"
Expand All @@ -150,7 +149,7 @@ const PublicProfileScreen: React.FC<PublicProfileScreenProps> = ({ route, naviga
<Octicons name="chevron-left" size={30} color="white" />
</TouchableOpacity>
}
{(isCurrentUser && !isInMemberDirectoryStack) &&
{(isInProfileStack) &&
<View className='flex-row justify-end'>
<TouchableOpacity
onPress={() => navigation.navigate("ProfileSettingsScreen")}
Expand Down Expand Up @@ -209,9 +208,10 @@ const PublicProfileScreen: React.FC<PublicProfileScreenProps> = ({ route, naviga
}
</View>
{/* MemberSHPE Button */}
{(isVerified && isCurrentUser && !isInMemberDirectoryStack) &&
{(isVerified) &&
<TouchableOpacity
onPress={() => navigation.navigate("MemberSHPE")}
disabled={!isCurrentUser}
className="m-3 rounded-full absolute bottom-0 left-0 items-center justify-center"
style={{ backgroundColor: 'rgba(0,0,0,0.3)' }}
>
Expand Down
Loading