GetStream / stream-chat-react-native

💬 React-Native Chat SDK ➜ Stream Chat. Includes a tutorial on building your own chat app experience using React-Native, React-Navigation and Stream
https://getstream.io/chat/sdk/react-native/
Other
975 stars 325 forks source link

[🐛] UploadProgressIndicatorProps should extend PropsWithChildren #2324

Closed VNDRN closed 11 months ago

VNDRN commented 11 months ago

Issue

The ImageUploadPreview component uses the UploadProgressIndicator with children, according to the types, this isn't possible. It should be

Steps to reproduce

Steps to reproduce the behavior:

use the UploadProgressIndicator like it is used in the ImageUploadPreview component.

Expected behavior

It has a children prop.

This patch should fix the issue:

diff --git a/node_modules/stream-chat-react-native-core/lib/typescript/components/MessageInput/UploadProgressIndicator.d.ts b/node_modules/stream-chat-react-native-core/lib/typescript/components/MessageInput/UploadProgressIndicator.d.ts
index 4a1e64c..fb96fc7 100644
--- a/node_modules/stream-chat-react-native-core/lib/typescript/components/MessageInput/UploadProgressIndicator.d.ts
+++ b/node_modules/stream-chat-react-native-core/lib/typescript/components/MessageInput/UploadProgressIndicator.d.ts
@@ -1,11 +1,11 @@
 import React from 'react';
 import { GestureResponderEvent, StyleProp, ViewStyle } from 'react-native';
-export declare type UploadProgressIndicatorProps = {
+export declare type UploadProgressIndicatorProps = PropsWithChildren<{
     /** Action triggered when clicked indicator */
     action?: (event: GestureResponderEvent) => void;
     /** style */
     style?: StyleProp<ViewStyle>;
     /** Type of active indicator */
     type?: 'in_progress' | 'retry' | 'not_supported' | 'inactive' | null;
-};
+}>;
 export declare const UploadProgressIndicator: React.FC<UploadProgressIndicatorProps>;
diff --git a/node_modules/stream-chat-react-native-core/src/components/MessageInput/UploadProgressIndicator.tsx b/node_modules/stream-chat-react-native-core/src/components/MessageInput/UploadProgressIndicator.tsx
index 7a820e9..55924aa 100644
--- a/node_modules/stream-chat-react-native-core/src/components/MessageInput/UploadProgressIndicator.tsx
+++ b/node_modules/stream-chat-react-native-core/src/components/MessageInput/UploadProgressIndicator.tsx
@@ -1,4 +1,4 @@
-import React from 'react';
+import React, { PropsWithChildren } from 'react';
 import {
   ActivityIndicator,
   GestureResponderEvent,
@@ -15,14 +15,14 @@ import { ProgressIndicatorTypes } from '../../utils/utils';

 const REFRESH_ICON_SIZE = 18;

-export type UploadProgressIndicatorProps = {
+export type UploadProgressIndicatorProps = PropsWithChildren<{
   /** Action triggered when clicked indicator */
   action?: (event: GestureResponderEvent) => void;
   /** style */
   style?: StyleProp<ViewStyle>;
   /** Type of active indicator */
   type?: 'in_progress' | 'retry' | 'not_supported' | 'inactive' | null;
-};
+}>;

 export const UploadProgressIndicator: React.FC<UploadProgressIndicatorProps> = (props) => {
   const { action, children, style, type } = props;

Project Related Information

Customization

Click To Expand

```typescript jsx # N/A ```

Offline support

Environment

Click To Expand

#### `package.json`: ```json # N/A ``` **`react-native info` output:** ``` OUTPUT GOES HERE ``` - **Platform that you're experiencing the issue on**: - [ ] iOS - [ ] Android - [ ] **iOS** but have not tested behavior on Android - [ ] **Android** but have not tested behavior on iOS - [x] Both - **`stream-chat-react-native` version you're using that has this issue:** - `e.g. 5.21.0` - Device/Emulator info: - [ ] I am using a physical device - OS version: `e.g. Android 10` - Device/Emulator: `e.g. iPhone 11`

Additional context

Screenshots

Click To Expand


stream-ci-bot commented 11 months ago

:tada: This issue has been resolved in version 5.22.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: