react-native-gifted-chat 2.6.4 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -16
- package/lib/Actions.d.ts +0 -11
- package/lib/Actions.js +2 -14
- package/lib/Actions.js.map +1 -1
- package/lib/Avatar.d.ts +1 -23
- package/lib/Avatar.js +32 -40
- package/lib/Avatar.js.map +1 -1
- package/lib/Bubble/index.d.ts +30 -0
- package/lib/{Bubble.js → Bubble/index.js} +31 -181
- package/lib/Bubble/index.js.map +1 -0
- package/lib/Bubble/styles.d.ts +69 -0
- package/lib/Bubble/styles.js +72 -0
- package/lib/Bubble/styles.js.map +1 -0
- package/lib/Bubble/types.d.ts +47 -0
- package/lib/Bubble/types.js +2 -0
- package/lib/Bubble/types.js.map +1 -0
- package/lib/Composer.d.ts +0 -17
- package/lib/Composer.js +3 -18
- package/lib/Composer.js.map +1 -1
- package/lib/Constant.d.ts +1 -1
- package/lib/Constant.js +1 -1
- package/lib/Constant.js.map +1 -1
- package/lib/Day/index.d.ts +4 -0
- package/lib/Day/index.js +39 -0
- package/lib/Day/index.js.map +1 -0
- package/lib/Day/styles.d.ts +20 -0
- package/lib/Day/styles.js +22 -0
- package/lib/Day/styles.js.map +1 -0
- package/lib/Day/types.d.ts +9 -0
- package/lib/Day/types.js +2 -0
- package/lib/Day/types.js.map +1 -0
- package/lib/GiftedAvatar.d.ts +1 -11
- package/lib/GiftedAvatar.js +26 -33
- package/lib/GiftedAvatar.js.map +1 -1
- package/lib/GiftedChat/index.d.ts +26 -0
- package/lib/{GiftedChat.js → GiftedChat/index.js} +58 -59
- package/lib/GiftedChat/index.js.map +1 -0
- package/lib/GiftedChat/styles.d.ts +6 -0
- package/lib/GiftedChat/styles.js +7 -0
- package/lib/GiftedChat/styles.js.map +1 -0
- package/lib/{GiftedChat.d.ts → GiftedChat/types.d.ts} +29 -37
- package/lib/GiftedChat/types.js +2 -0
- package/lib/GiftedChat/types.js.map +1 -0
- package/lib/InputToolbar.d.ts +1 -14
- package/lib/InputToolbar.js +0 -12
- package/lib/InputToolbar.js.map +1 -1
- package/lib/LoadEarlier.d.ts +0 -14
- package/lib/LoadEarlier.js +2 -16
- package/lib/LoadEarlier.js.map +1 -1
- package/lib/Message/index.d.ts +6 -0
- package/lib/Message/index.js +85 -0
- package/lib/Message/index.js.map +1 -0
- package/lib/Message/styles.d.ts +21 -0
- package/lib/Message/styles.js +22 -0
- package/lib/Message/styles.js.map +1 -0
- package/lib/Message/types.d.ts +22 -0
- package/lib/Message/types.js +2 -0
- package/lib/Message/types.js.map +1 -0
- package/lib/MessageAudio.js +1 -2
- package/lib/MessageAudio.js.map +1 -1
- package/lib/MessageContainer/components/DayAnimated/index.d.ts +5 -0
- package/lib/MessageContainer/components/DayAnimated/index.js +85 -0
- package/lib/MessageContainer/components/DayAnimated/index.js.map +1 -0
- package/lib/MessageContainer/components/DayAnimated/styles.d.ts +11 -0
- package/lib/MessageContainer/components/DayAnimated/styles.js +12 -0
- package/lib/MessageContainer/components/DayAnimated/styles.js.map +1 -0
- package/lib/MessageContainer/components/DayAnimated/types.d.ts +17 -0
- package/lib/MessageContainer/components/DayAnimated/types.js +2 -0
- package/lib/MessageContainer/components/DayAnimated/types.js.map +1 -0
- package/lib/MessageContainer/components/Item/index.d.ts +22 -0
- package/lib/MessageContainer/components/Item/index.js +69 -0
- package/lib/MessageContainer/components/Item/index.js.map +1 -0
- package/lib/MessageContainer/components/Item/types.d.ts +18 -0
- package/lib/MessageContainer/components/Item/types.js +2 -0
- package/lib/MessageContainer/components/Item/types.js.map +1 -0
- package/lib/MessageContainer/index.d.ts +6 -0
- package/lib/MessageContainer/index.js +175 -0
- package/lib/MessageContainer/index.js.map +1 -0
- package/lib/MessageContainer/styles.d.ts +34 -0
- package/lib/MessageContainer/styles.js +31 -0
- package/lib/MessageContainer/styles.js.map +1 -0
- package/lib/MessageContainer/types.d.ts +54 -0
- package/lib/MessageContainer/types.js +2 -0
- package/lib/MessageContainer/types.js.map +1 -0
- package/lib/MessageImage.d.ts +1 -12
- package/lib/MessageImage.js +2 -12
- package/lib/MessageImage.js.map +1 -1
- package/lib/MessageText.d.ts +1 -24
- package/lib/MessageText.js +0 -22
- package/lib/MessageText.js.map +1 -1
- package/lib/MessageVideo.js +1 -2
- package/lib/MessageVideo.js.map +1 -1
- package/lib/QuickReplies.d.ts +1 -12
- package/lib/QuickReplies.js +10 -20
- package/lib/QuickReplies.js.map +1 -1
- package/lib/Send.d.ts +2 -16
- package/lib/Send.js +0 -13
- package/lib/Send.js.map +1 -1
- package/lib/SystemMessage.d.ts +1 -10
- package/lib/SystemMessage.js +2 -12
- package/lib/SystemMessage.js.map +1 -1
- package/lib/Time.d.ts +1 -17
- package/lib/Time.js +0 -15
- package/lib/Time.js.map +1 -1
- package/lib/TypingIndicator/index.d.ts +5 -0
- package/lib/{TypingIndicator.js → TypingIndicator/index.js} +9 -30
- package/lib/TypingIndicator/index.js.map +1 -0
- package/lib/TypingIndicator/styles.d.ts +20 -0
- package/lib/TypingIndicator/styles.js +22 -0
- package/lib/TypingIndicator/styles.js.map +1 -0
- package/lib/TypingIndicator/types.d.ts +3 -0
- package/lib/TypingIndicator/types.js +2 -0
- package/lib/TypingIndicator/types.js.map +1 -0
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -1
- package/lib/index.js.map +1 -1
- package/lib/styles.d.ts +10 -0
- package/lib/styles.js +11 -0
- package/lib/styles.js.map +1 -0
- package/lib/{Models.d.ts → types.d.ts} +1 -1
- package/lib/types.js +2 -0
- package/lib/types.js.map +1 -0
- package/lib/utils.d.ts +1 -3
- package/lib/utils.js +0 -7
- package/lib/utils.js.map +1 -1
- package/package.json +30 -34
- package/src/Actions.tsx +3 -15
- package/src/Avatar.tsx +43 -52
- package/src/{Bubble.tsx → Bubble/index.tsx} +53 -270
- package/src/Bubble/styles.ts +73 -0
- package/src/Bubble/types.ts +90 -0
- package/src/Composer.tsx +3 -19
- package/src/Constant.ts +1 -1
- package/src/Day/index.tsx +63 -0
- package/src/Day/styles.ts +22 -0
- package/src/Day/types.ts +14 -0
- package/src/GiftedAvatar.tsx +31 -38
- package/src/GiftedChat/index.tsx +503 -0
- package/src/GiftedChat/styles.ts +7 -0
- package/src/GiftedChat/types.ts +206 -0
- package/src/InputToolbar.tsx +1 -14
- package/src/LoadEarlier.tsx +2 -17
- package/src/Message/index.tsx +135 -0
- package/src/Message/styles.ts +22 -0
- package/src/Message/types.ts +26 -0
- package/src/MessageAudio.tsx +1 -4
- package/src/MessageContainer/components/DayAnimated/index.tsx +143 -0
- package/src/MessageContainer/components/DayAnimated/styles.ts +12 -0
- package/src/MessageContainer/components/DayAnimated/types.ts +12 -0
- package/src/MessageContainer/components/Item/index.tsx +136 -0
- package/src/MessageContainer/components/Item/types.ts +13 -0
- package/src/MessageContainer/index.tsx +316 -0
- package/src/MessageContainer/styles.ts +31 -0
- package/src/MessageContainer/types.ts +60 -0
- package/src/MessageImage.tsx +3 -14
- package/src/MessageText.tsx +2 -25
- package/src/MessageVideo.tsx +1 -4
- package/src/QuickReplies.tsx +14 -25
- package/src/Send.tsx +1 -15
- package/src/SystemMessage.tsx +3 -14
- package/src/Time.tsx +1 -17
- package/src/{TypingIndicator.tsx → TypingIndicator/index.tsx} +12 -35
- package/src/TypingIndicator/styles.ts +22 -0
- package/src/TypingIndicator/types.ts +3 -0
- package/src/__tests__/Bubble.test.tsx +7 -4
- package/src/__tests__/GiftedAvatar.test.tsx +6 -2
- package/src/__tests__/GiftedChat.test.tsx +20 -14
- package/src/__tests__/Message.test.tsx +4 -1
- package/src/__tests__/__snapshots__/Actions.test.tsx.snap +6 -2
- package/src/__tests__/__snapshots__/Bubble.test.tsx.snap +3 -1
- package/src/__tests__/__snapshots__/Composer.test.tsx.snap +2 -0
- package/src/__tests__/__snapshots__/Constant.test.tsx.snap +1 -1
- package/src/__tests__/__snapshots__/Day.test.tsx.snap +1 -33
- package/src/__tests__/__snapshots__/GiftedAvatar.test.tsx.snap +4 -2
- package/src/__tests__/__snapshots__/GiftedChat.test.tsx.snap +22 -9
- package/src/__tests__/__snapshots__/InputToolbar.test.tsx.snap +2 -0
- package/src/__tests__/__snapshots__/LoadEarlier.test.tsx.snap +3 -1
- package/src/__tests__/__snapshots__/Message.test.tsx.snap +21 -100
- package/src/__tests__/__snapshots__/MessageContainer.test.tsx.snap +282 -82
- package/src/__tests__/__snapshots__/MessageImage.test.tsx.snap +8 -4
- package/src/__tests__/__snapshots__/SystemMessage.test.tsx.snap +5 -1
- package/src/__tests__/data.ts +1 -1
- package/src/index.ts +0 -2
- package/src/styles.ts +11 -0
- package/src/{Models.ts → types.ts} +1 -1
- package/src/utils.ts +1 -9
- package/example_bare/vendor/bundle/ruby/2.7.0/gems/ffi-1.17.0/ext/ffi_c/libffi/.ci/compile +0 -351
- package/example_bare/vendor/bundle/ruby/2.7.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/libffi.bhaible/Makefile +0 -28
- package/lib/Actions.js.flow +0 -21
- package/lib/Avatar.js.flow +0 -27
- package/lib/Bubble.d.ts +0 -148
- package/lib/Bubble.js.flow +0 -69
- package/lib/Bubble.js.map +0 -1
- package/lib/Composer.js.flow +0 -24
- package/lib/Day.d.ts +0 -15
- package/lib/Day.js +0 -36
- package/lib/Day.js.flow +0 -23
- package/lib/Day.js.map +0 -1
- package/lib/GiftedAvatar.js.flow +0 -17
- package/lib/GiftedChat.js.flow +0 -163
- package/lib/GiftedChat.js.map +0 -1
- package/lib/InputToolbar.js.flow +0 -31
- package/lib/LoadEarlier.js.flow +0 -20
- package/lib/Message.d.ts +0 -67
- package/lib/Message.js +0 -157
- package/lib/Message.js.flow +0 -32
- package/lib/Message.js.map +0 -1
- package/lib/MessageAudio.js.flow +0 -15
- package/lib/MessageContainer.d.ts +0 -103
- package/lib/MessageContainer.js +0 -224
- package/lib/MessageContainer.js.flow +0 -39
- package/lib/MessageContainer.js.map +0 -1
- package/lib/MessageImage.js.flow +0 -20
- package/lib/MessageText.js.flow +0 -23
- package/lib/MessageVideo.js.flow +0 -16
- package/lib/Models.js +0 -2
- package/lib/Models.js.map +0 -1
- package/lib/QuickReplies.js.flow +0 -25
- package/lib/Send.js.flow +0 -19
- package/lib/SystemMessage.js.flow +0 -18
- package/lib/Time.js.flow +0 -19
- package/lib/TypingIndicator.d.ts +0 -6
- package/lib/TypingIndicator.js.map +0 -1
- package/lib/index.js.flow +0 -2
- package/lib/types.js.flow +0 -43
- package/lib/utils.js.flow +0 -16
- package/src/Day.tsx +0 -71
- package/src/GiftedChat.tsx +0 -678
- package/src/Message.tsx +0 -229
- package/src/MessageContainer.tsx +0 -359
package/README.md
CHANGED
|
@@ -105,18 +105,18 @@
|
|
|
105
105
|
|
|
106
106
|
Yarn:
|
|
107
107
|
```bash
|
|
108
|
-
yarn add react-native-gifted-chat
|
|
108
|
+
yarn add react-native-gifted-chat @shopify/flash-list react-native-reanimated react-native-keyboard-controller
|
|
109
109
|
```
|
|
110
110
|
|
|
111
111
|
Npm:
|
|
112
112
|
|
|
113
113
|
```bash
|
|
114
|
-
npm install --save react-native-gifted-chat
|
|
114
|
+
npm install --save react-native-gifted-chat @shopify/flash-list react-native-reanimated react-native-keyboard-controller
|
|
115
115
|
```
|
|
116
116
|
|
|
117
117
|
Expo
|
|
118
118
|
```bash
|
|
119
|
-
npx expo install react-native-gifted-chat
|
|
119
|
+
npx expo install react-native-gifted-chat @shopify/flash-list react-native-reanimated react-native-keyboard-controller
|
|
120
120
|
```
|
|
121
121
|
|
|
122
122
|
### Non-expo users
|
|
@@ -125,19 +125,10 @@ npx expo install react-native-gifted-chat react-native-reanimated react-native-s
|
|
|
125
125
|
npx pod-install
|
|
126
126
|
```
|
|
127
127
|
|
|
128
|
-
### Setup react-native-safe-area-context
|
|
129
|
-
|
|
130
|
-
Follow guide: [react-native-safe-area-context](https://github.com/th3rdwave/react-native-safe-area-context?tab=readme-ov-file#api)
|
|
131
|
-
|
|
132
128
|
### Setup react-native-reanimated
|
|
133
129
|
|
|
134
130
|
Follow guide: [react-native-reanimated](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started/#step-2-add-reanimateds-babel-plugin)
|
|
135
131
|
|
|
136
|
-
### react-native-video and expo-av
|
|
137
|
-
|
|
138
|
-
- Both dependencies are removed since `0.11.0`.
|
|
139
|
-
- You still be able to provide a `video` but you need to provide `renderMessageVideo` prop.
|
|
140
|
-
|
|
141
132
|
## Testing
|
|
142
133
|
`TEST_ID` is exported as constants that can be used in your testing library of choice
|
|
143
134
|
|
|
@@ -347,10 +338,11 @@ interface QuickReplies {
|
|
|
347
338
|
|
|
348
339
|
## Props
|
|
349
340
|
|
|
350
|
-
- **`messageContainerRef`** _(
|
|
341
|
+
- **`messageContainerRef`** _(FlashList ref)_ - Ref to the flashlist
|
|
351
342
|
- **`textInputRef`** _(TextInput ref)_ - Ref to the text input
|
|
352
343
|
- **`messages`** _(Array)_ - Messages to display
|
|
353
344
|
- **`isTyping`** _(Bool)_ - Typing Indicator state; default `false`. If you use`renderFooter` it will override this.
|
|
345
|
+
- **`isKeyboardInternallyHandled`** _(Bool)_ - Determine whether to handle keyboard awareness inside the plugin. If you have your own keyboard handling outside the plugin set this to false; default is `true`
|
|
354
346
|
- **`text`** _(String)_ - Input text; default is `undefined`, but if specified, it will override GiftedChat's internal state (e.g. for redux; [see notes below](#notes-for-redux))
|
|
355
347
|
- **`placeholder`** _(String)_ - Placeholder when `text` is empty; default is `'Type a message...'`
|
|
356
348
|
- **`messageIdGenerator`** _(Function)_ - Generate an id for new messages. Defaults to UUID v4, generated by [uuid](https://github.com/kelektiv/node-uuid)
|
|
@@ -359,7 +351,8 @@ interface QuickReplies {
|
|
|
359
351
|
- **`alwaysShowSend`** _(Bool)_ - Always show send button in input text composer; default `false`, show only when text input is not empty
|
|
360
352
|
- **`locale`** _(String)_ - Locale to localize the dates. You need first to import the locale you need (ie. `require('dayjs/locale/de')` or `import 'dayjs/locale/fr'`)
|
|
361
353
|
- **`timeFormat`** _(String)_ - Format to use for rendering times; default is `'LT'` (see [Day.js Format](https://day.js.org/docs/en/display/format))
|
|
362
|
-
- **`dateFormat`** _(String)_ - Format to use for rendering dates; default is `'
|
|
354
|
+
- **`dateFormat`** _(String)_ - Format to use for rendering dates; default is `'D MMMM'` (see [Day.js Format](https://day.js.org/docs/en/display/format))
|
|
355
|
+
- **`dateFormatCalendar`** _(String)_ - Format to use for rendering relative times; Today - for now (see [Day.js Calendar](https://day.js.org/docs/en/plugin/calendar))
|
|
363
356
|
- **`loadEarlier`** _(Bool)_ - Enables the "load earlier messages" button, required for `infiniteScroll`
|
|
364
357
|
- **`onLoadEarlier`** _(Function)_ - Callback when loading earlier messages
|
|
365
358
|
- **`isLoadingEarlier`** _(Bool)_ - Display an `ActivityIndicator` when loading earlier messages
|
|
@@ -400,6 +393,7 @@ interface QuickReplies {
|
|
|
400
393
|
- **`renderAccessory`** _(Function)_ - Custom second line of actions below the message composer
|
|
401
394
|
- **`onPressActionButton`** _(Function)_ - Callback when the Action button is pressed (if set, the default `actionSheet` will not be used)
|
|
402
395
|
- **`bottomOffset`** _(Integer)_ - Distance of the chat from the bottom of the screen (e.g. useful if you display a tab bar)
|
|
396
|
+
- **`focusOnInputWhenOpeningKeyboard`** _(Bool)_ - Focus on <TextInput> automatically when opening the keyboard; default `true`
|
|
403
397
|
- **`minInputToolbarHeight`** _(Integer)_ - Minimum height of the input toolbar; default is `44`
|
|
404
398
|
- **`listViewProps`** _(Object)_ - Extra props to be passed to the messages [`<ListView>`](https://facebook.github.io/react-native/docs/listview.html); some props can't be overridden, see the code in `MessageContainer.render()` for details
|
|
405
399
|
- **`textInputProps`** _(Object)_ - Extra props to be passed to the [`<TextInput>`](https://facebook.github.io/react-native/docs/textinput.html)
|
|
@@ -419,7 +413,7 @@ interface QuickReplies {
|
|
|
419
413
|
/>
|
|
420
414
|
```
|
|
421
415
|
|
|
422
|
-
- **`extraData`** _(Object)_ - Extra props for re-rendering
|
|
416
|
+
- **`extraData`** _(Object)_ - Extra props for re-rendering FlashList on demand. This will be useful for rendering footer etc.
|
|
423
417
|
- **`minComposerHeight`** _(Object)_ - Custom min-height of the composer.
|
|
424
418
|
- **`maxComposerHeight`** _(Object)_ - Custom max height of the composer.
|
|
425
419
|
|
|
@@ -434,7 +428,6 @@ interface QuickReplies {
|
|
|
434
428
|
* **`renderQuickReplySend`** _(Function)_ - Custom quick reply **send** view
|
|
435
429
|
* **`shouldUpdateMessage`** _(Function)_ - Lets the message component know when to update outside of normal cases.
|
|
436
430
|
* **`infiniteScroll`** _(Bool)_ - infinite scroll up when reach the top of messages container, automatically call onLoadEarlier function if exist (not yet supported for the web). You need to add `loadEarlier` prop too.
|
|
437
|
-
* **`isStatusBarTranslucentAndroid`** _(Bool)_ - If you use translucent status bar on Android, set this option to true. Ignored on iOS.
|
|
438
431
|
|
|
439
432
|
## Notes for [Redux](https://github.com/reactjs/redux)
|
|
440
433
|
|
package/lib/Actions.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
1
|
import React, { ReactNode } from 'react';
|
|
3
2
|
import { StyleProp, ViewStyle, TextStyle } from 'react-native';
|
|
4
3
|
export interface ActionsProps {
|
|
@@ -13,13 +12,3 @@ export interface ActionsProps {
|
|
|
13
12
|
onPressActionButton?(): void;
|
|
14
13
|
}
|
|
15
14
|
export declare function Actions({ options, optionTintColor, icon, wrapperStyle, iconTextStyle, onPressActionButton, containerStyle, }: ActionsProps): React.JSX.Element;
|
|
16
|
-
export declare namespace Actions {
|
|
17
|
-
var propTypes: {
|
|
18
|
-
options: PropTypes.Requireable<object>;
|
|
19
|
-
optionTintColor: PropTypes.Requireable<string>;
|
|
20
|
-
icon: PropTypes.Requireable<(...args: any[]) => any>;
|
|
21
|
-
onPressActionButton: PropTypes.Requireable<(...args: any[]) => any>;
|
|
22
|
-
wrapperStyle: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
|
|
23
|
-
containerStyle: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
|
|
24
|
-
};
|
|
25
|
-
}
|
package/lib/Actions.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
1
|
import React, { useCallback } from 'react';
|
|
3
2
|
import { StyleSheet, Text, TouchableOpacity, View, } from 'react-native';
|
|
4
3
|
import Color from './Color';
|
|
5
|
-
import { StylePropType } from './utils';
|
|
6
4
|
import { useChatContext } from './GiftedChatContext';
|
|
5
|
+
import stylesCommon from './styles';
|
|
7
6
|
export function Actions({ options, optionTintColor = Color.optionTintColor, icon, wrapperStyle, iconTextStyle, onPressActionButton, containerStyle, }) {
|
|
8
7
|
const { actionSheet } = useChatContext();
|
|
9
8
|
const onActionsPress = useCallback(() => {
|
|
@@ -26,7 +25,7 @@ export function Actions({ options, optionTintColor = Color.optionTintColor, icon
|
|
|
26
25
|
const renderIcon = useCallback(() => {
|
|
27
26
|
if (icon)
|
|
28
27
|
return icon();
|
|
29
|
-
return (<View style={[styles.wrapper, wrapperStyle]}>
|
|
28
|
+
return (<View style={[stylesCommon.fill, stylesCommon.centerItems, styles.wrapper, wrapperStyle]}>
|
|
30
29
|
<Text style={[styles.iconText, iconTextStyle]}>{'+'}</Text>
|
|
31
30
|
</View>);
|
|
32
31
|
}, [icon, iconTextStyle, wrapperStyle]);
|
|
@@ -34,14 +33,6 @@ export function Actions({ options, optionTintColor = Color.optionTintColor, icon
|
|
|
34
33
|
{renderIcon()}
|
|
35
34
|
</TouchableOpacity>);
|
|
36
35
|
}
|
|
37
|
-
Actions.propTypes = {
|
|
38
|
-
options: PropTypes.object,
|
|
39
|
-
optionTintColor: PropTypes.string,
|
|
40
|
-
icon: PropTypes.func,
|
|
41
|
-
onPressActionButton: PropTypes.func,
|
|
42
|
-
wrapperStyle: StylePropType,
|
|
43
|
-
containerStyle: StylePropType,
|
|
44
|
-
};
|
|
45
36
|
const styles = StyleSheet.create({
|
|
46
37
|
container: {
|
|
47
38
|
width: 26,
|
|
@@ -53,9 +44,6 @@ const styles = StyleSheet.create({
|
|
|
53
44
|
borderRadius: 13,
|
|
54
45
|
borderColor: Color.defaultColor,
|
|
55
46
|
borderWidth: 2,
|
|
56
|
-
flex: 1,
|
|
57
|
-
alignItems: 'center',
|
|
58
|
-
justifyContent: 'center',
|
|
59
47
|
},
|
|
60
48
|
iconText: {
|
|
61
49
|
color: Color.defaultColor,
|
package/lib/Actions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.js","sourceRoot":"","sources":["../src/Actions.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Actions.js","sourceRoot":"","sources":["../src/Actions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAa,WAAW,EAAE,MAAM,OAAO,CAAA;AACrD,OAAO,EACL,UAAU,EACV,IAAI,EACJ,gBAAgB,EAChB,IAAI,GAIL,MAAM,cAAc,CAAA;AACrB,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEpD,OAAO,YAAY,MAAM,UAAU,CAAA;AAYnC,MAAM,UAAU,OAAO,CAAE,EACvB,OAAO,EACP,eAAe,GAAG,KAAK,CAAC,eAAe,EACvC,IAAI,EACJ,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,cAAc,GACD;IACb,MAAM,EAAE,WAAW,EAAE,GAAG,cAAc,EAAE,CAAA;IAExC,MAAM,cAAc,GAAG,WAAW,CAAC,GAAG,EAAE;QACtC,IAAI,CAAC,OAAO;YACV,OAAM;QAER,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QACvC,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;QAEtD,WAAW,EAAE,CAAC,0BAA0B,CACtC;YACE,OAAO,EAAE,UAAU;YACnB,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E;QACP,YAAY,EAAE,EAAE;QAChB,WAAW,EAAE,KAAK,CAAC,YAAY;QAC/B,WAAW,EAAE,CAAC;KACf;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,KAAK,CAAC,YAAY;QACzB,UAAU,EAAE,MAAM;QAClB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,EAAE;QACd,eAAe,EAAE,KAAK,CAAC,qBAAqB;QAC5C,SAAS,EAAE,QAAQ;KACpB;CACF,CAAC,CAAA"}
|
package/lib/Avatar.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
1
|
import React, { ReactNode } from 'react';
|
|
3
2
|
import { ImageStyle, TextStyle, ViewStyle } from 'react-native';
|
|
4
|
-
import { IMessage, LeftRightStyle, User } from './
|
|
3
|
+
import { IMessage, LeftRightStyle, User } from './types';
|
|
5
4
|
export interface AvatarProps<TMessage extends IMessage> {
|
|
6
5
|
currentMessage: TMessage;
|
|
7
6
|
previousMessage?: TMessage;
|
|
@@ -17,24 +16,3 @@ export interface AvatarProps<TMessage extends IMessage> {
|
|
|
17
16
|
onLongPressAvatar?: (user: User) => void;
|
|
18
17
|
}
|
|
19
18
|
export declare function Avatar<TMessage extends IMessage = IMessage>(props: AvatarProps<TMessage>): React.JSX.Element | null;
|
|
20
|
-
export declare namespace Avatar {
|
|
21
|
-
var propTypes: {
|
|
22
|
-
renderAvatarOnTop: PropTypes.Requireable<boolean>;
|
|
23
|
-
showAvatarForEveryMessage: PropTypes.Requireable<boolean>;
|
|
24
|
-
position: PropTypes.Requireable<string>;
|
|
25
|
-
currentMessage: PropTypes.Requireable<object>;
|
|
26
|
-
previousMessage: PropTypes.Requireable<object>;
|
|
27
|
-
nextMessage: PropTypes.Requireable<object>;
|
|
28
|
-
onPressAvatar: PropTypes.Requireable<(...args: any[]) => any>;
|
|
29
|
-
onLongPressAvatar: PropTypes.Requireable<(...args: any[]) => any>;
|
|
30
|
-
renderAvatar: PropTypes.Requireable<(...args: any[]) => any>;
|
|
31
|
-
containerStyle: PropTypes.Requireable<PropTypes.InferProps<{
|
|
32
|
-
left: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
|
|
33
|
-
right: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
|
|
34
|
-
}>>;
|
|
35
|
-
imageStyle: PropTypes.Requireable<PropTypes.InferProps<{
|
|
36
|
-
left: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
|
|
37
|
-
right: PropTypes.Requireable<NonNullable<number | boolean | object | null | undefined>>;
|
|
38
|
-
}>>;
|
|
39
|
-
};
|
|
40
|
-
}
|
package/lib/Avatar.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React from 'react';
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
3
2
|
import { StyleSheet, View, } from 'react-native';
|
|
4
3
|
import { GiftedAvatar } from './GiftedAvatar';
|
|
5
|
-
import {
|
|
4
|
+
import { isSameUser, isSameDay } from './utils';
|
|
6
5
|
const styles = {
|
|
7
6
|
left: StyleSheet.create({
|
|
8
7
|
container: {
|
|
@@ -34,23 +33,7 @@ const styles = {
|
|
|
34
33
|
export function Avatar(props) {
|
|
35
34
|
const { renderAvatarOnTop, showAvatarForEveryMessage, containerStyle, position, currentMessage, renderAvatar, previousMessage, nextMessage, imageStyle, onPressAvatar, onLongPressAvatar, } = props;
|
|
36
35
|
const messageToCompare = renderAvatarOnTop ? previousMessage : nextMessage;
|
|
37
|
-
|
|
38
|
-
return null;
|
|
39
|
-
if (!showAvatarForEveryMessage &&
|
|
40
|
-
currentMessage &&
|
|
41
|
-
messageToCompare &&
|
|
42
|
-
isSameUser(currentMessage, messageToCompare) &&
|
|
43
|
-
isSameDay(currentMessage, messageToCompare))
|
|
44
|
-
return (<View style={[
|
|
45
|
-
styles[position].container,
|
|
46
|
-
containerStyle?.[position],
|
|
47
|
-
]}>
|
|
48
|
-
<GiftedAvatar avatarStyle={[
|
|
49
|
-
styles[position].image,
|
|
50
|
-
imageStyle?.[position],
|
|
51
|
-
]}/>
|
|
52
|
-
</View>);
|
|
53
|
-
const renderAvatarComponent = () => {
|
|
36
|
+
const renderAvatarComponent = useCallback(() => {
|
|
54
37
|
if (renderAvatar)
|
|
55
38
|
return renderAvatar({
|
|
56
39
|
renderAvatarOnTop,
|
|
@@ -70,7 +53,35 @@ export function Avatar(props) {
|
|
|
70
53
|
imageStyle?.[position],
|
|
71
54
|
]} user={currentMessage.user} onPress={() => onPressAvatar?.(currentMessage.user)} onLongPress={() => onLongPressAvatar?.(currentMessage.user)}/>);
|
|
72
55
|
return null;
|
|
73
|
-
}
|
|
56
|
+
}, [
|
|
57
|
+
renderAvatar,
|
|
58
|
+
renderAvatarOnTop,
|
|
59
|
+
showAvatarForEveryMessage,
|
|
60
|
+
containerStyle,
|
|
61
|
+
position,
|
|
62
|
+
currentMessage,
|
|
63
|
+
previousMessage,
|
|
64
|
+
nextMessage,
|
|
65
|
+
imageStyle,
|
|
66
|
+
onPressAvatar,
|
|
67
|
+
onLongPressAvatar,
|
|
68
|
+
]);
|
|
69
|
+
if (renderAvatar === null)
|
|
70
|
+
return null;
|
|
71
|
+
if (!showAvatarForEveryMessage &&
|
|
72
|
+
currentMessage &&
|
|
73
|
+
messageToCompare &&
|
|
74
|
+
isSameUser(currentMessage, messageToCompare) &&
|
|
75
|
+
isSameDay(currentMessage, messageToCompare))
|
|
76
|
+
return (<View style={[
|
|
77
|
+
styles[position].container,
|
|
78
|
+
containerStyle?.[position],
|
|
79
|
+
]}>
|
|
80
|
+
<GiftedAvatar avatarStyle={[
|
|
81
|
+
styles[position].image,
|
|
82
|
+
imageStyle?.[position],
|
|
83
|
+
]}/>
|
|
84
|
+
</View>);
|
|
74
85
|
return (<View style={[
|
|
75
86
|
styles[position].container,
|
|
76
87
|
renderAvatarOnTop && styles[position].onTop,
|
|
@@ -79,23 +90,4 @@ export function Avatar(props) {
|
|
|
79
90
|
{renderAvatarComponent()}
|
|
80
91
|
</View>);
|
|
81
92
|
}
|
|
82
|
-
Avatar.propTypes = {
|
|
83
|
-
renderAvatarOnTop: PropTypes.bool,
|
|
84
|
-
showAvatarForEveryMessage: PropTypes.bool,
|
|
85
|
-
position: PropTypes.oneOf(['left', 'right']),
|
|
86
|
-
currentMessage: PropTypes.object,
|
|
87
|
-
previousMessage: PropTypes.object,
|
|
88
|
-
nextMessage: PropTypes.object,
|
|
89
|
-
onPressAvatar: PropTypes.func,
|
|
90
|
-
onLongPressAvatar: PropTypes.func,
|
|
91
|
-
renderAvatar: PropTypes.func,
|
|
92
|
-
containerStyle: PropTypes.shape({
|
|
93
|
-
left: StylePropType,
|
|
94
|
-
right: StylePropType,
|
|
95
|
-
}),
|
|
96
|
-
imageStyle: PropTypes.shape({
|
|
97
|
-
left: StylePropType,
|
|
98
|
-
right: StylePropType,
|
|
99
|
-
}),
|
|
100
|
-
};
|
|
101
93
|
//# sourceMappingURL=Avatar.js.map
|
package/lib/Avatar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.js","sourceRoot":"","sources":["../src/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Avatar.js","sourceRoot":"","sources":["../src/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAa,WAAW,EAAE,MAAM,OAAO,CAAA;AACrD,OAAO,EAEL,UAAU,EAEV,IAAI,GAEL,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAgB/C,MAAM,MAAM,GAAW;IACrB,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC;QACtB,SAAS,EAAE;YACT,WAAW,EAAE,CAAC;SACf;QACD,KAAK,EAAE;YACL,SAAS,EAAE,YAAY;SACxB;QACD,KAAK,E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AAE,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAC5D,CACH,CAAA;QAEH,OAAO,IAAI,CAAA;IACb,CAAC,EAAE;QACD,YAAY;QACZ,iBAAiB;QACjB,yBAAyB;QACzB,cAAc;QACd,QAAQ;QACR,cAAc;QACd,eAAe;QACf,WAAW;QACX,UAAU;QACV,aAAa;QACb,iBAAiB;KAClB,CAAC,CAAA;IAEF,IAAI,YAAY,KAAK,IAAI;QACvB,OAAO,IAAI,CAAA;IAEb,IACE,CAAC,yBAAyB;QAC1B,cAAc;QACd,gBAAgB;QAChB,UAAU,CAAC,cAAc,EAAE,gBAAgB,CAAC;QAC5C,SAAS,CAAC,cAAc,EAAE,gBAAgB,CAAC;QAE3C,OAAO,CACL,CAAC,IAAI,CACH,KAAK,CAAC,CAAC;gBACL,MAAM,CAAC,QAAQ,CAAC,CAAC,SAAS;gBAC1B,cAAc,EAAE,CAAC,QAAQ,CAAC;aAC3B,CAAC,CAEF;QAAA,CAAC,YAAY,CACX,WAAW,CAAC,CAAC;gBACX,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK;gBACtB,UAAU,EAAE,CAAC,QAAQ,CAAC;aACvB,CAAC,EAEN;MAAA,EAAE,IAAI,CAAC,CACR,CAAA;IAEH,OAAO,CACL,CAAC,IAAI,CACH,KAAK,CAAC,CAAC;YACL,MAAM,CAAC,QAAQ,CAAC,CAAC,SAAS;YAC1B,iBAAiB,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK;YAC3C,cAAc,EAAE,CAAC,QAAQ,CAAC;SAC3B,CAAC,CAEF;MAAA,CAAC,qBAAqB,EAAE,CAC1B;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IMessage } from '../types';
|
|
3
|
+
import { BubbleProps } from './types';
|
|
4
|
+
export * from './types';
|
|
5
|
+
export default class Bubble<TMessage extends IMessage = IMessage> extends React.Component<BubbleProps<TMessage>> {
|
|
6
|
+
static contextType: React.Context<import("..").IGiftedChatContext>;
|
|
7
|
+
onPress: () => void;
|
|
8
|
+
onLongPress: () => void;
|
|
9
|
+
styledBubbleToNext(): (import("react-native").StyleProp<import("react-native").ViewStyle> | {
|
|
10
|
+
borderBottomLeftRadius: number;
|
|
11
|
+
} | {
|
|
12
|
+
borderBottomRightRadius: number;
|
|
13
|
+
})[] | null;
|
|
14
|
+
styledBubbleToPrevious(): (import("react-native").StyleProp<import("react-native").ViewStyle> | {
|
|
15
|
+
borderTopLeftRadius: number;
|
|
16
|
+
} | {
|
|
17
|
+
borderTopRightRadius: number;
|
|
18
|
+
})[] | null;
|
|
19
|
+
renderQuickReplies(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
|
|
20
|
+
renderMessageText(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
|
|
21
|
+
renderMessageImage(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
|
|
22
|
+
renderMessageVideo(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
|
|
23
|
+
renderMessageAudio(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
|
|
24
|
+
renderTicks(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
|
|
25
|
+
renderTime(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
|
|
26
|
+
renderUsername(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
|
|
27
|
+
renderCustomView(): React.ReactNode;
|
|
28
|
+
renderBubbleContent(): React.JSX.Element;
|
|
29
|
+
render(): React.JSX.Element;
|
|
30
|
+
}
|
|
@@ -1,85 +1,16 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
1
|
import React from 'react';
|
|
3
|
-
import { Text,
|
|
4
|
-
import { GiftedChatContext } from '
|
|
5
|
-
import { QuickReplies } from '
|
|
6
|
-
import { MessageText } from '
|
|
7
|
-
import { MessageImage } from '
|
|
8
|
-
import { MessageVideo } from '
|
|
9
|
-
import { MessageAudio } from '
|
|
10
|
-
import { Time } from '
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
container: {
|
|
16
|
-
flex: 1,
|
|
17
|
-
alignItems: 'flex-start',
|
|
18
|
-
},
|
|
19
|
-
wrapper: {
|
|
20
|
-
borderRadius: 15,
|
|
21
|
-
backgroundColor: Color.leftBubbleBackground,
|
|
22
|
-
marginRight: 60,
|
|
23
|
-
minHeight: 20,
|
|
24
|
-
justifyContent: 'flex-end',
|
|
25
|
-
},
|
|
26
|
-
containerToNext: {
|
|
27
|
-
borderBottomLeftRadius: 3,
|
|
28
|
-
},
|
|
29
|
-
containerToPrevious: {
|
|
30
|
-
borderTopLeftRadius: 3,
|
|
31
|
-
},
|
|
32
|
-
bottom: {
|
|
33
|
-
flexDirection: 'row',
|
|
34
|
-
justifyContent: 'flex-start',
|
|
35
|
-
},
|
|
36
|
-
}),
|
|
37
|
-
right: StyleSheet.create({
|
|
38
|
-
container: {
|
|
39
|
-
flex: 1,
|
|
40
|
-
alignItems: 'flex-end',
|
|
41
|
-
},
|
|
42
|
-
wrapper: {
|
|
43
|
-
borderRadius: 15,
|
|
44
|
-
backgroundColor: Color.defaultBlue,
|
|
45
|
-
marginLeft: 60,
|
|
46
|
-
minHeight: 20,
|
|
47
|
-
justifyContent: 'flex-end',
|
|
48
|
-
},
|
|
49
|
-
containerToNext: {
|
|
50
|
-
borderBottomRightRadius: 3,
|
|
51
|
-
},
|
|
52
|
-
containerToPrevious: {
|
|
53
|
-
borderTopRightRadius: 3,
|
|
54
|
-
},
|
|
55
|
-
bottom: {
|
|
56
|
-
flexDirection: 'row',
|
|
57
|
-
justifyContent: 'flex-end',
|
|
58
|
-
},
|
|
59
|
-
}),
|
|
60
|
-
content: StyleSheet.create({
|
|
61
|
-
tick: {
|
|
62
|
-
fontSize: 10,
|
|
63
|
-
backgroundColor: Color.backgroundTransparent,
|
|
64
|
-
color: Color.white,
|
|
65
|
-
},
|
|
66
|
-
tickView: {
|
|
67
|
-
flexDirection: 'row',
|
|
68
|
-
marginRight: 10,
|
|
69
|
-
},
|
|
70
|
-
username: {
|
|
71
|
-
top: -3,
|
|
72
|
-
left: 0,
|
|
73
|
-
fontSize: 12,
|
|
74
|
-
backgroundColor: 'transparent',
|
|
75
|
-
color: '#aaa',
|
|
76
|
-
},
|
|
77
|
-
usernameView: {
|
|
78
|
-
flexDirection: 'row',
|
|
79
|
-
marginHorizontal: 10,
|
|
80
|
-
},
|
|
81
|
-
}),
|
|
82
|
-
};
|
|
2
|
+
import { Text, TouchableWithoutFeedback, View, } from 'react-native';
|
|
3
|
+
import { GiftedChatContext } from '../GiftedChatContext';
|
|
4
|
+
import { QuickReplies } from '../QuickReplies';
|
|
5
|
+
import { MessageText } from '../MessageText';
|
|
6
|
+
import { MessageImage } from '../MessageImage';
|
|
7
|
+
import { MessageVideo } from '../MessageVideo';
|
|
8
|
+
import { MessageAudio } from '../MessageAudio';
|
|
9
|
+
import { Time } from '../Time';
|
|
10
|
+
import { isSameUser, isSameDay } from '../utils';
|
|
11
|
+
import stylesCommon from '../styles';
|
|
12
|
+
import styles from './styles';
|
|
13
|
+
export * from './types';
|
|
83
14
|
class Bubble extends React.Component {
|
|
84
15
|
constructor() {
|
|
85
16
|
super(...arguments);
|
|
@@ -133,7 +64,7 @@ class Bubble extends React.Component {
|
|
|
133
64
|
}
|
|
134
65
|
renderQuickReplies() {
|
|
135
66
|
const { currentMessage, onQuickReply, nextMessage, renderQuickReplySend, quickReplyStyle, quickReplyTextStyle, quickReplyContainerStyle, } = this.props;
|
|
136
|
-
if (currentMessage
|
|
67
|
+
if (currentMessage?.quickReplies) {
|
|
137
68
|
const {
|
|
138
69
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
139
70
|
containerStyle, wrapperStyle,
|
|
@@ -146,7 +77,7 @@ class Bubble extends React.Component {
|
|
|
146
77
|
return null;
|
|
147
78
|
}
|
|
148
79
|
renderMessageText() {
|
|
149
|
-
if (this.props.currentMessage
|
|
80
|
+
if (this.props.currentMessage?.text) {
|
|
150
81
|
const {
|
|
151
82
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
152
83
|
containerStyle, wrapperStyle, optionTitles,
|
|
@@ -159,7 +90,7 @@ class Bubble extends React.Component {
|
|
|
159
90
|
return null;
|
|
160
91
|
}
|
|
161
92
|
renderMessageImage() {
|
|
162
|
-
if (this.props.currentMessage
|
|
93
|
+
if (this.props.currentMessage?.image) {
|
|
163
94
|
const {
|
|
164
95
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
165
96
|
containerStyle, wrapperStyle,
|
|
@@ -196,12 +127,11 @@ class Bubble extends React.Component {
|
|
|
196
127
|
return <MessageAudio />;
|
|
197
128
|
}
|
|
198
129
|
renderTicks() {
|
|
199
|
-
const { currentMessage, renderTicks, user } = this.props;
|
|
130
|
+
const { currentMessage, renderTicks, user, } = this.props;
|
|
200
131
|
if (renderTicks && currentMessage)
|
|
201
132
|
return renderTicks(currentMessage);
|
|
202
|
-
if (
|
|
203
|
-
user &&
|
|
204
|
-
currentMessage.user &&
|
|
133
|
+
if (user &&
|
|
134
|
+
currentMessage?.user &&
|
|
205
135
|
currentMessage.user._id !== user._id)
|
|
206
136
|
return null;
|
|
207
137
|
if (currentMessage &&
|
|
@@ -220,7 +150,7 @@ class Bubble extends React.Component {
|
|
|
220
150
|
return null;
|
|
221
151
|
}
|
|
222
152
|
renderTime() {
|
|
223
|
-
if (this.props.currentMessage
|
|
153
|
+
if (this.props.currentMessage?.createdAt) {
|
|
224
154
|
const {
|
|
225
155
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
226
156
|
containerStyle, wrapperStyle, textStyle,
|
|
@@ -233,7 +163,7 @@ class Bubble extends React.Component {
|
|
|
233
163
|
return null;
|
|
234
164
|
}
|
|
235
165
|
renderUsername() {
|
|
236
|
-
const { currentMessage, user, renderUsername } = this.props;
|
|
166
|
+
const { currentMessage, user, renderUsername, } = this.props;
|
|
237
167
|
if (this.props.renderUsernameOnMessage && currentMessage) {
|
|
238
168
|
if (user && currentMessage.user._id === user._id)
|
|
239
169
|
return null;
|
|
@@ -254,25 +184,19 @@ class Bubble extends React.Component {
|
|
|
254
184
|
return null;
|
|
255
185
|
}
|
|
256
186
|
renderBubbleContent() {
|
|
257
|
-
return
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
: (<View>
|
|
266
|
-
{this.renderCustomView()}
|
|
267
|
-
{this.renderMessageImage()}
|
|
268
|
-
{this.renderMessageVideo()}
|
|
269
|
-
{this.renderMessageAudio()}
|
|
270
|
-
{this.renderMessageText()}
|
|
271
|
-
</View>);
|
|
187
|
+
return (<View>
|
|
188
|
+
{!this.props.isCustomViewBottom && this.renderCustomView()}
|
|
189
|
+
{this.renderMessageImage()}
|
|
190
|
+
{this.renderMessageVideo()}
|
|
191
|
+
{this.renderMessageAudio()}
|
|
192
|
+
{this.renderMessageText()}
|
|
193
|
+
{this.props.isCustomViewBottom && this.renderCustomView()}
|
|
194
|
+
</View>);
|
|
272
195
|
}
|
|
273
196
|
render() {
|
|
274
|
-
const { position, containerStyle, wrapperStyle, bottomContainerStyle } = this.props;
|
|
197
|
+
const { position, containerStyle, wrapperStyle, bottomContainerStyle, } = this.props;
|
|
275
198
|
return (<View style={[
|
|
199
|
+
stylesCommon.fill,
|
|
276
200
|
styles[position].container,
|
|
277
201
|
containerStyle && containerStyle[position],
|
|
278
202
|
]}>
|
|
@@ -301,79 +225,5 @@ class Bubble extends React.Component {
|
|
|
301
225
|
}
|
|
302
226
|
}
|
|
303
227
|
Bubble.contextType = GiftedChatContext;
|
|
304
|
-
Bubble.defaultProps = {
|
|
305
|
-
touchableProps: {},
|
|
306
|
-
onPress: null,
|
|
307
|
-
onLongPress: null,
|
|
308
|
-
renderMessageImage: null,
|
|
309
|
-
renderMessageVideo: null,
|
|
310
|
-
renderMessageAudio: null,
|
|
311
|
-
renderMessageText: null,
|
|
312
|
-
renderCustomView: null,
|
|
313
|
-
renderUsername: null,
|
|
314
|
-
renderTicks: null,
|
|
315
|
-
renderTime: null,
|
|
316
|
-
renderQuickReplies: null,
|
|
317
|
-
onQuickReply: null,
|
|
318
|
-
position: 'left',
|
|
319
|
-
currentMessage: {
|
|
320
|
-
text: null,
|
|
321
|
-
createdAt: null,
|
|
322
|
-
image: null,
|
|
323
|
-
},
|
|
324
|
-
nextMessage: {},
|
|
325
|
-
previousMessage: {},
|
|
326
|
-
containerStyle: {},
|
|
327
|
-
wrapperStyle: {},
|
|
328
|
-
bottomContainerStyle: {},
|
|
329
|
-
tickStyle: {},
|
|
330
|
-
usernameStyle: {},
|
|
331
|
-
containerToNextStyle: {},
|
|
332
|
-
containerToPreviousStyle: {},
|
|
333
|
-
};
|
|
334
|
-
Bubble.propTypes = {
|
|
335
|
-
user: PropTypes.object.isRequired,
|
|
336
|
-
touchableProps: PropTypes.object,
|
|
337
|
-
onLongPress: PropTypes.func,
|
|
338
|
-
renderMessageImage: PropTypes.func,
|
|
339
|
-
renderMessageVideo: PropTypes.func,
|
|
340
|
-
renderMessageAudio: PropTypes.func,
|
|
341
|
-
renderMessageText: PropTypes.func,
|
|
342
|
-
renderCustomView: PropTypes.func,
|
|
343
|
-
isCustomViewBottom: PropTypes.bool,
|
|
344
|
-
renderUsernameOnMessage: PropTypes.bool,
|
|
345
|
-
renderUsername: PropTypes.func,
|
|
346
|
-
renderTime: PropTypes.func,
|
|
347
|
-
renderTicks: PropTypes.func,
|
|
348
|
-
renderQuickReplies: PropTypes.func,
|
|
349
|
-
onQuickReply: PropTypes.func,
|
|
350
|
-
position: PropTypes.oneOf(['left', 'right']),
|
|
351
|
-
optionTitles: PropTypes.arrayOf(PropTypes.string),
|
|
352
|
-
currentMessage: PropTypes.object,
|
|
353
|
-
nextMessage: PropTypes.object,
|
|
354
|
-
previousMessage: PropTypes.object,
|
|
355
|
-
containerStyle: PropTypes.shape({
|
|
356
|
-
left: StylePropType,
|
|
357
|
-
right: StylePropType,
|
|
358
|
-
}),
|
|
359
|
-
wrapperStyle: PropTypes.shape({
|
|
360
|
-
left: StylePropType,
|
|
361
|
-
right: StylePropType,
|
|
362
|
-
}),
|
|
363
|
-
bottomContainerStyle: PropTypes.shape({
|
|
364
|
-
left: StylePropType,
|
|
365
|
-
right: StylePropType,
|
|
366
|
-
}),
|
|
367
|
-
tickStyle: StylePropType,
|
|
368
|
-
usernameStyle: StylePropType,
|
|
369
|
-
containerToNextStyle: PropTypes.shape({
|
|
370
|
-
left: StylePropType,
|
|
371
|
-
right: StylePropType,
|
|
372
|
-
}),
|
|
373
|
-
containerToPreviousStyle: PropTypes.shape({
|
|
374
|
-
left: StylePropType,
|
|
375
|
-
right: StylePropType,
|
|
376
|
-
}),
|
|
377
|
-
};
|
|
378
228
|
export default Bubble;
|
|
379
|
-
//# sourceMappingURL=
|
|
229
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Bubble/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EACL,IAAI,EACJ,wBAAwB,EACxB,IAAI,GACL,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAE9B,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAIhD,OAAO,YAAY,MAAM,WAAW,CAAA;AACpC,OAAO,MAAM,MAAM,UAAU,CAAA;AAE7B,cAAc,SAAS,CAAA;AAEvB,MAAqB,MAEnB,SAAQ,KAAK,CAAC,SAAgC;IAFhD;;QAKE,YAAO,GAAG,GAAG,EAAE;YACb,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO;gBACpB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAA;QAC/D,CAAC,CAAA;QAED,gBAA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