Skip to content

Commit

Permalink
feat(angular): voice recording (#313)
Browse files Browse the repository at this point in the history
### 🎯 Goal

_Describe why we are making this change_

### πŸ›  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
  • Loading branch information
szuperaz authored Sep 30, 2024
1 parent 966f44b commit 7afa748
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 16 deletions.
Binary file modified src/assets/icons/stream-chat-icons.eot
Binary file not shown.
4 changes: 4 additions & 0 deletions src/assets/icons/stream-chat-icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/icons/stream-chat-icons.ttf
Binary file not shown.
Binary file modified src/assets/icons/stream-chat-icons.woff
Binary file not shown.
Binary file modified src/assets/icons/stream-chat-icons.woff2
Binary file not shown.
78 changes: 64 additions & 14 deletions src/v2/styles/AudioRecorder/AudioRecorder-layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
padding-inline: 1rem;
}

.str-chat__audio_recorder {
.str-chat__audio_recorder,
stream-voice-recorder-wavebar {
@include utils.flex-row-center;
gap: 0.375rem;

Expand All @@ -21,28 +22,52 @@
padding: 0;
}

.str-chat__audio_recorder__cancel-button svg {
height: 28px;
.str-chat__audio_recorder__cancel-button {
--str-chat-icon-height: 28px;

svg {
height: 28px;
}
}

.str-chat__audio_recorder__toggle-playback-button svg {
height: 16px;
.str-chat__audio_recorder__toggle-playback-button {
--str-chat-icon-height: 16px;

svg {
height: 16px;
}
}

.str-chat__audio_recorder__pause-recording-button svg {
height: 12px;
.str-chat__audio_recorder__pause-recording-button {
--str-chat-icon-height: 12px;

svg {
height: 12px;
}
}

.str-chat__audio_recorder__resume-recording-button svg {
height: 24px;
.str-chat__audio_recorder__resume-recording-button {
--str-chat-icon-height: 24px;

svg {
height: 24px;
}
}

.str-chat__audio_recorder__stop-button svg {
height: 12px;
.str-chat__audio_recorder__stop-button {
--str-chat-icon-height: 12px;

svg {
height: 12px;
}
}

.str-chat__audio_recorder__complete-button svg {
height: 16px;
.str-chat__audio_recorder__complete-button {
--str-chat-icon-height: 16px;

svg {
height: 16px;
}
}

.str-chat__recording-timer {
Expand Down Expand Up @@ -86,4 +111,29 @@
.str-chat__audio_recorder__waveform-box {
overflow-x: hidden;
}
}
}

.str-chat__audio_recorder-container {
.str-chat__message-attachment__voice-recording-widget {
display: flex;
gap: var(--str-chat__spacing-1_5);

.str-chat__message-attachment-voice-recording-widget--first-row {
display: none;
}

.str-chat__message-attachment__voice-recording-widget__audio-state {
display: flex;
gap: var(--str-chat__spacing-1_5);

.str-chat__message-attachment__voice-recording-widget__timer {
min-width: 3rem;
align-self: center;
}
}

.str-chat__message-attachment__voice-recording-widget__right-section {
display: none;
}
}
}
12 changes: 11 additions & 1 deletion src/v2/styles/AudioRecorder/AudioRecorder-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,24 @@
}

.str-chat__audio_recorder__cancel-button {
--str-chat-icon-color: var(--str-chat__text-low-emphasis-color);
color: var(--str-chat__text-low-emphasis-color);
}

.str-chat__audio_recorder__toggle-playback-button {
--str-chat-icon-color: var(--str-chat__text-low-emphasis-color);
color: var(--str-chat__text-low-emphasis-color);
}

.str-chat__message-attachment-audio-widget--play-button {
--str-chat-icon-color: var(--str-chat__text-low-emphasis-color);
box-shadow: none;
border: none;
}

.str-chat__audio_recorder__pause-recording-button,
.str-chat__audio_recorder__resume-recording-button {
--str-chat-icon-color: var(--str-chat__danger-color);
color: var(--str-chat__danger-color);
}

Expand All @@ -36,6 +45,7 @@

.str-chat__audio_recorder__stop-button,
.str-chat__audio_recorder__complete-button {
--str-chat-icon-color: var(--str-chat__on-primary-color);
border-radius: var(--str-chat__border-radius-circle);
color: var(--str-chat__on-primary-color);
background-color: var(--str-chat__primary-color);
Expand All @@ -48,4 +58,4 @@
}
}
}
}
}
7 changes: 6 additions & 1 deletion src/v2/styles/Icon/Icon-layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
content: url('data:image/svg+xml;base64,PHN2ZwogIGNsYXNzPSJyZnUtZmlsZS1hdWRpbyIKICBmaWxsPSJub25lIgogIHZpZXdCb3g9IjAgMCAzNCA0MCIKICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgaGVpZ2h0PSIyMCIKICB3aWR0aD0iMjAiCj4KICA8cGF0aAogICAgY2xpcC1ydWxlPSJldmVub2RkIgogICAgZD0iTTE3LjcxNjggMzMuMTcyQzE4LjIzNDggMzMuMTcyIDE4LjQyMzggMzMuNjU1IDE4LjQyMzggMzQuMThDMTguNDIzOCAzNC42NDIgMTguMjk3OCAzNS4xOTUgMTcuNzE2OCAzNS4xOTVDMTcuMTcwOCAzNS4xOTUgMTYuOTg4OCAzNC42NDIgMTYuOTg4OCAzNC4xNDVDMTYuOTg4OCAzMy42ODMgMTcuMTcwOCAzMy4xNzIgMTcuNzE2OCAzMy4xNzJaTTE5LjU3MTggMzEuMDAySDE4LjM4MThWMzIuNzU4OUgxOC4zNjc4QzE4LjEyMjggMzIuNDMgMTcuNzc5OCAzMi4yNjIgMTcuMzMxOCAzMi4yNjJDMTYuMzAyOCAzMi4yNjIgMTUuNzk4OCAzMy4xNTggMTUuNzk4OCAzNC4xMDNDMTUuNzk4OCAzNS4xMjUgMTYuMjgxOCAzNi4xMDQ5IDE3LjQyMjggMzYuMTA0OUMxNy44NDI4IDM2LjEwNDkgMTguMTkyOCAzNS45MjMgMTguNDIzOCAzNS41OEgxOC40Mzc4VjM2SDE5LjU3MThWMzEuMDAyWk0xMi43MDk1IDM0LjE4NzJDMTIuNzA5NSAzMy43MjUyIDEyLjg3NzUgMzMuMTcyMiAxMy40MzA1IDMzLjE3MjJDMTMuOTgzNSAzMy4xNzIyIDE0LjE1ODUgMzMuNzI1MiAxNC4xNTg1IDM0LjE4NzJDMTQuMTU4NSAz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IyLjE2MDUgMTQuNjAyOFoiCiAgICBmaWxsPSIjMjcyN0IwIgogICAgZmlsbC1ydWxlPSJldmVub2RkIgogID48L3BhdGg+Cjwvc3ZnPg==');
}

// Copy icon mapping here
.str-chat__icon--action::before {
content: '\e800';
} /* 'ξ €' */
Expand Down Expand Up @@ -85,3 +84,9 @@
.str-chat__icon--attach::before {
content: '\e811';
} /* 'ξ ‘' */
.str-chat__icon--mic::before {
content: '\e812';
} /* 'ξ ’' */
.str-chat__icon--bin::before {
content: '\e813';
} /* 'ξ “' */
1 change: 1 addition & 0 deletions src/v2/styles/MessageInput/MessageInput-layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
}

.str-chat__start-recording-audio-button {
--str-chat-icon-height: calc(var(--str-chat__spacing-px) * 25);
@include utils.flex-row-center;
cursor: pointer;
padding: 0;
Expand Down
1 change: 1 addition & 0 deletions src/v2/styles/MessageInput/MessageInput-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@
}

.str-chat__start-recording-audio-button {
--str-chat-icon-color: var(--str-chat__start-recording-audio-button-color);
@include utils.component-layer-overrides('start-recording-audio-button');

&:disabled {
Expand Down

0 comments on commit 7afa748

Please sign in to comment.