Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[space][web] Hide bottom navigation on secondary pages

Anand Baburajan327997dfc76b
diff --git a/web/apps/space/src/components/AppNavigation.tsx b/web/apps/space/src/components/AppNavigation.tsx
index 747c018ff4..283c6c2917 100644
--- a/web/apps/space/src/components/AppNavigation.tsx
+++ b/web/apps/space/src/components/AppNavigation.tsx
@@ -41,12 +41,27 @@ export const SpaceAppLayout = ({ children }: { children: React.ReactNode }) => {
const isConversation = router.pathname.startsWith(
`${spaceRoutes.messages}/`,
);
- const isFriendPreview =
- router.pathname == spaceRoutes.friends &&
- typeof router.query.friend == "string" &&
- router.query.expanded != "1";
+ const isSettingsPage =
+ router.pathname == spaceRoutes.settings ||
+ router.pathname == spaceRoutes.settingsProfileName ||
+ router.pathname == spaceRoutes.profilePhoto ||
+ router.pathname == spaceRoutes.editProfilePhoto ||
+ router.pathname == spaceRoutes.profileCover ||
+ router.pathname == spaceRoutes.editProfileCover;
+ const isProfilePage =
+ router.pathname == spaceRoutes.profile ||
+ router.pathname == spaceRoutes.friendPage ||
+ (router.pathname == spaceRoutes.friends &&
+ typeof router.query.friend == "string" &&
+ router.query.expanded == "1");
+ const isNotificationsPage = router.pathname == spaceRoutes.notifications;
const showNavigation =
- isAppPage && Boolean(profile) && !isConversation && !isFriendPreview;
+ isAppPage &&
+ Boolean(profile) &&
+ !isConversation &&
+ !isSettingsPage &&
+ !isProfilePage &&
+ !isNotificationsPage;
const spaceID =
isAppPage && profileLoadStatus == "ready"
? profile?.spaceId
@@ -174,6 +189,9 @@ export const SpaceAppLayout = ({ children }: { children: React.ReactNode }) => {
ref={layoutRef}
className={isAppPage ? "space-app-layout" : undefined}
data-space-conversation={isConversation || undefined}
+ data-space-settings={isSettingsPage || undefined}
+ data-space-profile={isProfilePage || undefined}
+ data-space-notifications={isNotificationsPage || undefined}
>
{children}
{showNavigation && (
diff --git a/web/apps/space/src/styles/globals.css b/web/apps/space/src/styles/globals.css
index 240c247c18..2f833d25c4 100644
--- a/web/apps/space/src/styles/globals.css
+++ b/web/apps/space/src/styles/globals.css
@@ -57,7 +57,10 @@ html[data-space-ios-pwa]
padding-bottom: var(--space-bottom-nav-height);
}
-.space-app-layout[data-space-conversation] {
+.space-app-layout[data-space-conversation],
+.space-app-layout[data-space-settings],
+.space-app-layout[data-space-profile],
+.space-app-layout[data-space-notifications] {
--space-bottom-nav-height: 0px;
}