Skip to content

Commit 52b9138

Browse files
committed
docs: add docs for answers list and results screens
1 parent bda97ba commit 52b9138

File tree

3 files changed

+86
-0
lines changed

3 files changed

+86
-0
lines changed

docusaurus/docs/reactnative/common-content/ui-components/poll/poll-content.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
A `Component` prop used to render the content of the `Poll` component in `MessageList`.
22

3+
The component has full access to the entire `Poll` reactive state through the `usePollState` hook.
4+
35
| Type | Default |
46
| ------------- | ---------------------------------------------- |
57
| ComponentType | [`PollContent`](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Poll/Poll.tsx) |

docusaurus/docs/reactnative/ui-components/poll-answers-list.mdx

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,45 @@
22
id: poll-answers-list
33
title: PollAnswersList
44
---
5+
6+
import MessageProp from '../common-content/contexts/message-context/message.mdx';
7+
import Poll from '../common-content/contexts/poll-context/poll.mdx';
8+
9+
A component used to render a list of answers that a `Poll` has. The results will be paginated and only one answer per user is allowed. Needs to be structured inside a [`Channel` component](../core-components/channel).
10+
11+
It will render its default `PollAnswersListContent`, which can be overridden for custom UI. Its children have access to the entire `poll` state through the `usePollState` hook.
12+
13+
## Props
14+
15+
### <div class="label description">_forwarded from [MessageContext](../../contexts/message-context#message)_ props</div> message {#message}
16+
17+
<MessageProp />
18+
19+
### `poll` *
20+
21+
<Poll />
22+
23+
### `additionalFlatListProps`
24+
25+
A prop used to override the underlying [`FlatList`](https://reactnative.dev/docs/flatlist#props) props of the `PollAnswersList`.
26+
27+
```jsx
28+
const flatListProps = { bounces: true };
29+
30+
<PollAnswersList additionalFlatListProps={flatListProps} />;
31+
```
32+
33+
| Type |
34+
| ------ |
35+
| object |
36+
37+
### `PollAnswersListContent`
38+
39+
A `Component` prop used to render the content of the `PollAnswersList` component.
40+
41+
The component has full access to the entire `Poll` reactive state through the `usePollState` hook.
42+
43+
| Type | Default |
44+
| ------------- | ---------------------------------------------- |
45+
| ComponentType | [`PollAnswersListContent`](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Poll/PollAnswersList.tsx) |
46+

docusaurus/docs/reactnative/ui-components/poll-results.mdx

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,45 @@
22
id: poll-results
33
title: PollResults
44
---
5+
6+
import MessageProp from '../common-content/contexts/message-context/message.mdx';
7+
import Poll from '../common-content/contexts/poll-context/poll.mdx';
8+
9+
A component used to render a list of all of the votes per option that a `Poll` has. Each option will display the 5 most recent votes. If an option has more than 5 votes it will add a button at the bottom that opens the [`PollOptionFullResults`](./poll-option-full-results.mdx) Modal. Needs to be structured inside a [`Channel` component](../core-components/channel).
10+
11+
It will render its default `PollResultsContent`, which can be overridden for custom UI. Its children have access to the entire `poll` state through the `usePollState` hook.
12+
13+
## Props
14+
15+
### <div class="label description">_forwarded from [MessageContext](../../contexts/message-context#message)_ props</div> message {#message}
16+
17+
<MessageProp />
18+
19+
### `poll` *
20+
21+
<Poll />
22+
23+
### `additionalScrollViewProps`
24+
25+
A prop used to override the underlying [`ScrollView`](https://reactnative.dev/docs/scrollview#props) props of the `PollResults`.
26+
27+
```jsx
28+
const flatListProps = { bounces: true };
29+
30+
<PollResults additionalFlatListProps={flatListProps} />;
31+
```
32+
33+
| Type |
34+
| ------ |
35+
| object |
36+
37+
### `PollResultsContent`
38+
39+
A `Component` prop used to render the content of the `PollResults` component.
40+
41+
The component has full access to the entire `Poll` reactive state through the `usePollState` hook.
42+
43+
| Type | Default |
44+
| ------------- | ---------------------------------------------- |
45+
| ComponentType | [`PollResultsContent`](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Poll/PollResults.tsx) |
46+

0 commit comments

Comments
 (0)