Skip to content

Commit 00dca76

Browse files
authored
feat: adapt styles for modal rendered at the top of the chat component tree (#341)
1 parent d35a358 commit 00dca76

File tree

3 files changed

+49
-20
lines changed

3 files changed

+49
-20
lines changed

src/v2/styles/Modal/Modal-theme.scss

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,11 @@
7474
}
7575
}
7676

77-
// stream-chat-react image gallery does not show the modal inner container. It has to be reset to
78-
// width of its content in order the modal can be closed when clicked on overlay
79-
.str-chat__message-attachment--card,
80-
.str-chat__message-attachment--image,
81-
.str-chat__message-attachment--gallery {
82-
.str-chat__modal--open .str-chat__modal__inner.str-chat-react__modal__inner {
77+
@mixin image-on-modal {
78+
.str-chat__modal__inner.str-chat-react__modal__inner {
8379
background-color: transparent;
8480
width: unset;
81+
max-width: unset;
8582
height: unset;
8683
padding: 0;
8784

@@ -92,3 +89,21 @@
9289
}
9390
}
9491
}
92+
93+
// stream-chat-react image gallery does not show the modal inner container. It has to be reset to
94+
// width of its content in order the modal can be closed when clicked on overlay
95+
// todo: remove this rule once only GlobalModal is used and old Modal is removed from stream-chat-react
96+
.str-chat__message-attachment--card,
97+
.str-chat__message-attachment--image,
98+
.str-chat__message-attachment--gallery {
99+
.str-chat__modal--open {
100+
@include image-on-modal;
101+
}
102+
}
103+
104+
.str-chat-react__modal.str-chat__modal--open {
105+
&.str-chat__image-modal,
106+
&.str-chat__gallery-modal {
107+
@include image-on-modal;
108+
}
109+
}

src/v2/styles/Poll/Poll-layout.scss

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,28 @@
4646
flex-direction: column;
4747
align-items: center;
4848

49-
.str-chat__poll-action {
50-
padding: 0.675rem;
51-
font: var(--str-chat__subtitle-text);
52-
color: var(--str-chat__primary-color);
53-
}
5449
}
5550
}
5651

52+
.str-chat__poll-action {
53+
padding: 0.675rem;
54+
font: var(--str-chat__subtitle-text);
55+
color: var(--str-chat__primary-color);
56+
}
57+
58+
.str-chat__poll-results-modal,
59+
.str-chat__poll-answer-list-modal,
60+
.str-chat__add-poll-answer-modal,
61+
.str-chat__suggest-poll-option-modal,
62+
.str-chat__poll-options-modal {
63+
button {
64+
@include utils.button-reset;
65+
cursor: pointer;
66+
}
67+
}
68+
69+
70+
5771
.str-chat__poll-option-list--full,
5872
.str-chat__modal__poll-results {
5973
.str-chat__amount-bar {
@@ -145,7 +159,7 @@
145159
}
146160
}
147161

148-
.str-chat__poll-actions .str-chat__modal {
162+
.str-chat-react__modal.str-chat__poll-action-modal, .str-chat__poll-actions .str-chat__modal {
149163
.str-chat__modal__close-button {
150164
display: none;
151165
}

src/v2/styles/Poll/Poll-theme.scss

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@
4444
}
4545
}
4646
}
47+
}
4748

48-
.str-chat__poll-option-list--full,
49-
.str-chat__poll-answer,
50-
.str-chat__modal__poll-option-list__title,
51-
.str-chat__modal__poll-results .str-chat__modal__poll-results__title,
52-
.str-chat__modal__poll-results .str-chat__poll-option {
53-
border-radius: 0.75rem;
54-
}
49+
.str-chat__poll-option-list--full,
50+
.str-chat__poll-answer,
51+
.str-chat__modal__poll-option-list__title,
52+
.str-chat__modal__poll-results .str-chat__modal__poll-results__title,
53+
.str-chat__modal__poll-results .str-chat__poll-option {
54+
border-radius: 0.75rem;
5555
}
5656

5757
.str-chat__poll-option-list--full {
@@ -66,7 +66,7 @@
6666
}
6767
}
6868

69-
.str-chat__poll-actions .str-chat__modal {
69+
.str-chat__modal, .str-chat__poll-actions .str-chat__modal {
7070
.str-chat__poll-answer__text,
7171
.str-chat__modal__poll-option-list__title,
7272
.str-chat__modal__poll-results__title {

0 commit comments

Comments
 (0)