From 9e955a095b865097f8c07104a13924dabea45d1b Mon Sep 17 00:00:00 2001 From: Ilya Bondar Date: Thu, 9 Nov 2023 16:56:49 +0100 Subject: [PATCH] fix: fix overlapping of confirmation buttons by prompt name when user deletes the prompt (#54) --- .gitattributes | 1 + .../Chatbar/components/Conversation.tsx | 4 ++-- .../Promptbar/components/Prompt.tsx | 21 ++++++++++++------- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.gitattributes b/.gitattributes index c091529f36..339f56602e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,2 @@ +* text=auto eol=lf *.png filter=lfs diff=lfs merge=lfs -text \ No newline at end of file diff --git a/src/components/Chatbar/components/Conversation.tsx b/src/components/Chatbar/components/Conversation.tsx index 964e17703d..a58221115e 100644 --- a/src/components/Chatbar/components/Conversation.tsx +++ b/src/components/Chatbar/components/Conversation.tsx @@ -217,7 +217,7 @@ export const ConversationComponent = ({ item: conversation, level }: Props) => { return (
{
{conversation.name} diff --git a/src/components/Promptbar/components/Prompt.tsx b/src/components/Promptbar/components/Prompt.tsx index aa9059a895..e797f23013 100644 --- a/src/components/Promptbar/components/Prompt.tsx +++ b/src/components/Promptbar/components/Prompt.tsx @@ -45,6 +45,7 @@ export const PromptComponent = ({ item: prompt, level }: Props) => { const selectedPromptId = useAppSelector( PromptsSelectors.selectSelectedPromptId, ); + const isSelected = selectedPromptId === prompt.id; const showModal = useAppSelector(PromptsSelectors.selectIsEditModalOpen); const [isDeleting, setIsDeleting] = useState(false); @@ -173,9 +174,7 @@ export const PromptComponent = ({ item: prompt, level }: Props) => {
{ > -
+
{prompt.name}
@@ -222,7 +229,7 @@ export const PromptComponent = ({ item: prompt, level }: Props) => {
{ )}
- {selectedPromptId === prompt.id && showModal && ( + {isSelected && showModal && (