Skip to content

Commit 2a2622a

Browse files
committed
fix: improvements in ui and typewriter
1 parent a30b8fd commit 2a2622a

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

package/src/components/AITypingIndicatorView/AITypingIndicatorView.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Channel } from 'stream-chat';
66

77
import { AIStates, useAIState } from './hooks/useAIState';
88

9-
import { useChannelContext } from '../../contexts';
9+
import { useChannelContext, useTheme } from '../../contexts';
1010
import type { DefaultStreamChatGenerics } from '../../types/types';
1111

1212
export const AITypingIndicatorView = <
@@ -25,10 +25,15 @@ export const AITypingIndicatorView = <
2525
[AIStates.Generating]: 'Generating...',
2626
};
2727

28-
// TODO: Make it not ugly.
28+
const {
29+
theme: {
30+
colors: { black, grey_gainsboro },
31+
},
32+
} = useTheme();
33+
2934
return aiState in allowedStates ? (
30-
<View style={{ paddingHorizontal: 16, paddingVertical: 18 }}>
31-
<Text>{allowedStates[aiState]}</Text>
35+
<View style={{ backgroundColor: grey_gainsboro, paddingHorizontal: 16, paddingVertical: 18 }}>
36+
<Text style={{ color: black }}>{allowedStates[aiState]}</Text>
3237
</View>
3338
) : null;
3439
};

package/src/components/Message/MessageSimple/StreamingMessageView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const StreamingMessageView = <
2222
clearInterval(interval);
2323
}
2424
// TODO: make this configurable maybe
25-
const newCursorValue = textCursor.current + 1;
25+
const newCursorValue = textCursor.current + 2;
2626
const newText = text.substring(0, newCursorValue);
2727
textCursor.current += newText.length - textCursor.current;
2828
setStreamedMessageText(newText);

0 commit comments

Comments
 (0)