Skip to content

Commit 93f43c0

Browse files
committed
chore: extract indicator styles in theme
1 parent 6c43b89 commit 93f43c0

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

package/src/components/AITypingIndicatorView/AITypingIndicatorView.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22

3-
import { Text, View } from 'react-native';
3+
import { StyleSheet, Text, View } from 'react-native';
44

55
import { Channel } from 'stream-chat';
66

@@ -31,15 +31,20 @@ export const AITypingIndicatorView = <
3131

3232
const {
3333
theme: {
34+
aiTypingIndicatorView: { container, text },
3435
colors: { black, grey_gainsboro },
3536
},
3637
} = useTheme();
3738

3839
return aiState in allowedStates ? (
39-
<View style={{ backgroundColor: grey_gainsboro, paddingHorizontal: 16, paddingVertical: 18 }}>
40-
<Text style={{ color: black }}>{allowedStates[aiState]}</Text>
40+
<View style={[styles.container, { backgroundColor: grey_gainsboro }, container]}>
41+
<Text style={[{ color: black }, text]}>{allowedStates[aiState]}</Text>
4142
</View>
4243
) : null;
4344
};
4445

4546
AITypingIndicatorView.displayName = 'AITypingIndicatorView{messageSimple{content}}';
47+
48+
const styles = StyleSheet.create({
49+
container: { paddingHorizontal: 16, paddingVertical: 18 },
50+
});

package/src/contexts/themeContext/utils/theme.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ export type MarkdownStyle = Partial<{
9090
}>;
9191

9292
export type Theme = {
93+
aiTypingIndicatorView: {
94+
container: ViewStyle;
95+
text: TextStyle;
96+
};
9397
attachmentPicker: {
9498
bottomSheetContentContainer: ViewStyle;
9599
durationText: TextStyle;
@@ -813,6 +817,10 @@ export type Theme = {
813817
};
814818

815819
export const defaultTheme: Theme = {
820+
aiTypingIndicatorView: {
821+
container: {},
822+
text: {},
823+
},
816824
attachmentPicker: {
817825
bottomSheetContentContainer: {},
818826
durationText: {},

0 commit comments

Comments
 (0)