Skip to content

Commit 7497ba3

Browse files
committed
Merge branch 'khushal86-crns-501' of https://github.com/GetStream/stream-chat-react-native into khushal87-crns-501
2 parents 2a225e2 + d19c0ed commit 7497ba3

File tree

135 files changed

+1666
-1622
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+1666
-1622
lines changed

package/src/components/Attachment/Attachment.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,21 @@ import type { DefaultStreamChatGenerics } from '../../types/types';
1717
export type ActionHandler = (name: string, value: string) => void;
1818

1919
export type AttachmentPropsWithContext<
20-
StreamChatClient extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
20+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
2121
> = Pick<
22-
MessagesContextValue<StreamChatClient>,
22+
MessagesContextValue<StreamChatGenerics>,
2323
'AttachmentActions' | 'Card' | 'FileAttachment' | 'Gallery' | 'Giphy' | 'UrlPreview'
2424
> & {
2525
/**
2626
* The attachment to render
2727
*/
28-
attachment: AttachmentType<StreamChatClient>;
28+
attachment: AttachmentType<StreamChatGenerics>;
2929
};
3030

3131
const AttachmentWithContext = <
32-
StreamChatClient extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
32+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
3333
>(
34-
props: AttachmentPropsWithContext<StreamChatClient>,
34+
props: AttachmentPropsWithContext<StreamChatGenerics>,
3535
) => {
3636
const { attachment, AttachmentActions, Card, FileAttachment, Gallery, Giphy, UrlPreview } = props;
3737

@@ -82,9 +82,9 @@ const AttachmentWithContext = <
8282
}
8383
};
8484

85-
const areEqual = <StreamChatClient extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(
86-
prevProps: AttachmentPropsWithContext<StreamChatClient>,
87-
nextProps: AttachmentPropsWithContext<StreamChatClient>,
85+
const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(
86+
prevProps: AttachmentPropsWithContext<StreamChatGenerics>,
87+
nextProps: AttachmentPropsWithContext<StreamChatGenerics>,
8888
) => {
8989
const { attachment: prevAttachment } = prevProps;
9090
const { attachment: nextAttachment } = nextProps;
@@ -103,22 +103,22 @@ const MemoizedAttachment = React.memo(
103103
) as typeof AttachmentWithContext;
104104

105105
export type AttachmentProps<
106-
StreamChatClient extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
106+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
107107
> = Partial<
108108
Pick<
109-
MessagesContextValue<StreamChatClient>,
109+
MessagesContextValue<StreamChatGenerics>,
110110
'AttachmentActions' | 'Card' | 'FileAttachment' | 'Gallery' | 'Giphy' | 'UrlPreview'
111111
>
112112
> &
113-
Pick<AttachmentPropsWithContext<StreamChatClient>, 'attachment'>;
113+
Pick<AttachmentPropsWithContext<StreamChatGenerics>, 'attachment'>;
114114

115115
/**
116116
* Attachment - The message attachment
117117
*/
118118
export const Attachment = <
119-
StreamChatClient extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
119+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
120120
>(
121-
props: AttachmentProps<StreamChatClient>,
121+
props: AttachmentProps<StreamChatGenerics>,
122122
) => {
123123
const {
124124
attachment,
@@ -137,7 +137,7 @@ export const Attachment = <
137137
Gallery: ContextGallery,
138138
Giphy: ContextGiphy,
139139
UrlPreview: ContextUrlPreview,
140-
} = useMessagesContext<StreamChatClient>();
140+
} = useMessagesContext<StreamChatGenerics>();
141141

142142
if (!attachment) {
143143
return null;

package/src/components/Attachment/AttachmentActions.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ const styles = StyleSheet.create({
3434
});
3535

3636
export type AttachmentActionsPropsWithContext<
37-
StreamChatClient extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
38-
> = Pick<Attachment<StreamChatClient>, 'actions'> &
39-
Pick<MessageContextValue<StreamChatClient>, 'handleAction'> & {
37+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
38+
> = Pick<Attachment<StreamChatGenerics>, 'actions'> &
39+
Pick<MessageContextValue<StreamChatGenerics>, 'handleAction'> & {
4040
styles?: Partial<{
4141
actionButton: StyleProp<ViewStyle>;
4242
buttonText: StyleProp<TextStyle>;
@@ -45,9 +45,9 @@ export type AttachmentActionsPropsWithContext<
4545
};
4646

4747
const AttachmentActionsWithContext = <
48-
StreamChatClient extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
48+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
4949
>(
50-
props: AttachmentActionsPropsWithContext<StreamChatClient>,
50+
props: AttachmentActionsPropsWithContext<StreamChatGenerics>,
5151
) => {
5252
const { actions, handleAction, styles: stylesProp = {} } = props;
5353

@@ -116,9 +116,9 @@ const AttachmentActionsWithContext = <
116116
);
117117
};
118118

119-
const areEqual = <StreamChatClient extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(
120-
prevProps: AttachmentActionsPropsWithContext<StreamChatClient>,
121-
nextProps: AttachmentActionsPropsWithContext<StreamChatClient>,
119+
const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(
120+
prevProps: AttachmentActionsPropsWithContext<StreamChatGenerics>,
121+
nextProps: AttachmentActionsPropsWithContext<StreamChatGenerics>,
122122
) => {
123123
const { actions: prevActions } = prevProps;
124124
const { actions: nextActions } = nextProps;
@@ -134,20 +134,20 @@ const MemoizedAttachmentActions = React.memo(
134134
) as typeof AttachmentActionsWithContext;
135135

136136
export type AttachmentActionsProps<
137-
StreamChatClient extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
138-
> = Attachment<StreamChatClient> &
139-
Partial<Pick<MessageContextValue<StreamChatClient>, 'handleAction'>>;
137+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
138+
> = Attachment<StreamChatGenerics> &
139+
Partial<Pick<MessageContextValue<StreamChatGenerics>, 'handleAction'>>;
140140

141141
/**
142142
* AttachmentActions - The actions you can take on an attachment.
143143
* Actions in combination with attachments can be used to build [commands](https://getstream.io/chat/docs/#channel_commands).
144144
*/
145145
export const AttachmentActions = <
146-
StreamChatClient extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
146+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
147147
>(
148-
props: AttachmentActionsProps<StreamChatClient>,
148+
props: AttachmentActionsProps<StreamChatGenerics>,
149149
) => {
150-
const { handleAction } = useMessageContext<StreamChatClient>();
150+
const { handleAction } = useMessageContext<StreamChatGenerics>();
151151
return <MemoizedAttachmentActions {...{ handleAction }} {...props} />;
152152
};
153153

package/src/components/Attachment/Card.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ const goToURL = (url?: string) => {
7979
};
8080

8181
export type CardPropsWithContext<
82-
StreamChatClient extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
83-
> = Attachment<StreamChatClient> &
82+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
83+
> = Attachment<StreamChatGenerics> &
8484
Pick<
85-
MessageContextValue<StreamChatClient>,
85+
MessageContextValue<StreamChatGenerics>,
8686
'onLongPress' | 'onPress' | 'onPressIn' | 'preventPress'
8787
> &
8888
Pick<
89-
MessagesContextValue<StreamChatClient>,
89+
MessagesContextValue<StreamChatGenerics>,
9090
'additionalTouchableProps' | 'CardCover' | 'CardFooter' | 'CardHeader'
9191
> & {
9292
channelId: string | undefined;
@@ -106,9 +106,9 @@ export type CardPropsWithContext<
106106
};
107107

108108
const CardWithContext = <
109-
StreamChatClient extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
109+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
110110
>(
111-
props: CardPropsWithContext<StreamChatClient>,
111+
props: CardPropsWithContext<StreamChatGenerics>,
112112
) => {
113113
const {
114114
additionalTouchableProps,
@@ -268,12 +268,12 @@ const CardWithContext = <
268268
const MemoizedCard = React.memo(CardWithContext, () => true) as typeof CardWithContext;
269269

270270
export type CardProps<
271-
StreamChatClient extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
272-
> = Attachment<StreamChatClient> &
271+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
272+
> = Attachment<StreamChatGenerics> &
273273
Partial<
274-
Pick<MessageContextValue<StreamChatClient>, 'onLongPress' | 'onPress' | 'onPressIn'> &
274+
Pick<MessageContextValue<StreamChatGenerics>, 'onLongPress' | 'onPress' | 'onPressIn'> &
275275
Pick<
276-
MessagesContextValue<StreamChatClient>,
276+
MessagesContextValue<StreamChatGenerics>,
277277
'additionalTouchableProps' | 'CardCover' | 'CardFooter' | 'CardHeader'
278278
>
279279
>;
@@ -282,14 +282,14 @@ export type CardProps<
282282
* UI component for card in attachments.
283283
*/
284284
export const Card = <
285-
StreamChatClient extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
285+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
286286
>(
287-
props: CardProps<StreamChatClient>,
287+
props: CardProps<StreamChatGenerics>,
288288
) => {
289289
const { message, onLongPress, onPress, onPressIn, preventPress } =
290-
useMessageContext<StreamChatClient>();
290+
useMessageContext<StreamChatGenerics>();
291291
const { additionalTouchableProps, CardCover, CardFooter, CardHeader } =
292-
useMessagesContext<StreamChatClient>();
292+
useMessagesContext<StreamChatGenerics>();
293293

294294
return (
295295
<MemoizedCard

package/src/components/Attachment/FileAttachment.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,17 @@ const styles = StyleSheet.create({
4747
});
4848

4949
export type FileAttachmentPropsWithContext<
50-
StreamChatClient extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
50+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
5151
> = Pick<
52-
MessageContextValue<StreamChatClient>,
52+
MessageContextValue<StreamChatGenerics>,
5353
'onLongPress' | 'onPress' | 'onPressIn' | 'preventPress'
5454
> &
5555
Pick<
56-
MessagesContextValue<StreamChatClient>,
56+
MessagesContextValue<StreamChatGenerics>,
5757
'additionalTouchableProps' | 'AttachmentActions' | 'FileAttachmentIcon'
5858
> & {
5959
/** The attachment to render */
60-
attachment: Attachment<StreamChatClient>;
60+
attachment: Attachment<StreamChatGenerics>;
6161
attachmentSize?: number;
6262
styles?: Partial<{
6363
container: StyleProp<ViewStyle>;
@@ -68,9 +68,9 @@ export type FileAttachmentPropsWithContext<
6868
};
6969

7070
const FileAttachmentWithContext = <
71-
StreamChatClient extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
71+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
7272
>(
73-
props: FileAttachmentPropsWithContext<StreamChatClient>,
73+
props: FileAttachmentPropsWithContext<StreamChatGenerics>,
7474
) => {
7575
const {
7676
additionalTouchableProps,
@@ -145,21 +145,21 @@ const FileAttachmentWithContext = <
145145
};
146146

147147
export type FileAttachmentProps<
148-
StreamChatClient extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
149-
> = Partial<Omit<FileAttachmentPropsWithContext<StreamChatClient>, 'attachment'>> &
150-
Pick<FileAttachmentPropsWithContext<StreamChatClient>, 'attachment'>;
148+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
149+
> = Partial<Omit<FileAttachmentPropsWithContext<StreamChatGenerics>, 'attachment'>> &
150+
Pick<FileAttachmentPropsWithContext<StreamChatGenerics>, 'attachment'>;
151151

152152
export const FileAttachment = <
153-
StreamChatClient extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
153+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
154154
>(
155-
props: FileAttachmentProps<StreamChatClient>,
155+
props: FileAttachmentProps<StreamChatGenerics>,
156156
) => {
157-
const { onLongPress, onPress, onPressIn, preventPress } = useMessageContext<StreamChatClient>();
157+
const { onLongPress, onPress, onPressIn, preventPress } = useMessageContext<StreamChatGenerics>();
158158
const {
159159
additionalTouchableProps,
160160
AttachmentActions = AttachmentActionsDefault,
161161
FileAttachmentIcon = FileIconDefault,
162-
} = useMessagesContext<StreamChatClient>();
162+
} = useMessagesContext<StreamChatGenerics>();
163163

164164
return (
165165
<FileAttachmentWithContext

package/src/components/Attachment/FileAttachmentGroup.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ const styles = StyleSheet.create({
2222
});
2323

2424
export type FileAttachmentGroupPropsWithContext<
25-
StreamChatClient extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
26-
> = Pick<MessageContextValue<StreamChatClient>, 'files'> &
27-
Pick<MessagesContextValue<StreamChatClient>, 'Attachment'> & {
25+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
26+
> = Pick<MessageContextValue<StreamChatGenerics>, 'files'> &
27+
Pick<MessagesContextValue<StreamChatGenerics>, 'Attachment'> & {
2828
/**
2929
* The unique id for the message with file attachments
3030
*/
@@ -36,9 +36,9 @@ export type FileAttachmentGroupPropsWithContext<
3636
};
3737

3838
const FileAttachmentGroupWithContext = <
39-
StreamChatClient extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
39+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
4040
>(
41-
props: FileAttachmentGroupPropsWithContext<StreamChatClient>,
41+
props: FileAttachmentGroupPropsWithContext<StreamChatGenerics>,
4242
) => {
4343
const { Attachment, files, messageId, styles: stylesProp = {} } = props;
4444

@@ -67,9 +67,9 @@ const FileAttachmentGroupWithContext = <
6767
);
6868
};
6969

70-
const areEqual = <StreamChatClient extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(
71-
prevProps: FileAttachmentGroupPropsWithContext<StreamChatClient>,
72-
nextProps: FileAttachmentGroupPropsWithContext<StreamChatClient>,
70+
const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(
71+
prevProps: FileAttachmentGroupPropsWithContext<StreamChatGenerics>,
72+
nextProps: FileAttachmentGroupPropsWithContext<StreamChatGenerics>,
7373
) => {
7474
const { files: prevFiles } = prevProps;
7575
const { files: nextFiles } = nextProps;
@@ -85,20 +85,20 @@ const MemoizedFileAttachmentGroup = React.memo(
8585
) as typeof FileAttachmentGroupWithContext;
8686

8787
export type FileAttachmentGroupProps<
88-
StreamChatClient extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
89-
> = Partial<Omit<FileAttachmentGroupPropsWithContext<StreamChatClient>, 'messageId'>> &
90-
Pick<FileAttachmentGroupPropsWithContext<StreamChatClient>, 'messageId'>;
88+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
89+
> = Partial<Omit<FileAttachmentGroupPropsWithContext<StreamChatGenerics>, 'messageId'>> &
90+
Pick<FileAttachmentGroupPropsWithContext<StreamChatGenerics>, 'messageId'>;
9191

9292
export const FileAttachmentGroup = <
93-
StreamChatClient extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
93+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
9494
>(
95-
props: FileAttachmentGroupProps<StreamChatClient>,
95+
props: FileAttachmentGroupProps<StreamChatGenerics>,
9696
) => {
9797
const { files: propFiles, messageId } = props;
9898

99-
const { files: contextFiles } = useMessageContext<StreamChatClient>();
99+
const { files: contextFiles } = useMessageContext<StreamChatGenerics>();
100100

101-
const { Attachment = AttachmentDefault } = useMessagesContext<StreamChatClient>();
101+
const { Attachment = AttachmentDefault } = useMessagesContext<StreamChatGenerics>();
102102

103103
const files = propFiles || contextFiles;
104104

0 commit comments

Comments
 (0)