From 96e3d3a22c57fd061cad68d374d97c5f1ec51e2f Mon Sep 17 00:00:00 2001 From: PaRaD1SE98 Date: Wed, 10 May 2023 07:14:49 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=E7=BB=99=E6=89=80=E6=9C=89select=E5=85=83?= =?UTF-8?q?=E7=B4=A0=E6=B7=BB=E5=8A=A0=E4=B8=80=E4=B8=AA=E5=8F=B3=E4=BE=A7?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/mask.tsx | 10 +++++----- app/components/model-config.tsx | 6 +++--- app/components/settings.tsx | 22 +++++++++++++++------- app/components/ui-lib.module.scss | 25 +++++++++++++++++++++++++ app/components/ui-lib.tsx | 21 +++++++++++++++++++++ app/icons/down.svg | 1 + 6 files changed, 70 insertions(+), 15 deletions(-) create mode 100644 app/icons/down.svg diff --git a/app/components/mask.tsx b/app/components/mask.tsx index a37cfba7..13ffb9ef 100644 --- a/app/components/mask.tsx +++ b/app/components/mask.tsx @@ -14,7 +14,7 @@ import CopyIcon from "../icons/copy.svg"; import { DEFAULT_MASK_AVATAR, Mask, useMaskStore } from "../store/mask"; import { Message, ModelConfig, ROLES, useChatStore } from "../store"; -import { Input, List, ListItem, Modal, Popover } from "./ui-lib"; +import { Input, List, ListItem, Modal, Popover, Select } from "./ui-lib"; import { Avatar, AvatarPicker } from "./emoji"; import Locale, { AllLangs, Lang } from "../locales"; import { useNavigate } from "react-router-dom"; @@ -116,7 +116,7 @@ function ContextPromptItem(props: { return (
{!focusingInput && ( - + )} onSearch(e.currentTarget.value)} /> - + - + - + - + - + ) {
); } + +export function Select( + props: React.DetailedHTMLProps< + React.SelectHTMLAttributes, + HTMLSelectElement + >, +) { + const { className, children, ...otherProps } = props; + return ( +
+ + +
+ ); +} diff --git a/app/icons/down.svg b/app/icons/down.svg new file mode 100644 index 00000000..cca830b8 --- /dev/null +++ b/app/icons/down.svg @@ -0,0 +1 @@ + From 960aa90c32fa9c1355ab0543f100e81bf508d54e Mon Sep 17 00:00:00 2001 From: PaRaD1SE98 Date: Wed, 10 May 2023 14:09:30 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BC=98=E5=8C=96Select=20component?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/ui-lib.module.scss | 2 +- app/components/ui-lib.tsx | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app/components/ui-lib.module.scss b/app/components/ui-lib.module.scss index 6296c908..e0806d22 100644 --- a/app/components/ui-lib.module.scss +++ b/app/components/ui-lib.module.scss @@ -209,6 +209,7 @@ max-width: fit-content; .select-with-icon-select { + height: 100%; border: var(--border-in-light); padding: 10px 25px 10px 10px; border-radius: 10px; @@ -217,7 +218,6 @@ background-color: var(--white); color: var(--black); text-align: center; - position: relative; } .select-with-icon-icon { diff --git a/app/components/ui-lib.tsx b/app/components/ui-lib.tsx index 935f0f93..5687b1c5 100644 --- a/app/components/ui-lib.tsx +++ b/app/components/ui-lib.tsx @@ -254,11 +254,8 @@ export function Select( ) { const { className, children, ...otherProps } = props; return ( -
- {children}