From c01cf4b50e58e5588632ccc0e2e3de1ba19c821c Mon Sep 17 00:00:00 2001 From: Andrey Mikhadyuk Date: Tue, 31 Oct 2023 11:40:07 +0300 Subject: [PATCH 1/2] display chat message arrow when menu is open --- .../Chat/ChatMessage/ChatMessage.module.scss | 11 +++++++---- .../components/Chat/ChatMessage/ChatMessage.tsx | 4 +++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/shared/components/Chat/ChatMessage/ChatMessage.module.scss b/src/shared/components/Chat/ChatMessage/ChatMessage.module.scss index 9f6a857821..f613892610 100644 --- a/src/shared/components/Chat/ChatMessage/ChatMessage.module.scss +++ b/src/shared/components/Chat/ChatMessage/ChatMessage.module.scss @@ -68,6 +68,13 @@ } } +.menuArrowButton { + display: none; +} +.menuArrowButtonVisible { + display: block; +} + .messageTextWithReply { padding: 0.25rem 0rem 0.5rem; } @@ -220,10 +227,6 @@ } } -.menuArrowButton { - display: none; -} - .highlighted { animation: highlighted 10s forwards; border: 0.06rem solid $c-pink-active-feed-cards; diff --git a/src/shared/components/Chat/ChatMessage/ChatMessage.tsx b/src/shared/components/Chat/ChatMessage/ChatMessage.tsx index 7ff3b2bec9..b38034c63b 100644 --- a/src/shared/components/Chat/ChatMessage/ChatMessage.tsx +++ b/src/shared/components/Chat/ChatMessage/ChatMessage.tsx @@ -448,7 +448,9 @@ export default function ChatMessage({ isControlledDropdown={false} isOpen={isMenuOpen} styles={{ - menuButton: styles.menuArrowButton, + menuButton: classNames(styles.menuArrowButton, { + [styles.menuArrowButtonVisible]: isMenuOpen, + }), }} feedItemId={feedItemId} onDelete={onMessageDelete} From 72fa5ae4272c88f847043678300e3244a4cd0631 Mon Sep 17 00:00:00 2001 From: Andrey Mikhadyuk Date: Tue, 31 Oct 2023 11:51:16 +0300 Subject: [PATCH 2/2] make chat message menu to be always in ltr direction --- .../components/Chat/ChatMessage/ChatMessage.module.scss | 4 ++++ src/shared/components/Chat/ChatMessage/ChatMessage.tsx | 1 + src/shared/components/ElementDropdown/ElementDropdown.tsx | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/shared/components/Chat/ChatMessage/ChatMessage.module.scss b/src/shared/components/Chat/ChatMessage/ChatMessage.module.scss index f613892610..d9cd0d7295 100644 --- a/src/shared/components/Chat/ChatMessage/ChatMessage.module.scss +++ b/src/shared/components/Chat/ChatMessage/ChatMessage.module.scss @@ -68,6 +68,10 @@ } } +.elementDropdownMenu { + direction: ltr; +} + .menuArrowButton { display: none; } diff --git a/src/shared/components/Chat/ChatMessage/ChatMessage.tsx b/src/shared/components/Chat/ChatMessage/ChatMessage.tsx index b38034c63b..e49ce29b03 100644 --- a/src/shared/components/Chat/ChatMessage/ChatMessage.tsx +++ b/src/shared/components/Chat/ChatMessage/ChatMessage.tsx @@ -448,6 +448,7 @@ export default function ChatMessage({ isControlledDropdown={false} isOpen={isMenuOpen} styles={{ + menu: styles.elementDropdownMenu, menuButton: classNames(styles.menuArrowButton, { [styles.menuArrowButtonVisible]: isMenuOpen, }), diff --git a/src/shared/components/ElementDropdown/ElementDropdown.tsx b/src/shared/components/ElementDropdown/ElementDropdown.tsx index a9860c34f6..ce34c50ab9 100644 --- a/src/shared/components/ElementDropdown/ElementDropdown.tsx +++ b/src/shared/components/ElementDropdown/ElementDropdown.tsx @@ -340,7 +340,7 @@ const ElementDropdown: FC = ({ menuButton: classNames(styles?.menuButton, { "element-dropdown__menu-button--transparent": transparent, }), - menu: "element-dropdown__menu", + menu: classNames("element-dropdown__menu", styles?.menu), menuItem: "element-dropdown__menu-item", }} />