Skip to content

Commit 3593dfb

Browse files
CRNS-49: Docs for missing components
1 parent cf28cf2 commit 3593dfb

File tree

13 files changed

+138
-95
lines changed

13 files changed

+138
-95
lines changed

src/components/AutoCompleteInput.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,17 @@ const InputBox = styled.TextInput`
1212
export class AutoCompleteInput extends React.PureComponent {
1313
static propTypes = {
1414
value: PropTypes.string,
15+
/** @see See [suggestions context](https://getstream.github.io/stream-chat-react-native/#suggestionscontext) */
1516
openSuggestions: PropTypes.func,
17+
/** @see See [suggestions context](https://getstream.github.io/stream-chat-react-native/#suggestionscontext) */
1618
closeSuggestions: PropTypes.func,
19+
/** @see See [suggestions context](https://getstream.github.io/stream-chat-react-native/#suggestionscontext) */
1720
updateSuggestions: PropTypes.func,
1821
triggerSettings: PropTypes.object,
1922
setInputBoxRef: PropTypes.func,
23+
/**
24+
* @param text string
25+
*/
2026
onChange: PropTypes.func,
2127
/**
2228
* Additional props for underlying TextInput component. These props will be forwarded as it is to TextInput component.

src/components/CloseButton.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,5 @@ export const CloseButton = themed(
2727
}
2828
},
2929
);
30+
31+
CloseButton.propTypes = {};

src/components/FileIcon.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,6 @@ function mimeTypeToIcon(mimeType) {
201201
return iconDOC;
202202
}
203203

204-
/**
205-
* @example ./examples/FileIcon.md
206-
*/
207204
export class FileIcon extends React.Component {
208205
render() {
209206
const { mimeType, size } = this.props;

src/components/Gallery.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ const ImageContainer = styled.TouchableOpacity`
5353
length !== 3 ? theme.message.gallery.size : theme.message.gallery.halfSize};
5454
${({ theme }) => theme.message.gallery.imageContainer.css}
5555
`;
56+
/**
57+
* UI component for card in attachments.
58+
*
59+
* @example ./docs/Gallery.md
60+
*/
5661

5762
export const Gallery = withMessageContentContext(
5863
themed(

src/components/docs/ChatDown.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/components/docs/Gallery.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
```js
22
const images = [
3-
{ image_url: 'https://placehold.it/300x200' },
4-
{ image_url: 'https://placehold.it/300x200' },
5-
{ image_url: 'https://placehold.it/300x200' },
6-
{ image_url: 'https://placehold.it/300x200' },
7-
{ image_url: 'https://placehold.it/300x200' },
8-
{ image_url: 'https://placehold.it/300x200' },
3+
{ image_url: 'https://i.picsum.photos/id/1/200/300.jpg' },
4+
{ image_url: 'https://i.picsum.photos/id/2/200/300.jpg' },
5+
{ image_url: 'https://i.picsum.photos/id/3/200/300.jpg' },
6+
{ image_url: 'https://i.picsum.photos/id/4/200/300.jpg' },
7+
{ image_url: 'https://i.picsum.photos/id/5/200/300.jpg' },
8+
{ image_url: 'https://i.picsum.photos/id/6/200/300.jpg' },
99
];
1010
<Gallery images={images} />;
1111
```

src/components/docs/MessageText.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
It accepts all the props accepted by MessageTextContainer component.
2+
In addition it also accepts following props:
3+
4+
- renderText { function } Defaults to [renderText](#rendertext)

src/components/docs/Window.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/components/docs/renderText.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[src/utils/renderText.js](https://github.com/GetStream/stream-chat-react-native/blob/master/src/utils/renderText.js)
2+
3+
Function that handles markdown and parsing for the text of message.
4+
5+
Internally it uses [react-native-simple-markdown](https://github.com/GetStream/react-native-simple-markdown#styles-1) to handle markdown.
6+
7+
It accepts following params:
8+
9+
- message { object } Message object
10+
- style { object } - https://github.com/GetStream/react-native-simple-markdown#styles-1

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ export {
1313
withMessageContentContext,
1414
} from './context.js';
1515

16-
export { MESSAGE_ACTIONS, renderText } from './utils';
16+
export * from './utils';

0 commit comments

Comments
 (0)