diff --git a/README.md b/README.md index c8309865a..f7923a534 100644 --- a/README.md +++ b/README.md @@ -14,12 +14,11 @@

- npm dowloads + npm downloads npm version build -

 build @@ -47,33 +46,33 @@ ## Features -* Fully customizable components -* Composer actions (to attach photos, etc.) -* Load earlier messages -* Copy messages to clipboard -* Touchable links using [react-native-parsed-text](https://github.com/taskrabbit/react-native-parsed-text) -* Avatar as user's initials -* Localized dates -* Multiline TextInput -* InputToolbar avoiding keyboard -* Redux support -* System message +- Fully customizable components +- Composer actions (to attach photos, etc.) +- Load earlier messages +- Copy messages to clipboard +- Touchable links using [react-native-parsed-text](https://github.com/taskrabbit/react-native-parsed-text) +- Avatar as user's initials +- Localized dates +- Multi-line TextInput +- InputToolbar avoiding keyboard +- Redux support +- System message ## Dependency -* Use version `0.2.x` for RN `>= 0.44.0` -* Use version `0.1.x` for RN `>= 0.40.0` -* Use version `0.0.10` for RN `< 0.40.0` +- Use version `0.2.x` for RN `>= 0.44.0` +- Use version `0.1.x` for RN `>= 0.40.0` +- Use version `0.0.10` for RN `< 0.40.0` ## Installation -* Using [npm](https://www.npmjs.com/#getting-started): `npm install react-native-gifted-chat --save` -* Using [Yarn](https://yarnpkg.com/): `yarn add react-native-gifted-chat` +- Using [npm](https://www.npmjs.com/#getting-started): `npm install react-native-gifted-chat --save` +- Using [Yarn](https://yarnpkg.com/): `yarn add react-native-gifted-chat` ## Example ```jsx -import React from 'react'; +import React from 'react' import { GiftedChat } from 'react-native-gifted-chat' class Example extends React.Component { @@ -159,58 +158,58 @@ e.g. System Message ## Props -* **`messages`** _(Array)_ - Messages to display -* **`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)) -* **`placeholder`** _(String)_ - Placeholder when `text` is empty; default is `'Type a message...'` -* **`messageIdGenerator`** _(Function)_ - Generate an id for new messages. Defaults to UUID v4, generated by [uuid](https://github.com/kelektiv/node-uuid) -* **`user`** _(Object)_ - User sending the messages: `{ _id, name, avatar }` -* **`onSend`** _(Function)_ - Callback when sending a message -* **`locale`** _(String)_ - Locale to localize the dates -* **`timeFormat`** _(String)_ - Format to use for rendering times; default is `'LT'` -* **`dateFormat`** _(String)_ - Format to use for rendering dates; default is `'ll'` -* **`isAnimated`** _(Bool)_ - Animates the view when the keyboard appears -* **`loadEarlier`** _(Bool)_ - Enables the "Load earlier messages" button -* **`onLoadEarlier`** _(Function)_ - Callback when loading earlier messages -* **`isLoadingEarlier`** _(Bool)_ - Display an `ActivityIndicator` when loading earlier messages -* **`renderLoading`** _(Function)_ - Render a loading view when initializing -* **`renderLoadEarlier`** _(Function)_ - Custom "Load earlier messages" button -* **`renderAvatar`** _(Function)_ - Custom message avatar; set to `null` to not render any avatar for the message -* **`showUserAvatar`** _(Bool)_ - Whether to render an avatar for the current user; default is `false`, only show avatars for other users -* **`showAvatarForEveryMessage`** _(Bool)_ - When false, avatars will only be displayed when a consecutive message is from the same user on the same day; default is `false` -* **`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 is `false` -* **`renderBubble`** _(Function)_ - Custom message bubble -* **`renderSystemMessage`** _(Function)_ - Custom system message -* **`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@%7B2017-09-25%7D/src/Bubble.js#L96-L119)) -* **`inverted`** _(Bool)_ - Reverses display order of `messages`; default is `true` -* **`renderMessage`** _(Function)_ - Custom message container -* **`renderMessageText`** _(Function)_ - Custom message text -* **`renderMessageImage`** _(Function)_ - Custom message image -* **`imageProps`** _(Object)_ - Extra props to be passed to the [``](https://facebook.github.io/react-native/docs/image.html) component created by the default `renderMessageImage` -* **`videoProps`** _(Object)_ - Extra props to be passed to the [`