Fix : Menu shouldn't be displayed on logged out pages (#11437)
#11414 Conditionally render MobileNavigationBar based on user authentication status - Added useIsLogged hook to check if the user is authenticated. - Updated MobileNavigationBar component to render only when the user is logged in.  --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -21,7 +21,7 @@
|
||||
|
||||
"moduleFolderRule": {
|
||||
"name": "{kebab-case}",
|
||||
"folderRecursionLimit": 6,
|
||||
"folderRecursionLimit": 4,
|
||||
"children": [
|
||||
{ "ruleId": "moduleFolderRule" },
|
||||
{ "name": "hooks", "ruleId": "hooksLeafFolderRule" },
|
||||
|
||||
@ -4,8 +4,6 @@ import { isCommandMenuOpenedState } from '@/command-menu/states/isCommandMenuOpe
|
||||
import { useOpenSettingsMenu } from '@/navigation/hooks/useOpenSettings';
|
||||
import { isNavigationDrawerExpandedState } from '@/ui/navigation/states/isNavigationDrawerExpanded';
|
||||
import { useRecoilState } from 'recoil';
|
||||
import { useIsSettingsPage } from '../hooks/useIsSettingsPage';
|
||||
import { currentMobileNavigationDrawerState } from '../states/currentMobileNavigationDrawerState';
|
||||
import {
|
||||
IconComponent,
|
||||
IconList,
|
||||
@ -13,6 +11,8 @@ import {
|
||||
IconSettings,
|
||||
} from 'twenty-ui/display';
|
||||
import { NavigationBar } from 'twenty-ui/navigation';
|
||||
import { useIsSettingsPage } from '../hooks/useIsSettingsPage';
|
||||
import { currentMobileNavigationDrawerState } from '../states/currentMobileNavigationDrawerState';
|
||||
|
||||
type NavigationBarItemName = 'main' | 'search' | 'tasks' | 'settings';
|
||||
|
||||
@ -25,7 +25,6 @@ export const MobileNavigationBar = () => {
|
||||
useRecoilState(isNavigationDrawerExpandedState);
|
||||
const [currentMobileNavigationDrawer, setCurrentMobileNavigationDrawer] =
|
||||
useRecoilState(currentMobileNavigationDrawerState);
|
||||
|
||||
const { openSettingsMenu } = useOpenSettingsMenu();
|
||||
|
||||
const activeItemName = isNavigationDrawerExpanded
|
||||
|
||||
@ -122,7 +122,7 @@ export const DefaultLayout = () => {
|
||||
</StyledMainContainer>
|
||||
)}
|
||||
</StyledPageContainer>
|
||||
{isMobile && <MobileNavigationBar />}
|
||||
{isMobile && !showAuthModal && <MobileNavigationBar />}
|
||||
</AppErrorBoundary>
|
||||
</StyledLayout>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user