stream-chat-react-native-core 8.8.1-beta.1 → 8.8.1
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/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js +2 -3
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js +2 -3
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
- package/lib/commonjs/components/MessageInput/MessageInput.js +2 -4
- package/lib/commonjs/components/MessageInput/MessageInput.js.map +1 -1
- package/lib/commonjs/components/Poll/components/PollButtons.js +37 -60
- package/lib/commonjs/components/Poll/components/PollButtons.js.map +1 -1
- package/lib/commonjs/components/Poll/components/PollResults/PollResultItem.js +4 -21
- package/lib/commonjs/components/Poll/components/PollResults/PollResultItem.js.map +1 -1
- package/lib/commonjs/components/UIComponents/SafeAreaViewWrapper.js +28 -0
- package/lib/commonjs/components/UIComponents/SafeAreaViewWrapper.js.map +1 -0
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js +2 -3
- package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js +2 -3
- package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
- package/lib/module/components/MessageInput/MessageInput.js +2 -4
- package/lib/module/components/MessageInput/MessageInput.js.map +1 -1
- package/lib/module/components/Poll/components/PollButtons.js +37 -60
- package/lib/module/components/Poll/components/PollButtons.js.map +1 -1
- package/lib/module/components/Poll/components/PollResults/PollResultItem.js +4 -21
- package/lib/module/components/Poll/components/PollResults/PollResultItem.js.map +1 -1
- package/lib/module/components/UIComponents/SafeAreaViewWrapper.js +28 -0
- package/lib/module/components/UIComponents/SafeAreaViewWrapper.js.map +1 -0
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/ImageGallery/components/ImageGalleryFooter.d.ts.map +1 -1
- package/lib/typescript/components/ImageGallery/components/ImageGalleryHeader.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/MessageInput.d.ts.map +1 -1
- package/lib/typescript/components/Poll/components/PollButtons.d.ts.map +1 -1
- package/lib/typescript/components/Poll/components/PollResults/PollResultItem.d.ts.map +1 -1
- package/lib/typescript/components/UIComponents/SafeAreaViewWrapper.d.ts +8 -0
- package/lib/typescript/components/UIComponents/SafeAreaViewWrapper.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/components/ImageGallery/components/ImageGalleryFooter.tsx +1 -5
- package/src/components/ImageGallery/components/ImageGalleryHeader.tsx +2 -13
- package/src/components/MessageInput/MessageInput.tsx +4 -15
- package/src/components/Poll/components/PollButtons.tsx +15 -38
- package/src/components/Poll/components/PollResults/PollResultItem.tsx +3 -28
- package/src/components/UIComponents/SafeAreaViewWrapper.tsx +23 -0
- package/src/version.json +1 -1
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import { Modal
|
|
3
|
-
import {
|
|
4
|
-
SafeAreaProvider,
|
|
5
|
-
SafeAreaView as SafeAreaViewOriginal,
|
|
6
|
-
} from 'react-native-safe-area-context';
|
|
1
|
+
import React, { useCallback, useState } from 'react';
|
|
2
|
+
import { Modal } from 'react-native';
|
|
7
3
|
|
|
8
4
|
import { GenericPollButton, PollButtonProps } from './Button';
|
|
9
5
|
import { PollAnswersList } from './PollAnswersList';
|
|
@@ -13,22 +9,9 @@ import { PollAllOptions } from './PollOption';
|
|
|
13
9
|
import { PollResults } from './PollResults';
|
|
14
10
|
|
|
15
11
|
import { useChatContext, usePollContext, useTheme, useTranslationContext } from '../../../contexts';
|
|
12
|
+
import { SafeAreaViewWrapper } from '../../UIComponents/SafeAreaViewWrapper';
|
|
16
13
|
import { usePollState } from '../hooks/usePollState';
|
|
17
14
|
|
|
18
|
-
// This is a workaround to support SafeAreaView on React Native 0.81.0+
|
|
19
|
-
const SafeAreaViewWrapper = ({ children, style }: PropsWithChildren<{ style: ViewStyle }>) => {
|
|
20
|
-
if (SafeAreaViewOriginal) {
|
|
21
|
-
return (
|
|
22
|
-
<SafeAreaProvider>
|
|
23
|
-
<SafeAreaViewOriginal edges={['bottom', 'top']} style={style}>
|
|
24
|
-
{children}
|
|
25
|
-
</SafeAreaViewOriginal>
|
|
26
|
-
</SafeAreaProvider>
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
return <RNSafeAreaView style={style}>{children}</RNSafeAreaView>;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
15
|
export const ViewResultsButton = (props: PollButtonProps) => {
|
|
33
16
|
const { t } = useTranslationContext();
|
|
34
17
|
const { message, poll } = usePollContext();
|
|
@@ -59,12 +42,10 @@ export const ViewResultsButton = (props: PollButtonProps) => {
|
|
|
59
42
|
<GenericPollButton onPress={onPressHandler} title={t('View Results')} />
|
|
60
43
|
{showResults ? (
|
|
61
44
|
<Modal animationType='slide' onRequestClose={onRequestClose} visible={showResults}>
|
|
62
|
-
<
|
|
63
|
-
<
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
</SafeAreaViewWrapper>
|
|
67
|
-
</SafeAreaProvider>
|
|
45
|
+
<SafeAreaViewWrapper style={{ backgroundColor: white, flex: 1 }}>
|
|
46
|
+
<PollModalHeader onPress={onRequestClose} title={t('Poll Results')} />
|
|
47
|
+
<PollResults message={message} poll={poll} />
|
|
48
|
+
</SafeAreaViewWrapper>
|
|
68
49
|
</Modal>
|
|
69
50
|
) : null}
|
|
70
51
|
</>
|
|
@@ -107,12 +88,10 @@ export const ShowAllOptionsButton = (props: PollButtonProps) => {
|
|
|
107
88
|
) : null}
|
|
108
89
|
{showAllOptions ? (
|
|
109
90
|
<Modal animationType='slide' onRequestClose={onRequestClose} visible={showAllOptions}>
|
|
110
|
-
<
|
|
111
|
-
<
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
</SafeAreaViewWrapper>
|
|
115
|
-
</SafeAreaProvider>
|
|
91
|
+
<SafeAreaViewWrapper style={{ backgroundColor: white, flex: 1 }}>
|
|
92
|
+
<PollModalHeader onPress={onRequestClose} title={t('Poll Options')} />
|
|
93
|
+
<PollAllOptions message={message} poll={poll} />
|
|
94
|
+
</SafeAreaViewWrapper>
|
|
116
95
|
</Modal>
|
|
117
96
|
) : null}
|
|
118
97
|
</>
|
|
@@ -155,12 +134,10 @@ export const ShowAllCommentsButton = (props: PollButtonProps) => {
|
|
|
155
134
|
) : null}
|
|
156
135
|
{showAnswers ? (
|
|
157
136
|
<Modal animationType='slide' onRequestClose={onRequestClose} visible={showAnswers}>
|
|
158
|
-
<
|
|
159
|
-
<
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
</SafeAreaViewWrapper>
|
|
163
|
-
</SafeAreaProvider>
|
|
137
|
+
<SafeAreaViewWrapper style={{ backgroundColor: white, flex: 1 }}>
|
|
138
|
+
<PollModalHeader onPress={onRequestClose} title={t('Poll Comments')} />
|
|
139
|
+
<PollAnswersList message={message} poll={poll} />
|
|
140
|
+
</SafeAreaViewWrapper>
|
|
164
141
|
</Modal>
|
|
165
142
|
) : null}
|
|
166
143
|
</>
|
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import {
|
|
3
|
-
Modal,
|
|
4
|
-
SafeAreaView as RNSafeAreaView,
|
|
5
|
-
StyleSheet,
|
|
6
|
-
Text,
|
|
7
|
-
View,
|
|
8
|
-
ViewStyle,
|
|
9
|
-
} from 'react-native';
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
SafeAreaProvider,
|
|
13
|
-
SafeAreaView as SafeAreaViewOriginal,
|
|
14
|
-
} from 'react-native-safe-area-context';
|
|
1
|
+
import React, { useCallback, useState } from 'react';
|
|
2
|
+
import { Modal, StyleSheet, Text, View } from 'react-native';
|
|
15
3
|
|
|
16
4
|
import { LocalMessage, Poll, PollOption, PollVote as PollVoteClass } from 'stream-chat';
|
|
17
5
|
|
|
@@ -25,24 +13,11 @@ import {
|
|
|
25
13
|
useTranslationContext,
|
|
26
14
|
} from '../../../../contexts';
|
|
27
15
|
|
|
16
|
+
import { SafeAreaViewWrapper } from '../../../UIComponents/SafeAreaViewWrapper';
|
|
28
17
|
import { usePollState } from '../../hooks/usePollState';
|
|
29
18
|
import { GenericPollButton } from '../Button';
|
|
30
19
|
import { PollModalHeader } from '../PollModalHeader';
|
|
31
20
|
|
|
32
|
-
// This is a workaround to support SafeAreaView on React Native 0.81.0+
|
|
33
|
-
const SafeAreaViewWrapper = ({ children, style }: PropsWithChildren<{ style: ViewStyle }>) => {
|
|
34
|
-
if (SafeAreaViewOriginal) {
|
|
35
|
-
return (
|
|
36
|
-
<SafeAreaProvider>
|
|
37
|
-
<SafeAreaViewOriginal edges={['bottom', 'top']} style={style}>
|
|
38
|
-
{children}
|
|
39
|
-
</SafeAreaViewOriginal>
|
|
40
|
-
</SafeAreaProvider>
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
return <RNSafeAreaView style={style}>{children}</RNSafeAreaView>;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
21
|
export type ShowAllVotesButtonProps = {
|
|
47
22
|
option: PollOption;
|
|
48
23
|
onPress?: ({
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
import { SafeAreaView as RNFSafeAreaView, ViewStyle } from 'react-native';
|
|
3
|
+
import {
|
|
4
|
+
SafeAreaProvider,
|
|
5
|
+
SafeAreaView as SafeAreaViewOriginal,
|
|
6
|
+
SafeAreaViewProps,
|
|
7
|
+
} from 'react-native-safe-area-context';
|
|
8
|
+
|
|
9
|
+
export const SafeAreaView = SafeAreaViewOriginal ?? RNFSafeAreaView;
|
|
10
|
+
|
|
11
|
+
export const SafeAreaViewWrapper = ({
|
|
12
|
+
children,
|
|
13
|
+
style,
|
|
14
|
+
...restProps
|
|
15
|
+
}: PropsWithChildren<{ style: ViewStyle }> & SafeAreaViewProps) => {
|
|
16
|
+
return (
|
|
17
|
+
<SafeAreaProvider>
|
|
18
|
+
<SafeAreaView edges={['bottom', 'top']} style={style} {...restProps}>
|
|
19
|
+
{children}
|
|
20
|
+
</SafeAreaView>
|
|
21
|
+
</SafeAreaProvider>
|
|
22
|
+
);
|
|
23
|
+
};
|
package/src/version.json
CHANGED