Skip to content

Commit 3b5e0c9

Browse files
committed
chore: design tweaks (x2)
1 parent 12617c7 commit 3b5e0c9

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

examples/react-chatbot/components/AIStateIndicator/AIStateIndicator.scss

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
}
2323

2424
&__dot {
25-
width: 8px;
26-
height: 8px;
25+
width: 6px;
26+
height: 6px;
2727
background-color: var(--ai-demo-text-secondary);
2828
border-radius: 50%;
2929
animation: ai-demo-thinking 1.4s ease-in-out infinite;
@@ -50,7 +50,9 @@
5050
}
5151

5252
@keyframes ai-demo-thinking {
53-
0%, 60%, 100% {
53+
0%,
54+
60%,
55+
100% {
5456
transform: scale(1);
5557
opacity: 0.4;
5658
}
@@ -61,10 +63,12 @@
6163
}
6264

6365
@keyframes ai-demo-text-fade {
64-
0%, 100% {
66+
0%,
67+
100% {
6568
opacity: 1;
6669
}
67-
45%, 55% {
70+
45%,
71+
55% {
6872
opacity: 0.5;
6973
}
7074
}

examples/react-chatbot/components/EmptyState/EmptyState.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
justify-content: center;
55
height: 100%;
66
width: 100%;
7-
background-color: var(--ai-demo-bg-primary);
87

98
&__content {
109
display: flex;

examples/react-chatbot/components/MessageInputBar/MessageInputBar.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use client';
22

33
import { AIMessageComposer } from '@stream-io/chat-react-ai';
4-
import { useEffect } from 'react';
4+
import { useState, useEffect } from 'react';
55
import {
66
isImageFile,
77
type Channel,
@@ -14,7 +14,6 @@ import {
1414
useChannelStateContext,
1515
useChatContext,
1616
useMessageComposer,
17-
useStateStore,
1817
} from 'stream-chat-react';
1918
import { startAiAgent } from '@/components/api';
2019
import './MessageInputBar.scss';
@@ -32,6 +31,7 @@ export const MessageInputBar = () => {
3231
const composer = useMessageComposer();
3332

3433
const { attachments } = useAttachmentsForPreview();
34+
const [selectedModel, setSelectedModel] = useState<string>();
3535

3636
useEffect(() => {
3737
if (!composer) return;
@@ -73,6 +73,7 @@ export const MessageInputBar = () => {
7373

7474
const message = formData.get('message');
7575
const model = formData.get('model');
76+
setSelectedModel(model as string);
7677

7778
composer.textComposer.setText(message as string);
7879

@@ -131,7 +132,7 @@ export const MessageInputBar = () => {
131132
<div style={{ display: 'flex', gap: '.25rem', alignItems: 'center' }}>
132133
<AIMessageComposer.FileInput name="attachments" />
133134
<AIMessageComposer.SpeechToTextButton />
134-
<AIMessageComposer.ModelSelect name="model" />
135+
<AIMessageComposer.ModelSelect name="model" value={selectedModel} />
135136
</div>
136137

137138
<AIMessageComposer.SubmitButton active={attachments.length > 0} />

examples/react-chatbot/components/Sidebar/Sidebar.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ interface SidebarProps {
1414
onClose: () => void;
1515
}
1616

17+
const NoOp = () => null;
18+
1719
export const Sidebar = ({
1820
filters,
1921
options,
@@ -34,6 +36,7 @@ export const Sidebar = ({
3436
<ChannelList
3537
setActiveChannelOnMount={false}
3638
Preview={ChannelPreviewItem}
39+
EmptyStateIndicator={NoOp}
3740
filters={filters}
3841
options={options}
3942
sort={sort}

0 commit comments

Comments
 (0)