Skip to content

Commit 1054edd

Browse files
shibbasanfibiacreativa
authored andcommitted
feat: differentiate listening vs. not listening
1 parent 79e66ed commit 1054edd

File tree

5 files changed

+16
-6
lines changed

5 files changed

+16
-6
lines changed
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading

packages/chat-component/src/config/global-config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const globalConfig = {
1717
// This are the labels for the chat button and input
1818
CHAT_BUTTON_LABEL_TEXT: 'Ask Support',
1919
CHAT_VOICE_BUTTON_LABEL_TEXT: 'Voice input',
20+
CHAT_VOICE_REC_BUTTON_LABEL_TEXT: 'Listening to voice input',
2021
CHAT_INPUT_PLACEHOLDER: 'Type your question, eg. "How to search and book rentals?"',
2122
USER_IS_BOT: 'Support Assistant',
2223
RESET_BUTTON_LABEL_TEXT: 'X',

packages/chat-component/src/main.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -658,8 +658,10 @@ export class ChatComponent extends LitElement {
658658
/>
659659
${this.showVoiceInput
660660
? html` <button
661-
title="${globalConfig.CHAT_VOICE_BUTTON_LABEL_TEXT}"
662-
class="chatbox__button"
661+
title="${this.enableVoiceListening
662+
? globalConfig.CHAT_VOICE_REC_BUTTON_LABEL_TEXT
663+
: globalConfig.CHAT_VOICE_BUTTON_LABEL_TEXT}"
664+
class="chatbox__button ${this.enableVoiceListening ? 'recording' : 'not-recording'}"
663665
?disabled="${!this.showVoiceInput}"
664666
@click="${this.handleVoiceInput}"
665667
>

packages/chat-component/src/style.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export const mainStyle = css`
1010
--primary-color: rgba(241, 255, 165, 0.6);
1111
--white: #fff;
1212
--black: #111111;
13+
--red: #ff0000;
1314
--light-gray: #e3e3e3;
1415
--dark-gray: #4e5288;
1516
--accent-high: #692b61;
@@ -589,4 +590,10 @@ export const mainStyle = css`
589590
animation: spinneranimation 1s linear infinite;
590591
margin-right: 10px;
591592
}
593+
.not-recording svg {
594+
fill: var(--black);
595+
}
596+
.recording svg {
597+
fill: var(--red);
598+
}
592599
`;

0 commit comments

Comments
 (0)