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": {
|
"moduleFolderRule": {
|
||||||
"name": "{kebab-case}",
|
"name": "{kebab-case}",
|
||||||
"folderRecursionLimit": 6,
|
"folderRecursionLimit": 4,
|
||||||
"children": [
|
"children": [
|
||||||
{ "ruleId": "moduleFolderRule" },
|
{ "ruleId": "moduleFolderRule" },
|
||||||
{ "name": "hooks", "ruleId": "hooksLeafFolderRule" },
|
{ "name": "hooks", "ruleId": "hooksLeafFolderRule" },
|
||||||
|
|||||||
@ -4,8 +4,6 @@ import { isCommandMenuOpenedState } from '@/command-menu/states/isCommandMenuOpe
|
|||||||
import { useOpenSettingsMenu } from '@/navigation/hooks/useOpenSettings';
|
import { useOpenSettingsMenu } from '@/navigation/hooks/useOpenSettings';
|
||||||
import { isNavigationDrawerExpandedState } from '@/ui/navigation/states/isNavigationDrawerExpanded';
|
import { isNavigationDrawerExpandedState } from '@/ui/navigation/states/isNavigationDrawerExpanded';
|
||||||
import { useRecoilState } from 'recoil';
|
import { useRecoilState } from 'recoil';
|
||||||
import { useIsSettingsPage } from '../hooks/useIsSettingsPage';
|
|
||||||
import { currentMobileNavigationDrawerState } from '../states/currentMobileNavigationDrawerState';
|
|
||||||
import {
|
import {
|
||||||
IconComponent,
|
IconComponent,
|
||||||
IconList,
|
IconList,
|
||||||
@ -13,6 +11,8 @@ import {
|
|||||||
IconSettings,
|
IconSettings,
|
||||||
} from 'twenty-ui/display';
|
} from 'twenty-ui/display';
|
||||||
import { NavigationBar } from 'twenty-ui/navigation';
|
import { NavigationBar } from 'twenty-ui/navigation';
|
||||||
|
import { useIsSettingsPage } from '../hooks/useIsSettingsPage';
|
||||||
|
import { currentMobileNavigationDrawerState } from '../states/currentMobileNavigationDrawerState';
|
||||||
|
|
||||||
type NavigationBarItemName = 'main' | 'search' | 'tasks' | 'settings';
|
type NavigationBarItemName = 'main' | 'search' | 'tasks' | 'settings';
|
||||||
|
|
||||||
@ -25,7 +25,6 @@ export const MobileNavigationBar = () => {
|
|||||||
useRecoilState(isNavigationDrawerExpandedState);
|
useRecoilState(isNavigationDrawerExpandedState);
|
||||||
const [currentMobileNavigationDrawer, setCurrentMobileNavigationDrawer] =
|
const [currentMobileNavigationDrawer, setCurrentMobileNavigationDrawer] =
|
||||||
useRecoilState(currentMobileNavigationDrawerState);
|
useRecoilState(currentMobileNavigationDrawerState);
|
||||||
|
|
||||||
const { openSettingsMenu } = useOpenSettingsMenu();
|
const { openSettingsMenu } = useOpenSettingsMenu();
|
||||||
|
|
||||||
const activeItemName = isNavigationDrawerExpanded
|
const activeItemName = isNavigationDrawerExpanded
|
||||||
|
|||||||
@ -122,7 +122,7 @@ export const DefaultLayout = () => {
|
|||||||
</StyledMainContainer>
|
</StyledMainContainer>
|
||||||
)}
|
)}
|
||||||
</StyledPageContainer>
|
</StyledPageContainer>
|
||||||
{isMobile && <MobileNavigationBar />}
|
{isMobile && !showAuthModal && <MobileNavigationBar />}
|
||||||
</AppErrorBoundary>
|
</AppErrorBoundary>
|
||||||
</StyledLayout>
|
</StyledLayout>
|
||||||
</>
|
</>
|
||||||
|
|||||||
Reference in New Issue
Block a user