Skip to content

Commit 2a7aba9

Browse files
committed
refactor: rename WithComponents prop from value to overrides
Aligns with stream-chat-react's WithComponents API where the prop is named `overrides` instead of `value`.
1 parent efac0d8 commit 2a7aba9

14 files changed

Lines changed: 50 additions & 50 deletions

File tree

examples/ExpoMessaging/app/channel/[cid]/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export default function ChannelScreen() {
7171
<Stack.Screen
7272
options={{ title: 'Channel Screen', contentStyle: { backgroundColor: 'white' } }}
7373
/>
74-
<WithComponents value={{ MessageLocation, InputButtons }}>
74+
<WithComponents overrides={{ MessageLocation, InputButtons }}>
7575
<Channel
7676
audioRecordingEnabled={true}
7777
channel={channel}

examples/SampleApp/src/screens/ChannelListScreen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ export const ChannelListScreen: React.FC = () => {
246246
<View style={{ flex: searchQuery ? 0 : 1 }}>
247247
<View style={[styles.channelListContainer, { opacity: searchQuery ? 0 : 1 }]}>
248248
<WithComponents
249-
value={{
249+
overrides={{
250250
HeaderNetworkDownIndicator,
251251
Preview: ChannelPreview,
252252
}}

examples/SampleApp/src/screens/ChannelScreen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ export const ChannelScreen: React.FC<ChannelScreenProps> = ({ navigation, route
267267
return (
268268
<View style={[styles.flex, { backgroundColor: 'transparent' }]}>
269269
<WithComponents
270-
value={{
270+
overrides={{
271271
AttachmentPickerSelectionBar: CustomAttachmentPickerSelectionBar,
272272
AttachmentPickerContent: CustomAttachmentPickerContent,
273273
MessageLocation,

examples/SampleApp/src/screens/NewDirectMessagingScreen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ export const NewDirectMessagingScreen: React.FC<NewDirectMessagingScreenProps> =
340340
]}
341341
>
342342
<WithComponents
343-
value={{
343+
overrides={{
344344
EmptyStateIndicator: EmptyMessagesIndicator,
345345
SendButton: NewDirectMessagingSendButton,
346346
}}

examples/SampleApp/src/screens/SharedGroupsScreen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ export const SharedGroupsScreen: React.FC<SharedGroupsScreenProps> = ({
180180
<View style={styles.container}>
181181
<ScreenHeader titleText='Shared Groups' />
182182
<WithComponents
183-
value={{
183+
overrides={{
184184
EmptyStateIndicator: SharedGroupsEmptyState,
185185
Preview: CustomPreview,
186186
}}

examples/SampleApp/src/screens/ThreadScreen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export const ThreadScreen: React.FC<ThreadScreenProps> = ({
150150
return (
151151
<View style={[styles.container, { backgroundColor: white }]}>
152152
<WithComponents
153-
value={{
153+
overrides={{
154154
AttachmentPickerSelectionBar: CustomAttachmentPickerSelectionBar,
155155
MessageLocation,
156156
}}

package/src/__tests__/offline-support/offline-feature.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ export const Generic = () => {
207207
const renderComponent = () =>
208208
render(
209209
<Chat client={chatClient} enableOfflineSupport>
210-
<WithComponents value={{ Preview: ChannelPreviewComponent }}>
210+
<WithComponents overrides={{ Preview: ChannelPreviewComponent }}>
211211
<ChannelList filters={filters} sort={sort} swipeActionsEnabled={false} />
212212
</WithComponents>
213213
</Chat>,

package/src/components/ChannelList/__tests__/ChannelList.test.js

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ describe('ChannelList', () => {
119119

120120
const { getByTestId } = render(
121121
<Chat client={chatClient}>
122-
<WithComponents value={{ Preview: ChannelPreviewComponent }}>
122+
<WithComponents overrides={{ Preview: ChannelPreviewComponent }}>
123123
<ChannelList {...props} />
124124
</WithComponents>
125125
</Chat>,
@@ -133,7 +133,7 @@ describe('ChannelList', () => {
133133

134134
const { getByTestId } = render(
135135
<Chat client={chatClient}>
136-
<WithComponents value={{ Preview: ChannelPreviewComponent }}>
136+
<WithComponents overrides={{ Preview: ChannelPreviewComponent }}>
137137
<ChannelList {...props} />
138138
</WithComponents>
139139
</Chat>,
@@ -147,7 +147,7 @@ describe('ChannelList', () => {
147147

148148
render(
149149
<Chat client={chatClient}>
150-
<WithComponents value={{ Preview: ChannelPreviewComponent }}>
150+
<WithComponents overrides={{ Preview: ChannelPreviewComponent }}>
151151
<ChannelList {...props} />
152152
</WithComponents>
153153
</Chat>,
@@ -162,7 +162,7 @@ describe('ChannelList', () => {
162162

163163
screen.rerender(
164164
<Chat client={chatClient}>
165-
<WithComponents value={{ Preview: ChannelPreviewComponent }}>
165+
<WithComponents overrides={{ Preview: ChannelPreviewComponent }}>
166166
<ChannelList {...props} filters={{ dummyFilter: true }} />
167167
</WithComponents>
168168
</Chat>,
@@ -204,7 +204,7 @@ describe('ChannelList', () => {
204204

205205
const { rerender, queryByTestId } = render(
206206
<Chat client={chatClient}>
207-
<WithComponents value={{ Preview: ChannelPreviewComponent }}>
207+
<WithComponents overrides={{ Preview: ChannelPreviewComponent }}>
208208
<ChannelList {...props} filters={staleFilter} />
209209
</WithComponents>
210210
</Chat>,
@@ -224,7 +224,7 @@ describe('ChannelList', () => {
224224

225225
rerender(
226226
<Chat client={chatClient}>
227-
<WithComponents value={{ Preview: ChannelPreviewComponent }}>
227+
<WithComponents overrides={{ Preview: ChannelPreviewComponent }}>
228228
<ChannelList {...props} filters={freshFilter} />
229229
</WithComponents>
230230
</Chat>,
@@ -254,7 +254,7 @@ describe('ChannelList', () => {
254254

255255
render(
256256
<Chat client={chatClient}>
257-
<WithComponents value={{ Preview: ChannelPreviewComponent }}>
257+
<WithComponents overrides={{ Preview: ChannelPreviewComponent }}>
258258
<ChannelList {...props} onSelect={setActiveChannel} />
259259
</WithComponents>
260260
</Chat>,
@@ -276,7 +276,7 @@ describe('ChannelList', () => {
276276

277277
const { getByTestId } = render(
278278
<Chat client={chatClient}>
279-
<WithComponents value={{ Preview: SwipeActionsProbe }}>
279+
<WithComponents overrides={{ Preview: SwipeActionsProbe }}>
280280
<ChannelList {...props} swipeActionsEnabled={false} />
281281
</WithComponents>
282282
</Chat>,
@@ -291,7 +291,7 @@ describe('ChannelList', () => {
291291

292292
const { getByTestId } = render(
293293
<Chat client={chatClient}>
294-
<WithComponents value={{ Preview: SwipeActionsProbe }}>
294+
<WithComponents overrides={{ Preview: SwipeActionsProbe }}>
295295
<ChannelList {...props} />
296296
</WithComponents>
297297
</Chat>,
@@ -306,7 +306,7 @@ describe('ChannelList', () => {
306306

307307
const { getByTestId, queryByTestId } = render(
308308
<Chat client={chatClient}>
309-
<WithComponents value={{ Preview: ChannelPreviewContent }}>
309+
<WithComponents overrides={{ Preview: ChannelPreviewContent }}>
310310
<ChannelList {...props} swipeActionsEnabled={false} />
311311
</WithComponents>
312312
</Chat>,
@@ -323,7 +323,7 @@ describe('ChannelList', () => {
323323

324324
const { getByTestId } = render(
325325
<Chat client={chatClient}>
326-
<WithComponents value={{ Preview: ChannelPreviewContent }}>
326+
<WithComponents overrides={{ Preview: ChannelPreviewContent }}>
327327
<ChannelList {...props} swipeActionsEnabled={true} />
328328
</WithComponents>
329329
</Chat>,
@@ -395,7 +395,7 @@ describe('ChannelList', () => {
395395
it('should move channel to top of the list by default', async () => {
396396
render(
397397
<Chat client={chatClient}>
398-
<WithComponents value={{ Preview: ChannelPreviewComponent }}>
398+
<WithComponents overrides={{ Preview: ChannelPreviewComponent }}>
399399
<ChannelList {...props} />
400400
</WithComponents>
401401
</Chat>,
@@ -419,7 +419,7 @@ describe('ChannelList', () => {
419419
it('should add channel to top if channel is hidden from the list', async () => {
420420
render(
421421
<Chat client={chatClient}>
422-
<WithComponents value={{ Preview: ChannelPreviewComponent }}>
422+
<WithComponents overrides={{ Preview: ChannelPreviewComponent }}>
423423
<ChannelList {...props} />
424424
</WithComponents>
425425
</Chat>,
@@ -449,7 +449,7 @@ describe('ChannelList', () => {
449449
it('should not alter order if `lockChannelOrder` prop is true', async () => {
450450
render(
451451
<Chat client={chatClient}>
452-
<WithComponents value={{ Preview: ChannelPreviewComponent }}>
452+
<WithComponents overrides={{ Preview: ChannelPreviewComponent }}>
453453
<ChannelList lockChannelOrder={true} />
454454
</WithComponents>
455455
</Chat>,
@@ -475,7 +475,7 @@ describe('ChannelList', () => {
475475
const onNewMessage = jest.fn();
476476
render(
477477
<Chat client={chatClient}>
478-
<WithComponents value={{ Preview: ChannelPreviewComponent }}>
478+
<WithComponents overrides={{ Preview: ChannelPreviewComponent }}>
479479
<ChannelList {...props} onNewMessage={onNewMessage} />
480480
</WithComponents>
481481
</Chat>,
@@ -504,7 +504,7 @@ describe('ChannelList', () => {
504504
it('should move a channel to top of the list by default', async () => {
505505
render(
506506
<Chat client={chatClient}>
507-
<WithComponents value={{ Preview: ChannelPreviewComponent }}>
507+
<WithComponents overrides={{ Preview: ChannelPreviewComponent }}>
508508
<ChannelList {...props} />
509509
</WithComponents>
510510
</Chat>,
@@ -528,7 +528,7 @@ describe('ChannelList', () => {
528528
const onNewMessage = jest.fn();
529529
render(
530530
<Chat client={chatClient}>
531-
<WithComponents value={{ Preview: ChannelPreviewComponent }}>
531+
<WithComponents overrides={{ Preview: ChannelPreviewComponent }}>
532532
<ChannelList {...props} onNewMessage={onNewMessage} />
533533
</WithComponents>
534534
</Chat>,
@@ -549,7 +549,7 @@ describe('ChannelList', () => {
549549
const onNewMessageNotification = jest.fn();
550550
render(
551551
<Chat client={chatClient}>
552-
<WithComponents value={{ Preview: ChannelPreviewComponent }}>
552+
<WithComponents overrides={{ Preview: ChannelPreviewComponent }}>
553553
<ChannelList {...props} onNewMessageNotification={onNewMessageNotification} />
554554
</WithComponents>
555555
</Chat>,
@@ -578,7 +578,7 @@ describe('ChannelList', () => {
578578
it('should move a channel to top of the list by default', async () => {
579579
render(
580580
<Chat client={chatClient}>
581-
<WithComponents value={{ Preview: ChannelPreviewComponent }}>
581+
<WithComponents overrides={{ Preview: ChannelPreviewComponent }}>
582582
<ChannelList {...props} />
583583
</WithComponents>
584584
</Chat>,
@@ -605,7 +605,7 @@ describe('ChannelList', () => {
605605
const onAddedToChannel = jest.fn();
606606
render(
607607
<Chat client={chatClient}>
608-
<WithComponents value={{ Preview: ChannelPreviewComponent }}>
608+
<WithComponents overrides={{ Preview: ChannelPreviewComponent }}>
609609
<ChannelList {...props} onAddedToChannel={onAddedToChannel} />
610610
</WithComponents>
611611
</Chat>,
@@ -631,7 +631,7 @@ describe('ChannelList', () => {
631631
it('should remove the channel from list by default', async () => {
632632
render(
633633
<Chat client={chatClient}>
634-
<WithComponents value={{ Preview: ChannelPreviewComponent }}>
634+
<WithComponents overrides={{ Preview: ChannelPreviewComponent }}>
635635
<ChannelList {...props} />
636636
</WithComponents>
637637
</Chat>,
@@ -658,7 +658,7 @@ describe('ChannelList', () => {
658658
const onRemovedFromChannel = jest.fn();
659659
render(
660660
<Chat client={chatClient}>
661-
<WithComponents value={{ Preview: ChannelPreviewComponent }}>
661+
<WithComponents overrides={{ Preview: ChannelPreviewComponent }}>
662662
<ChannelList {...props} onRemovedFromChannel={onRemovedFromChannel} />
663663
</WithComponents>
664664
</Chat>,
@@ -684,7 +684,7 @@ describe('ChannelList', () => {
684684
it('should update a channel in the list by default', async () => {
685685
render(
686686
<Chat client={chatClient}>
687-
<WithComponents value={{ Preview: ChannelPreviewComponent }}>
687+
<WithComponents overrides={{ Preview: ChannelPreviewComponent }}>
688688
<ChannelList {...props} />
689689
</WithComponents>
690690
</Chat>,
@@ -710,7 +710,7 @@ describe('ChannelList', () => {
710710
const onChannelUpdated = jest.fn();
711711
render(
712712
<Chat client={chatClient}>
713-
<WithComponents value={{ Preview: ChannelPreviewComponent }}>
713+
<WithComponents overrides={{ Preview: ChannelPreviewComponent }}>
714714
<ChannelList {...props} onChannelUpdated={onChannelUpdated} />
715715
</WithComponents>
716716
</Chat>,
@@ -741,7 +741,7 @@ describe('ChannelList', () => {
741741
it('should remove a channel from the list by default', async () => {
742742
render(
743743
<Chat client={chatClient}>
744-
<WithComponents value={{ Preview: ChannelPreviewComponent }}>
744+
<WithComponents overrides={{ Preview: ChannelPreviewComponent }}>
745745
<ChannelList {...props} />
746746
</WithComponents>
747747
</Chat>,
@@ -768,7 +768,7 @@ describe('ChannelList', () => {
768768
const onChannelDeleted = jest.fn();
769769
render(
770770
<Chat client={chatClient}>
771-
<WithComponents value={{ Preview: ChannelPreviewComponent }}>
771+
<WithComponents overrides={{ Preview: ChannelPreviewComponent }}>
772772
<ChannelList {...props} onChannelDeleted={onChannelDeleted} />
773773
</WithComponents>
774774
</Chat>,
@@ -794,7 +794,7 @@ describe('ChannelList', () => {
794794
it('should hide a channel from the list by default', async () => {
795795
render(
796796
<Chat client={chatClient}>
797-
<WithComponents value={{ Preview: ChannelPreviewComponent }}>
797+
<WithComponents overrides={{ Preview: ChannelPreviewComponent }}>
798798
<ChannelList {...props} />
799799
</WithComponents>
800800
</Chat>,
@@ -821,7 +821,7 @@ describe('ChannelList', () => {
821821
const onChannelHidden = jest.fn();
822822
render(
823823
<Chat client={chatClient}>
824-
<WithComponents value={{ Preview: ChannelPreviewComponent }}>
824+
<WithComponents overrides={{ Preview: ChannelPreviewComponent }}>
825825
<ChannelList {...props} onChannelHidden={onChannelHidden} />
826826
</WithComponents>
827827
</Chat>,
@@ -846,7 +846,7 @@ describe('ChannelList', () => {
846846

847847
render(
848848
<Chat client={chatClient}>
849-
<WithComponents value={{ Preview: ChannelPreviewComponent }}>
849+
<WithComponents overrides={{ Preview: ChannelPreviewComponent }}>
850850
<ChannelList {...props} />
851851
</WithComponents>
852852
</Chat>,
@@ -874,7 +874,7 @@ describe('ChannelList', () => {
874874

875875
render(
876876
<Chat client={chatClient}>
877-
<WithComponents value={{ Preview: RefreshingProbe }}>
877+
<WithComponents overrides={{ Preview: RefreshingProbe }}>
878878
<ChannelList {...props} />
879879
</WithComponents>
880880
</Chat>,
@@ -909,7 +909,7 @@ describe('ChannelList', () => {
909909
const onChannelTruncated = jest.fn();
910910
render(
911911
<Chat client={chatClient}>
912-
<WithComponents value={{ Preview: ChannelPreviewComponent }}>
912+
<WithComponents overrides={{ Preview: ChannelPreviewComponent }}>
913913
<ChannelList {...props} onChannelTruncated={onChannelTruncated} />
914914
</WithComponents>
915915
</Chat>,

package/src/components/ChannelPreview/__tests__/ChannelDetailsBottomSheet.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ describe('ChannelDetailsBottomSheet', () => {
4646

4747
const { getByTestId } = render(
4848
<ThemeProvider theme={defaultTheme}>
49-
<WithComponents value={{ ChannelDetailsHeader: CustomChannelDetailsHeader }}>
49+
<WithComponents overrides={{ ChannelDetailsHeader: CustomChannelDetailsHeader }}>
5050
<ChannelDetailsBottomSheet channel={channel} items={items} />
5151
</WithComponents>
5252
</ThemeProvider>,
@@ -62,7 +62,7 @@ describe('ChannelDetailsBottomSheet', () => {
6262

6363
render(
6464
<ThemeProvider theme={defaultTheme}>
65-
<WithComponents value={{ ChannelDetailsHeader: () => null }}>
65+
<WithComponents overrides={{ ChannelDetailsHeader: () => null }}>
6666
<ChannelDetailsBottomSheet
6767
channel={channel}
6868
items={items}

package/src/components/ChannelPreview/__tests__/ChannelPreview.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ describe('ChannelPreview', () => {
8484

8585
return (
8686
<Chat client={chatClient}>
87-
<WithComponents value={{ Preview: ChannelPreviewUIComponent }}>
87+
<WithComponents overrides={{ Preview: ChannelPreviewUIComponent }}>
8888
<ChannelPreview {...props} channel={channel} client={chatClient} />
8989
</WithComponents>
9090
</Chat>

0 commit comments

Comments
 (0)