Skip to content

Commit ad085de

Browse files
committed
chore: update naming
1 parent 51298fc commit ad085de

File tree

8 files changed

+17
-16
lines changed

8 files changed

+17
-16
lines changed

packages/uikit-react-native-foundation/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export { default as Header } from './ui/Header';
3333
export { default as LoadingSpinner } from './ui/LoadingSpinner';
3434
export { default as MenuBar } from './ui/MenuBar';
3535
export type { MenuBarProps } from './ui/MenuBar';
36-
export { default as MessageTypingBubble } from './ui/MessageTypingBubble';
3736
export { default as OpenChannelMessage } from './ui/OpenChannelMessage';
3837
export type { OpenChannelMessageProps } from './ui/OpenChannelMessage';
3938
export { default as OpenChannelPreview } from './ui/OpenChannelPreview';
@@ -42,6 +41,7 @@ export { default as Placeholder } from './ui/Placeholder';
4241
export { default as ProfileCard } from './ui/ProfileCard';
4342
export { default as Prompt } from './ui/Prompt';
4443
export { default as Toast, useToast, ToastProvider } from './ui/Toast';
44+
export { default as TypingIndicatorBubble } from './ui/TypingIndicatorBubble';
4545

4646
/** Styles **/
4747
export { default as createSelectByColorScheme } from './styles/createSelectByColorScheme';

packages/uikit-react-native-foundation/src/ui/MessageTypingBubble/index.tsx renamed to packages/uikit-react-native-foundation/src/ui/TypingIndicatorBubble/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type Props = {
1414
maxAvatar?: number;
1515
};
1616

17-
const MessageTypingBubble = ({ typingUsers, containerStyle, maxAvatar }: Props) => {
17+
const TypingIndicatorBubble = ({ typingUsers, containerStyle, maxAvatar }: Props) => {
1818
const { select, palette, colors } = useUIKitTheme();
1919

2020
if (typingUsers.length === 0) return null;
@@ -117,4 +117,4 @@ const styles = createStyleSheet({
117117
},
118118
});
119119

120-
export default MessageTypingBubble;
120+
export default TypingIndicatorBubble;

packages/uikit-react-native/src/components/GroupChannelMessageRenderer/index.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import type { GroupChannelMessageProps, RegexTextPattern } from '@sendbird/uikit
44
import {
55
Box,
66
GroupChannelMessage,
7-
MessageTypingBubble,
87
Text,
8+
TypingIndicatorBubble,
99
useUIKitTheme,
1010
} from '@sendbird/uikit-react-native-foundation';
1111
import {
@@ -27,6 +27,7 @@ import { GroupChannelContexts } from '../../domain/groupChannel/module/moduleCon
2727
import type { GroupChannelProps } from '../../domain/groupChannel/types';
2828
import { useLocalization, usePlatformService, useSendbirdChat } from '../../hooks/useContext';
2929
import SBUUtils from '../../libs/SBUUtils';
30+
import { TypingIndicatorType } from '../../types';
3031
import { ReactionAddons } from '../ReactionAddons';
3132
import GroupChannelMessageDateSeparator from './GroupChannelMessageDateSeparator';
3233
import GroupChannelMessageFocusAnimation from './GroupChannelMessageFocusAnimation';
@@ -299,17 +300,17 @@ const GroupChannelMessageRenderer: GroupChannelProps['Fragment']['renderMessage'
299300
);
300301
};
301302

302-
export const GroupChannelMessageTypingBubble = () => {
303+
export const GroupChannelTypingIndicatorBubble = () => {
303304
const { sbOptions } = useSendbirdChat();
304305
const { typingUsers } = useContext(GroupChannelContexts.TypingIndicator);
305306

306307
if (typingUsers.length === 0) return null;
307308
if (!sbOptions.uikit.groupChannel.channel.enableTypingIndicator) return null;
308-
if (!sbOptions.uikit.groupChannel.channel.typingIndicatorTypes.has('bubble')) return null;
309+
if (!sbOptions.uikit.groupChannel.channel.typingIndicatorTypes.has(TypingIndicatorType.Bubble)) return null;
309310

310311
return (
311312
<Box paddingHorizontal={16} marginTop={4} marginBottom={16}>
312-
<MessageTypingBubble typingUsers={typingUsers} />
313+
<TypingIndicatorBubble typingUsers={typingUsers} />
313314
</Box>
314315
);
315316
};

packages/uikit-react-native/src/constants.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,3 @@ export const MESSAGE_FOCUS_ANIMATION_DELAY = 250;
55
export const UNKNOWN_USER_ID = '##__USER_ID_IS_NOT_PROVIDED__##';
66
export const VOICE_MESSAGE_META_ARRAY_DURATION_KEY = 'KEY_VOICE_MESSAGE_DURATION';
77
export const VOICE_MESSAGE_META_ARRAY_MESSAGE_TYPE_KEY = 'KEY_INTERNAL_MESSAGE_TYPE';
8-
9-
export enum TypingIndicatorType {
10-
Text = 'text',
11-
Bubble = 'bubble',
12-
}

packages/uikit-react-native/src/domain/groupChannel/component/GroupChannelHeader.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { Header, Icon, createStyleSheet, useHeaderStyle } from '@sendbird/uikit-
55

66
import ChannelCover from '../../../components/ChannelCover';
77
import { useLocalization, useSendbirdChat } from '../../../hooks/useContext';
8+
import { TypingIndicatorType } from '../../../types';
89
import { GroupChannelContexts } from '../module/moduleContext';
910
import type { GroupChannelProps } from '../types';
1011

@@ -24,7 +25,7 @@ const GroupChannelHeader = ({
2425

2526
if (!subtitle) return null;
2627
if (!sbOptions.uikit.groupChannel.channel.enableTypingIndicator) return null;
27-
if (!sbOptions.uikit.groupChannel.channel.typingIndicatorTypes.has('text')) return null;
28+
if (!sbOptions.uikit.groupChannel.channel.typingIndicatorTypes.has(TypingIndicatorType.Text)) return null;
2829

2930
return <Header.Subtitle style={styles.subtitle}>{subtitle}</Header.Subtitle>;
3031
};

packages/uikit-react-native/src/fragments/createGroupChannelFragment.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
} from '@sendbird/uikit-utils';
1717

1818
import GroupChannelMessageRenderer, {
19-
GroupChannelMessageTypingBubble,
19+
GroupChannelTypingIndicatorBubble,
2020
} from '../components/GroupChannelMessageRenderer';
2121
import NewMessagesButton from '../components/NewMessagesButton';
2222
import ScrollToBottomButton from '../components/ScrollToBottomButton';
@@ -130,7 +130,7 @@ const createGroupChannelFragment = (initModule?: Partial<GroupChannelModule>): G
130130
return (
131131
<Box>
132132
{content}
133-
{props.isFirstItem && !hasNext() && <GroupChannelMessageTypingBubble />}
133+
{props.isFirstItem && !hasNext() && <GroupChannelTypingIndicatorBubble />}
134134
</Box>
135135
);
136136
});

packages/uikit-react-native/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ export { default as SendbirdUIKitContainer, SendbirdUIKit } from './containers/S
134134
export type { SendbirdUIKitContainerProps } from './containers/SendbirdUIKitContainer';
135135
export { default as SBUError } from './libs/SBUError';
136136
export { default as SBUUtils } from './libs/SBUUtils';
137-
export { TypingIndicatorType } from './constants';
138137
export * from './types';
139138

140139
Logger.setLogLevel(__DEV__ ? 'warn' : 'none');

packages/uikit-react-native/src/types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,8 @@ export type Range = {
2828
start: number;
2929
end: number;
3030
};
31+
32+
export enum TypingIndicatorType {
33+
Text = 'text',
34+
Bubble = 'bubble',
35+
}

0 commit comments

Comments
 (0)