|
@@ -22,7 +22,6 @@ import {
|
|
|
MIN_SIDEBAR_WIDTH,
|
|
MIN_SIDEBAR_WIDTH,
|
|
|
NARROW_SIDEBAR_WIDTH,
|
|
NARROW_SIDEBAR_WIDTH,
|
|
|
Path,
|
|
Path,
|
|
|
- PLUGINS,
|
|
|
|
|
REPO_URL,
|
|
REPO_URL,
|
|
|
} from "../constant";
|
|
} from "../constant";
|
|
|
|
|
|
|
@@ -32,6 +31,12 @@ import dynamic from "next/dynamic";
|
|
|
import { showConfirm, Selector } from "./ui-lib";
|
|
import { showConfirm, Selector } from "./ui-lib";
|
|
|
import clsx from "clsx";
|
|
import clsx from "clsx";
|
|
|
|
|
|
|
|
|
|
+const DISCOVERY = [
|
|
|
|
|
+ { name: Locale.Plugin.Name, path: Path.Plugins },
|
|
|
|
|
+ { name: "Stable Diffusion", path: Path.Sd },
|
|
|
|
|
+ { name: Locale.SearchChat.Page.Title, path: Path.SearchChat },
|
|
|
|
|
+];
|
|
|
|
|
+
|
|
|
const ChatList = dynamic(async () => (await import("./chat-list")).ChatList, {
|
|
const ChatList = dynamic(async () => (await import("./chat-list")).ChatList, {
|
|
|
loading: () => null,
|
|
loading: () => null,
|
|
|
});
|
|
});
|
|
@@ -219,7 +224,7 @@ export function SideBarTail(props: {
|
|
|
export function SideBar(props: { className?: string }) {
|
|
export function SideBar(props: { className?: string }) {
|
|
|
useHotKey();
|
|
useHotKey();
|
|
|
const { onDragStart, shouldNarrow } = useDragSideBar();
|
|
const { onDragStart, shouldNarrow } = useDragSideBar();
|
|
|
- const [showPluginSelector, setShowPluginSelector] = useState(false);
|
|
|
|
|
|
|
+ const [showDiscoverySelector, setshowDiscoverySelector] = useState(false);
|
|
|
const navigate = useNavigate();
|
|
const navigate = useNavigate();
|
|
|
const config = useAppConfig();
|
|
const config = useAppConfig();
|
|
|
const chatStore = useChatStore();
|
|
const chatStore = useChatStore();
|
|
@@ -254,21 +259,21 @@ export function SideBar(props: { className?: string }) {
|
|
|
icon={<DiscoveryIcon />}
|
|
icon={<DiscoveryIcon />}
|
|
|
text={shouldNarrow ? undefined : Locale.Discovery.Name}
|
|
text={shouldNarrow ? undefined : Locale.Discovery.Name}
|
|
|
className={styles["sidebar-bar-button"]}
|
|
className={styles["sidebar-bar-button"]}
|
|
|
- onClick={() => setShowPluginSelector(true)}
|
|
|
|
|
|
|
+ onClick={() => setshowDiscoverySelector(true)}
|
|
|
shadow
|
|
shadow
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
- {showPluginSelector && (
|
|
|
|
|
|
|
+ {showDiscoverySelector && (
|
|
|
<Selector
|
|
<Selector
|
|
|
items={[
|
|
items={[
|
|
|
- ...PLUGINS.map((item) => {
|
|
|
|
|
|
|
+ ...DISCOVERY.map((item) => {
|
|
|
return {
|
|
return {
|
|
|
title: item.name,
|
|
title: item.name,
|
|
|
value: item.path,
|
|
value: item.path,
|
|
|
};
|
|
};
|
|
|
}),
|
|
}),
|
|
|
]}
|
|
]}
|
|
|
- onClose={() => setShowPluginSelector(false)}
|
|
|
|
|
|
|
+ onClose={() => setshowDiscoverySelector(false)}
|
|
|
onSelection={(s) => {
|
|
onSelection={(s) => {
|
|
|
navigate(s[0], { state: { fromHome: true } });
|
|
navigate(s[0], { state: { fromHome: true } });
|
|
|
}}
|
|
}}
|