增加分栏后可以全屏和还原的功能
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
============================================================ */
|
||||
import { useDevice } from "@/contexts/DeviceContext";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { useAIDrawer } from "@/contexts/AIDrawerContext";
|
||||
import { readAndClearAiSplitRestorePath, useAIDrawer } from "@/contexts/AIDrawerContext";
|
||||
import { useIsLgUp } from "@/hooks/useIsLgUp";
|
||||
import localeZh from "@/locales/data-zh.json";
|
||||
import localeZhHK from "@/locales/data-zh-HK.json";
|
||||
@@ -42,7 +42,7 @@ const NAV_ITEMS: NavItem[] = [
|
||||
];
|
||||
|
||||
export default function BottomNav() {
|
||||
const [location] = useLocation();
|
||||
const [location, setLocation] = useLocation();
|
||||
const isLgUp = useIsLgUp();
|
||||
const { open: aiDrawerOpen, setOpen: setAiDrawerOpen } = useAIDrawer();
|
||||
const { deviceState } = useDevice();
|
||||
@@ -160,13 +160,23 @@ export default function BottomNav() {
|
||||
tabIndex={0}
|
||||
className="cursor-pointer select-none"
|
||||
onClick={() => {
|
||||
if (location === "/ai") return;
|
||||
if (location === "/ai") {
|
||||
const path = readAndClearAiSplitRestorePath();
|
||||
setLocation(path);
|
||||
setAiDrawerOpen(true);
|
||||
return;
|
||||
}
|
||||
setAiDrawerOpen((o) => !o);
|
||||
}}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key !== "Enter" && e.key !== " ") return;
|
||||
e.preventDefault();
|
||||
if (location === "/ai") return;
|
||||
if (location === "/ai") {
|
||||
const path = readAndClearAiSplitRestorePath();
|
||||
setLocation(path);
|
||||
setAiDrawerOpen(true);
|
||||
return;
|
||||
}
|
||||
setAiDrawerOpen((o) => !o);
|
||||
}}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user