From 34040db79febcbe103cd20be6b0dfbd354463e79 Mon Sep 17 00:00:00 2001 From: martincupela Date: Fri, 1 Aug 2025 14:43:32 +0200 Subject: [PATCH] feat: adapt styles for modal rendered at the top of the chat component tree --- src/v2/styles/Modal/Modal-theme.scss | 27 +++++++++++++++++++++------ src/v2/styles/Poll/Poll-layout.scss | 26 ++++++++++++++++++++------ src/v2/styles/Poll/Poll-theme.scss | 16 ++++++++-------- 3 files changed, 49 insertions(+), 20 deletions(-) diff --git a/src/v2/styles/Modal/Modal-theme.scss b/src/v2/styles/Modal/Modal-theme.scss index 1d6f61bb..09e4a8ca 100644 --- a/src/v2/styles/Modal/Modal-theme.scss +++ b/src/v2/styles/Modal/Modal-theme.scss @@ -74,14 +74,11 @@ } } -// stream-chat-react image gallery does not show the modal inner container. It has to be reset to -// width of its content in order the modal can be closed when clicked on overlay -.str-chat__message-attachment--card, -.str-chat__message-attachment--image, -.str-chat__message-attachment--gallery { - .str-chat__modal--open .str-chat__modal__inner.str-chat-react__modal__inner { +@mixin image-on-modal { + .str-chat__modal__inner.str-chat-react__modal__inner { background-color: transparent; width: unset; + max-width: unset; height: unset; padding: 0; @@ -92,3 +89,21 @@ } } } + +// stream-chat-react image gallery does not show the modal inner container. It has to be reset to +// width of its content in order the modal can be closed when clicked on overlay +// todo: remove this rule once only GlobalModal is used and old Modal is removed from stream-chat-react +.str-chat__message-attachment--card, +.str-chat__message-attachment--image, +.str-chat__message-attachment--gallery { + .str-chat__modal--open { + @include image-on-modal; + } +} + +.str-chat-react__modal.str-chat__modal--open { + &.str-chat__image-modal, + &.str-chat__gallery-modal { + @include image-on-modal; + } +} \ No newline at end of file diff --git a/src/v2/styles/Poll/Poll-layout.scss b/src/v2/styles/Poll/Poll-layout.scss index e12bb484..8b158525 100644 --- a/src/v2/styles/Poll/Poll-layout.scss +++ b/src/v2/styles/Poll/Poll-layout.scss @@ -46,14 +46,28 @@ flex-direction: column; align-items: center; - .str-chat__poll-action { - padding: 0.675rem; - font: var(--str-chat__subtitle-text); - color: var(--str-chat__primary-color); - } } } +.str-chat__poll-action { + padding: 0.675rem; + font: var(--str-chat__subtitle-text); + color: var(--str-chat__primary-color); +} + +.str-chat__poll-results-modal, +.str-chat__poll-answer-list-modal, +.str-chat__add-poll-answer-modal, +.str-chat__suggest-poll-option-modal, +.str-chat__poll-options-modal { + button { + @include utils.button-reset; + cursor: pointer; + } +} + + + .str-chat__poll-option-list--full, .str-chat__modal__poll-results { .str-chat__amount-bar { @@ -145,7 +159,7 @@ } } -.str-chat__poll-actions .str-chat__modal { +.str-chat-react__modal.str-chat__poll-action-modal, .str-chat__poll-actions .str-chat__modal { .str-chat__modal__close-button { display: none; } diff --git a/src/v2/styles/Poll/Poll-theme.scss b/src/v2/styles/Poll/Poll-theme.scss index 3d4614fc..6f83f829 100644 --- a/src/v2/styles/Poll/Poll-theme.scss +++ b/src/v2/styles/Poll/Poll-theme.scss @@ -44,14 +44,14 @@ } } } +} - .str-chat__poll-option-list--full, - .str-chat__poll-answer, - .str-chat__modal__poll-option-list__title, - .str-chat__modal__poll-results .str-chat__modal__poll-results__title, - .str-chat__modal__poll-results .str-chat__poll-option { - border-radius: 0.75rem; - } +.str-chat__poll-option-list--full, +.str-chat__poll-answer, +.str-chat__modal__poll-option-list__title, +.str-chat__modal__poll-results .str-chat__modal__poll-results__title, +.str-chat__modal__poll-results .str-chat__poll-option { + border-radius: 0.75rem; } .str-chat__poll-option-list--full { @@ -66,7 +66,7 @@ } } -.str-chat__poll-actions .str-chat__modal { +.str-chat__modal, .str-chat__poll-actions .str-chat__modal { .str-chat__poll-answer__text, .str-chat__modal__poll-option-list__title, .str-chat__modal__poll-results__title {