From 59edcc3e2e5c95cce0961f90d1337bb7b3bbfba8 Mon Sep 17 00:00:00 2001 From: Yidadaa Date: Thu, 27 Apr 2023 02:12:09 +0800 Subject: [PATCH] feat: add side bar mask entry --- app/components/home.module.scss | 24 ++++++++++++++++++++++++ app/components/sidebar.tsx | 21 +++++++++++++++++++++ app/components/ui-lib.module.scss | 2 +- app/icons/plugin.svg | 1 + 4 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 app/icons/plugin.svg diff --git a/app/components/home.module.scss b/app/components/home.module.scss index 470bc9dd..7805f6ac 100644 --- a/app/components/home.module.scss +++ b/app/components/home.module.scss @@ -48,6 +48,19 @@ box-shadow: inset -2px 0px 2px 0px rgb(0, 0, 0, 0.05); position: relative; transition: width ease 0.05s; + + .sidebar-header-bar { + display: flex; + margin-bottom: 20px; + + .sidebar-bar-button { + flex-grow: 1; + + &:not(:last-child) { + margin-right: 10px; + } + } + } } .sidebar-drag { @@ -215,6 +228,17 @@ justify-content: center; } + .sidebar-header-bar { + flex-direction: column; + + .sidebar-bar-button { + &:not(:last-child) { + margin-right: 0; + margin-bottom: 10px; + } + } + } + .chat-item { padding: 0; min-height: 50px; diff --git a/app/components/sidebar.tsx b/app/components/sidebar.tsx index 8b534192..4ba3723c 100644 --- a/app/components/sidebar.tsx +++ b/app/components/sidebar.tsx @@ -8,6 +8,9 @@ import GithubIcon from "../icons/github.svg"; import ChatGptIcon from "../icons/chatgpt.svg"; import AddIcon from "../icons/add.svg"; import CloseIcon from "../icons/close.svg"; +import MaskIcon from "../icons/mask.svg"; +import PluginIcon from "../icons/plugin.svg"; + import Locale from "../locales"; import { useAppConfig, useChatStore } from "../store"; @@ -23,6 +26,7 @@ import { import { Link, useNavigate } from "react-router-dom"; import { useMobileScreen } from "../utils"; import dynamic from "next/dynamic"; +import { showToast } from "./ui-lib"; const ChatList = dynamic(async () => (await import("./chat-list")).ChatList, { loading: () => null, @@ -99,6 +103,23 @@ export function SideBar(props: { className?: string }) { +
+ } + text="Mask" + className={styles["sidebar-bar-button"]} + onClick={() => navigate(Path.Masks)} + shadow + /> + } + text="Plugins" + className={styles["sidebar-bar-button"]} + onClick={() => showToast(Locale.WIP)} + shadow + /> +
+
{ diff --git a/app/components/ui-lib.module.scss b/app/components/ui-lib.module.scss index 0b59d539..465fc0de 100644 --- a/app/components/ui-lib.module.scss +++ b/app/components/ui-lib.module.scss @@ -143,7 +143,7 @@ .toast-container { position: fixed; - bottom: 10vh; + bottom: 5vh; left: 0; width: 100vw; display: flex; diff --git a/app/icons/plugin.svg b/app/icons/plugin.svg new file mode 100644 index 00000000..8da8b0e7 --- /dev/null +++ b/app/icons/plugin.svg @@ -0,0 +1 @@ +