mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 16:43:16 +00:00
Merge branch 'main' into refactor/llm-handler
This commit is contained in:
@@ -72,7 +72,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
|
||||
const sharedAgents = useSelector(selectSharedAgents);
|
||||
const selectedAgent = useSelector(selectSelectedAgent);
|
||||
|
||||
const { isMobile } = useMediaQuery();
|
||||
const { isMobile, isTablet } = useMediaQuery();
|
||||
const [isDarkTheme] = useDarkTheme();
|
||||
const { showTokenModal, handleTokenSubmit } = useTokenAuth();
|
||||
|
||||
@@ -163,7 +163,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
|
||||
const handleAgentClick = (agent: Agent) => {
|
||||
resetConversation();
|
||||
dispatch(setSelectedAgent(agent));
|
||||
if (isMobile) setNavOpen(!navOpen);
|
||||
if (isMobile || isTablet) setNavOpen(!navOpen);
|
||||
navigate('/');
|
||||
};
|
||||
|
||||
@@ -267,8 +267,8 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
setNavOpen(!isMobile);
|
||||
}, [isMobile]);
|
||||
setNavOpen(!(isMobile || isTablet));
|
||||
}, [isMobile, isTablet]);
|
||||
|
||||
useDefaultDocument();
|
||||
return (
|
||||
@@ -348,7 +348,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
|
||||
<NavLink
|
||||
to={'/'}
|
||||
onClick={() => {
|
||||
if (isMobile) {
|
||||
if (isMobile || isTablet) {
|
||||
setNavOpen(!navOpen);
|
||||
}
|
||||
resetConversation();
|
||||
@@ -411,7 +411,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
className={`${isMobile ? 'flex' : 'invisible flex group-hover:visible'} items-center px-3`}
|
||||
className={`${isMobile || isTablet ? 'flex' : 'invisible flex group-hover:visible'} items-center px-3`}
|
||||
>
|
||||
<button
|
||||
className="rounded-full hover:opacity-75"
|
||||
@@ -433,6 +433,9 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
|
||||
className="mx-4 my-auto mt-2 flex h-9 cursor-pointer items-center gap-2 rounded-3xl pl-4 hover:bg-bright-gray dark:hover:bg-dark-charcoal"
|
||||
onClick={() => {
|
||||
dispatch(setSelectedAgent(null));
|
||||
if (isMobile || isTablet) {
|
||||
setNavOpen(false);
|
||||
}
|
||||
navigate('/agents');
|
||||
}}
|
||||
>
|
||||
@@ -444,7 +447,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
|
||||
/>
|
||||
</div>
|
||||
<p className="overflow-hidden overflow-ellipsis whitespace-nowrap text-sm leading-6 text-eerie-black dark:text-bright-gray">
|
||||
Manage Agents
|
||||
{t('manageAgents')}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -452,7 +455,13 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
|
||||
) : (
|
||||
<div
|
||||
className="mx-4 my-auto mt-2 flex h-9 cursor-pointer items-center gap-2 rounded-3xl pl-4 hover:bg-bright-gray dark:hover:bg-dark-charcoal"
|
||||
onClick={() => navigate('/agents')}
|
||||
onClick={() => {
|
||||
if (isMobile || isTablet) {
|
||||
setNavOpen(false);
|
||||
}
|
||||
dispatch(setSelectedAgent(null));
|
||||
navigate('/agents');
|
||||
}}
|
||||
>
|
||||
<div className="flex w-6 justify-center">
|
||||
<img
|
||||
@@ -462,7 +471,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
|
||||
/>
|
||||
</div>
|
||||
<p className="overflow-hidden overflow-ellipsis whitespace-nowrap text-sm leading-6 text-eerie-black dark:text-bright-gray">
|
||||
Manage Agents
|
||||
{t('manageAgents')}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
@@ -498,8 +507,8 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
|
||||
<div className="flex flex-col gap-2 border-b-[1px] py-2 dark:border-b-purple-taupe">
|
||||
<NavLink
|
||||
onClick={() => {
|
||||
if (isMobile) {
|
||||
setNavOpen(!navOpen);
|
||||
if (isMobile || isTablet) {
|
||||
setNavOpen(false);
|
||||
}
|
||||
resetConversation();
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user