Skip to content

Commit 5d77cd8

Browse files
authored
feat(stream-chat-angular): Polls for Angular (#343)
### 🎯 Goal Changes affect Angular SDK only. Some extra CSS was needed for Angular, mainly because modal handling is different in React and Angular. Also, some reformat changes. ### 🛠 Implementation details _Provide a description of the implementation_ ### 🎨 UI Changes _Add relevant screenshots_ Make sure to test with both Angular and React (with both `MessageList` and `VirtualizedMessageList` components) SDKs
1 parent f732996 commit 5d77cd8

File tree

6 files changed

+61
-11
lines changed

6 files changed

+61
-11
lines changed

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
.str-chat__dialog__title {
1919
margin-bottom: 1rem;
2020
}
21-
2221
}
2322

2423
.str-chat__dialog__controls {
@@ -33,8 +32,18 @@
3332
}
3433
}
3534

35+
.str-chat-angular__dialog-body {
36+
&.str-chat__dialog__body {
37+
padding: 0;
38+
}
39+
40+
.str-chat__dialog__controls {
41+
padding-bottom: 0;
42+
}
43+
}
44+
3645
.str-chat__prompt-dialog {
37-
input[type=text] {
46+
input[type='text'] {
3847
width: 100%;
3948
padding: 0.625rem 1rem;
4049
}
@@ -58,4 +67,4 @@
5867
padding-inline: 0.675rem;
5968
}
6069
}
61-
}
70+
}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@
3030
content: url('data:image/svg+xml;base64,PHN2ZwogIGNsYXNzPSJyZnUtZmlsZS1hdWRpbyIKICBmaWxsPSJub25lIgogIHZpZXdCb3g9IjAgMCAzNCA0MCIKICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgaGVpZ2h0PSIyMCIKICB3aWR0aD0iMjAiCj4KICA8cGF0aAogICAgY2xpcC1ydWxlPSJldmVub2RkIgogICAgZD0iTTE3LjcxNjggMzMuMTcyQzE4LjIzNDggMzMuMTcyIDE4LjQyMzggMzMuNjU1IDE4L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IDE4LjAyNTEgMjAuOTIxMSAxNy4zNTc1IDIwLjY5NTUgMTYuNzAzNUMyMC42MDUzIDE2LjQ0NzcgMjAuMjI5IDE2LjI5MDggMTkuODUxMSAxNi4zNTE3Wk0yMi4xNjA1IDE0LjYwMjhDMjIuNTI1MiAxNC41MTYzIDIyLjkyNTkgMTQuNjQ1NCAyMy4wNTUgMTQuODkzOEMyMy42ODkxIDE2LjExNTcgMjQgMTcuNDA0MiAyNCAxOC42OTIzQzI0LjAwMDQgMTkuOTg5NSAyMy42Nzk2IDIxLjI4MzkgMjMuMDUyMSAyMi41MTUzQzIyLjk1MDMgMjIuNzEyMyAyMi42NzYzIDIyLjgzNDQgMjIuMzgyOCAyMi44MzQ0QzIyLjMwNzEgMjIuODM0NCAyMi4yMzAxIDIyLjgyNjEgMjIuMTU0MyAyMi44MDkyQzIxLjc4NjMgMjIuNzI1MSAyMS41OTE0IDIyLjQ1MzYgMjEuNzE4NSAyMi4yMDc3QzIyLjI5ODggMjEuMDc2MSAyMi41OTIyIDE5Ljg4MzYgMjIuNTkzMSAxOC42OTE5QzIyLjU5MzEgMTcuNTA1NiAyMi4zMDU0IDE2LjMyMjIgMjEuNzI3NiAxNS4yMDI1QzIxLjYwMDEgMTQuOTU2MyAyMS43OTUgMTQuNjg2IDIyLjE2MDUgMTQuNjAyOFoiCiAgICBmaWxsPSIjMjcyN0IwIgogICAgZmlsbC1ydWxlPSJldmVub2RkIgogID48L3BhdGg+Cjwvc3ZnPg==');
3131
}
3232

33+
.str-chat__icon--poll {
34+
--str-chat-icon-width: var(--str-chat-icon-height);
35+
-webkit-mask: var(--str-chat__poll-icon) no-repeat center / contain;
36+
mask: var(--str-chat__poll-icon) no-repeat center / contain;
37+
}
38+
3339
.str-chat__icon--action::before {
3440
content: '\e800';
3541
} /* '' */

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@
1111
.str-chat__icon--error {
1212
--str-chat-icon-color: var(--str-chat__danger-color);
1313
}
14+
15+
.str-chat__icon--poll {
16+
background-color: var(--str-chat-icon-color);
17+
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@
4646
}
4747
}
4848

49+
.str-chat-angular__create-poll {
50+
--str-chat-icon-height: calc(var(--str-chat__spacing-px) * 21);
51+
@include utils.flex-row-center;
52+
width: calc(var(--str-chat__spacing-px) * 45);
53+
height: calc(var(--str-chat__spacing-px) * 45);
54+
cursor: pointer;
55+
}
56+
4957
.str-chat__message-textarea-container {
5058
@include utils.flex-col-center;
5159
width: 100%;

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@
178178
.str-chat__message-input {
179179
@include utils.component-layer-overrides('message-input');
180180

181-
.str-chat__file-input-container {
181+
.str-chat__file-input-container,
182+
.str-chat-angular__create-poll {
182183
--str-chat-icon-color: var(--str-chat__message-input-tools-color);
183184
@include utils.component-layer-overrides('message-input-tools');
184185

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

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
display: flex;
4646
flex-direction: column;
4747
align-items: center;
48-
4948
}
5049
}
5150

@@ -66,8 +65,6 @@
6665
}
6766
}
6867

69-
70-
7168
.str-chat__poll-option-list--full,
7269
.str-chat__modal__poll-results {
7370
.str-chat__amount-bar {
@@ -103,7 +100,6 @@
103100
}
104101
}
105102

106-
107103
.str-chat__poll-option-list--full {
108104
.str-chat__poll-option {
109105
display: flex;
@@ -151,19 +147,22 @@
151147
}
152148
}
153149

154-
155150
.str-chat__modal__poll-results {
156151
.str-chat__poll-option {
157152
display: flex;
158153
flex-direction: column;
159154
}
160155
}
161156

162-
.str-chat-react__modal.str-chat__poll-action-modal, .str-chat__poll-actions .str-chat__modal {
157+
.str-chat-react__modal.str-chat__poll-action-modal,
158+
.str-chat__poll-actions:not(.str-chat-angular__poll-actions) .str-chat__modal {
163159
.str-chat__modal__close-button {
164160
display: none;
165161
}
162+
}
166163

164+
.str-chat-react__modal.str-chat__poll-action-modal,
165+
.str-chat__poll-actions .str-chat__modal {
167166
.str-chat__modal__inner {
168167
$content-offset-inline: 1rem;
169168
padding: 0 0 0.5rem;
@@ -334,6 +333,7 @@
334333
align-items: flex-start;
335334
}
336335

336+
.str-chat-angular__create-poll-modal .str-chat__modal,
337337
.str-chat__modal.str-chat__create-poll-modal {
338338
.str-chat__modal__close-button {
339339
display: none;
@@ -415,7 +415,7 @@
415415
}
416416

417417
.str-chat__form__input-field {
418-
width: 100%;
418+
width: 100%;
419419

420420
.str-chat__form__input-field__value {
421421
padding: 0;
@@ -465,3 +465,25 @@
465465
}
466466
}
467467
}
468+
469+
.str-chat-angular__poll-actions {
470+
.str-chat__modal__poll-option-list {
471+
max-height: 100%;
472+
min-height: 0;
473+
display: flex;
474+
flex-direction: column;
475+
476+
.str-chat__modal__poll-option-list__body {
477+
max-height: 100%;
478+
min-height: 0;
479+
display: flex;
480+
flex-direction: column;
481+
482+
stream-poll-options-list {
483+
height: 100%;
484+
overflow-y: auto;
485+
overflow-x: hidden;
486+
}
487+
}
488+
}
489+
}

0 commit comments

Comments
 (0)