From 9cadd74a96340f6823feb1f23fe17ca9a1fce8e6 Mon Sep 17 00:00:00 2001 From: Siddhant Rai Date: Thu, 4 Apr 2024 13:42:32 +0530 Subject: [PATCH] fix: minor ui changes --- frontend/src/Setting.tsx | 2 +- frontend/src/components/Dropdown.tsx | 20 ++++++++++++++------ frontend/src/preferences/PromptsModal.tsx | 8 ++++---- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/frontend/src/Setting.tsx b/frontend/src/Setting.tsx index 26c8701d..7834ae2d 100644 --- a/frontend/src/Setting.tsx +++ b/frontend/src/Setting.tsx @@ -281,6 +281,7 @@ const Prompts: React.FC = ({ ...prompts, { name: newPromptName, id: newPrompt.id, type: 'private' }, ]); + setModalState('INACTIVE'); } onSelectPrompt(newPromptName, newPrompt.id, newPromptContent); setNewPromptName(newPromptName); @@ -305,7 +306,6 @@ const Prompts: React.FC = ({ // get 1st prompt and set it as selected if (prompts.length > 0) { onSelectPrompt(prompts[0].name, prompts[0].id, prompts[0].type); - setNewPromptName(prompts[0].name); } }) .catch((error) => { diff --git a/frontend/src/components/Dropdown.tsx b/frontend/src/components/Dropdown.tsx index f14df984..5c22de2f 100644 --- a/frontend/src/components/Dropdown.tsx +++ b/frontend/src/components/Dropdown.tsx @@ -76,7 +76,7 @@ function Dropdown({ /> {isOpen && ( -
+
{options.map((option: any, index) => (
)} {showDelete && onDelete && ( - Delete onDelete(option.id)} - /> + disabled={option.type === 'public'} + > + Delete + )}
))} diff --git a/frontend/src/preferences/PromptsModal.tsx b/frontend/src/preferences/PromptsModal.tsx index ce0ecb47..596c9f59 100644 --- a/frontend/src/preferences/PromptsModal.tsx +++ b/frontend/src/preferences/PromptsModal.tsx @@ -48,7 +48,7 @@ function AddPrompt({
@@ -86,7 +86,7 @@ function EditPrompt({

Edit Prompt

- Edit your custom prompt and save it to DocsGPT. + Edit your custom prompt and save it to DocsGPT