react-native-gifted-chat
Advanced tools
Comparing version 0.2.2 to 0.2.3
{ | ||
"name": "react-native-gifted-chat", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "The most complete chat UI for React Native", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -123,4 +123,5 @@ # Gifted Chat | ||
- **`renderAvatar`** _(Function)_ - Custom message avatar; set to `null` to not render any avatar for the message | ||
- **`showUserAvatar`** _(Function)_ - Whether to render an avatar for the current user; default is `false`, only show avatars for other users | ||
- **`onPressAvatar`** _(Function(`user`))_ - Callback when a message avatar is tapped | ||
- **`renderAvatarOnTop`** _(Bool)_ - Render the message avatar at the top of consecutive messages, rather than the bottom (default) | ||
- **`renderAvatarOnTop`** _(Bool)_ - Render the message avatar at the top of consecutive messages, rather than the bottom; default is `false` | ||
- **`renderBubble`** _(Function)_ - Custom message bubble | ||
@@ -136,3 +137,4 @@ - **`onLongPress`** _(Function(`context`, `message`))_ - Callback when a message bubble is long-pressed; default is to show an ActionSheet with "Copy Text" (see [example using `showActionSheetWithOptions()`](https://github.com/FaridSafi/react-native-gifted-chat/blob/master/example/CustomActions.js)) | ||
- **`renderTime`** _(Function)_ - Custom time inside a message | ||
- **`renderFooter`** _(Function)_ - Custom fixed bottom view, e.g. "User is typing..."; see [example/App.js](example/App.js) for an example | ||
- **`renderFooter`** _(Function)_ - Custom footer component on the ListView, e.g. "User is typing..."; see [example/App.js](example/App.js) for an example | ||
- **`renderChatFooter`** _(Function)_ - Custom component to render below the MessageContainer (separate from the ListView) | ||
- **`renderInputToolbar`** _(Function)_ - Custom message composer container | ||
@@ -139,0 +141,0 @@ - **`renderComposer`** _(Function)_ - Custom text input message composer |
@@ -72,3 +72,2 @@ import PropTypes from 'prop-types'; | ||
isSameUser: warnDeprecated(isSameUser), | ||
dateFormat: 'll' | ||
}; | ||
@@ -75,0 +74,0 @@ |
@@ -478,8 +478,8 @@ import PropTypes from 'prop-types'; | ||
messages: [], | ||
onSend: () => { | ||
}, | ||
loadEarlier: false, | ||
onLoadEarlier: () => { | ||
}, | ||
messageIdGenerator: () => uuid.v4(), | ||
user: {}, | ||
onSend: () => {}, | ||
locale: null, | ||
timeFormat: 'LT', | ||
dateFormat: 'll', | ||
isAnimated: Platform.select({ | ||
@@ -489,29 +489,38 @@ ios: true, | ||
}), | ||
keyboardShouldPersistTaps: Platform.select({ | ||
ios: 'never', | ||
android: 'always', | ||
}), | ||
renderAccessory: null, | ||
renderActions: null, | ||
loadEarlier: false, | ||
onLoadEarlier: () => {}, | ||
isLoadingEarlier: false, | ||
renderLoading: null, | ||
renderLoadEarlier: null, | ||
renderAvatar: undefined, | ||
showUserAvatar: false, | ||
onPressAvatar: null, | ||
renderAvatarOnTop: false, | ||
renderBubble: null, | ||
renderFooter: null, | ||
renderChatFooter: null, | ||
onLongPress: null, | ||
renderMessage: null, | ||
renderMessageText: null, | ||
renderMessageImage: null, | ||
renderComposer: null, | ||
imageProps: {}, | ||
lightboxProps: {}, | ||
renderCustomView: null, | ||
renderDay: null, | ||
renderTime: null, | ||
renderFooter: null, | ||
renderChatFooter: null, | ||
renderInputToolbar: null, | ||
renderLoadEarlier: null, | ||
renderLoading: null, | ||
renderMessage: null, | ||
renderComposer: null, | ||
renderActions: null, | ||
renderSend: null, | ||
renderTime: null, | ||
user: {}, | ||
renderAccessory: null, | ||
onPressActionButton: null, | ||
bottomOffset: 0, | ||
minInputToolbarHeight: 44, | ||
isLoadingEarlier: false, | ||
messageIdGenerator: () => uuid.v4(), | ||
maxInputLength: null | ||
listViewProps: {}, | ||
keyboardShouldPersistTaps: Platform.select({ | ||
ios: 'never', | ||
android: 'always', | ||
}), | ||
onInputTextChanged: null, | ||
maxInputLength: null, | ||
}; | ||
@@ -521,31 +530,42 @@ | ||
messages: PropTypes.array, | ||
messageIdGenerator: PropTypes.func, | ||
user: PropTypes.object, | ||
onSend: PropTypes.func, | ||
onInputTextChanged: PropTypes.func, | ||
locale: PropTypes.string, | ||
timeFormat: PropTypes.string, | ||
dateFormat: PropTypes.string, | ||
isAnimated: PropTypes.bool, | ||
loadEarlier: PropTypes.bool, | ||
onLoadEarlier: PropTypes.func, | ||
locale: PropTypes.string, | ||
isAnimated: PropTypes.bool, | ||
renderAccessory: PropTypes.func, | ||
renderActions: PropTypes.func, | ||
isLoadingEarlier: PropTypes.bool, | ||
renderLoading: PropTypes.func, | ||
renderLoadEarlier: PropTypes.func, | ||
renderAvatar: PropTypes.func, | ||
showUserAvatar: PropTypes.bool, | ||
onPressAvatar: PropTypes.func, | ||
renderAvatarOnTop: PropTypes.bool, | ||
renderBubble: PropTypes.func, | ||
renderFooter: PropTypes.func, | ||
renderChatFooter: PropTypes.func, | ||
onLongPress: PropTypes.func, | ||
renderMessage: PropTypes.func, | ||
renderMessageText: PropTypes.func, | ||
renderMessageImage: PropTypes.func, | ||
renderComposer: PropTypes.func, | ||
imageProps: PropTypes.object, | ||
lightboxProps: PropTypes.object, | ||
renderCustomView: PropTypes.func, | ||
renderDay: PropTypes.func, | ||
renderTime: PropTypes.func, | ||
renderFooter: PropTypes.func, | ||
renderChatFooter: PropTypes.func, | ||
renderInputToolbar: PropTypes.func, | ||
renderLoadEarlier: PropTypes.func, | ||
renderLoading: PropTypes.func, | ||
renderMessage: PropTypes.func, | ||
renderComposer: PropTypes.func, | ||
renderActions: PropTypes.func, | ||
renderSend: PropTypes.func, | ||
renderTime: PropTypes.func, | ||
user: PropTypes.object, | ||
renderAccessory: PropTypes.func, | ||
onPressActionButton: PropTypes.func, | ||
bottomOffset: PropTypes.number, | ||
minInputToolbarHeight: PropTypes.number, | ||
isLoadingEarlier: PropTypes.bool, | ||
messageIdGenerator: PropTypes.func, | ||
listViewProps: PropTypes.object, | ||
keyboardShouldPersistTaps: PropTypes.oneOf(['always', 'never', 'handled']), | ||
onInputTextChanged: PropTypes.func, | ||
maxInputLength: PropTypes.number, | ||
}; | ||
@@ -552,0 +572,0 @@ |
@@ -46,7 +46,11 @@ import PropTypes from 'prop-types'; | ||
renderAvatar() { | ||
if (this.props.user._id !== this.props.currentMessage.user._id) { | ||
const avatarProps = this.getInnerComponentProps(); | ||
return <Avatar {...avatarProps}/>; | ||
if (this.props.user._id === this.props.currentMessage.user._id && !this.props.showUserAvatar) { | ||
return null; | ||
} | ||
return null; | ||
const avatarProps = this.getInnerComponentProps(); | ||
const { currentMessage } = avatarProps; | ||
if (currentMessage.user.avatar === null) { | ||
return null; | ||
} | ||
return <Avatar {...avatarProps} />; | ||
} | ||
@@ -105,2 +109,3 @@ | ||
renderAvatar: PropTypes.func, | ||
showUserAvatar: PropTypes.bool, | ||
renderBubble: PropTypes.func, | ||
@@ -107,0 +112,0 @@ renderDay: PropTypes.func, |
@@ -167,3 +167,2 @@ import PropTypes from 'prop-types'; | ||
renderMessage: null, | ||
listViewProps: {}, | ||
onLoadEarlier: () => { | ||
@@ -170,0 +169,0 @@ }, |
@@ -8,3 +8,2 @@ import PropTypes from 'prop-types'; | ||
ViewPropTypes, | ||
Dimensions, | ||
} from 'react-native'; | ||
@@ -15,4 +14,2 @@ import Lightbox from 'react-native-lightbox'; | ||
render() { | ||
const { width, height } = Dimensions.get('window'); | ||
return ( | ||
@@ -59,4 +56,2 @@ <View style={[styles.container, this.props.containerStyle]}> | ||
imageStyle: {}, | ||
imageProps: {}, | ||
lightboxProps: {}, | ||
}; | ||
@@ -63,0 +58,0 @@ |
@@ -68,3 +68,2 @@ import PropTypes from 'prop-types'; | ||
textStyle: {}, | ||
timeFormat: 'LT' | ||
}; | ||
@@ -71,0 +70,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2108
188
165647