diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 1bba5f44..dbdba932 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -29,8 +29,8 @@ function AuthWrapper({ children }: { children: React.ReactNode }) { } function MainLayout() { - const { isMobile } = useMediaQuery(); - const [navOpen, setNavOpen] = useState(!isMobile); + const { isMobile, isTablet } = useMediaQuery(); + const [navOpen, setNavOpen] = useState(!(isMobile || isTablet)); return (
@@ -38,7 +38,7 @@ function MainLayout() {
{ resetConversation(); dispatch(setSelectedAgent(agent)); - if (isMobile) setNavOpen(!navOpen); + if (isMobile || isTablet) setNavOpen(!navOpen); navigate('/'); }; @@ -271,8 +271,8 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { } useEffect(() => { - setNavOpen(!isMobile); - }, [isMobile]); + setNavOpen(!(isMobile || isTablet)); + }, [isMobile, isTablet]); useDefaultDocument(); return ( @@ -352,7 +352,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { { - if (isMobile) { + if (isMobile || isTablet) { setNavOpen(!navOpen); } resetConversation(); @@ -415,7 +415,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {

- Manage Agents + {t('manageAgents')}

@@ -456,7 +459,13 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { ) : (
navigate('/agents')} + onClick={() => { + if (isMobile || isTablet) { + setNavOpen(false); + } + dispatch(setSelectedAgent(null)); + navigate('/agents'); + }} >

- Manage Agents + {t('manageAgents')}

)}