Skip to content

Commit b78cc53

Browse files
committed
fix: review fixes
1 parent f912506 commit b78cc53

8 files changed

Lines changed: 98 additions & 85 deletions

File tree

examples/SampleApp/src/screens/ChannelDetailsScreen.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ export const ChannelDetailsScreen: React.FC<Props> = ({
4242

4343
const getChannelMemberActionItems = useCallback<GetChannelMemberActionItems>(
4444
({ context, defaultItems }) => {
45-
const user = context.member.user;
4645
// Don't offer sending a direct message to yourself.
47-
if (!user || user.id === context.channel.getClient().userID) {
46+
if (context.isCurrentUser) {
4847
return defaultItems;
4948
}
49+
const user = context.member.user;
5050
return [
5151
{
5252
action: () => {

package/src/components/ChannelDetailsScreen/__tests__/ChannelDetailsActionItem.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ describe('ChannelDetailsActionItem', () => {
8181
return styles.find((s) => s?.color)?.color;
8282
};
8383

84-
it('uses the same color for fill and stroke', () => {
84+
it('colors the icon via stroke', () => {
8585
renderItem();
8686
const icon = lastIconProps();
87-
expect(icon.fill).toBe(icon.stroke);
87+
expect(icon.stroke).toBeTruthy();
8888
});
8989

9090
it('paints the icon and label differently when destructive vs standard', () => {
9191
const { rerender } = renderItem({ destructive: false });
92-
const standardIcon = lastIconProps().fill;
92+
const standardIcon = lastIconProps().stroke;
9393
const standardLabelColor = labelColor();
9494

9595
TestIcon.mockClear();
@@ -98,7 +98,7 @@ describe('ChannelDetailsActionItem', () => {
9898
<ChannelDetailsActionItem Icon={TestIcon} destructive label='Pinned Messages' />
9999
</ThemeProvider>,
100100
);
101-
const destructiveIcon = lastIconProps().fill;
101+
const destructiveIcon = lastIconProps().stroke;
102102
const destructiveLabelColor = labelColor();
103103

104104
expect(destructiveIcon).not.toBe(standardIcon);

package/src/components/ChannelDetailsScreen/components/ChannelDetailsActionItem.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,8 @@ export const ChannelDetailsActionItem = ({
4444

4545
const content = (
4646
<View style={[styles.contentContainer, containerOverride]}>
47-
<View
48-
accessibilityElementsHidden
49-
importantForAccessibility='no-hide-descendants'
50-
style={[styles.iconWrapper, iconWrapperOverride]}
51-
>
52-
<Icon fill={iconColor} height={20} stroke={iconColor} width={20} />
47+
<View style={[styles.iconWrapper, iconWrapperOverride]}>
48+
<Icon height={20} stroke={iconColor} width={20} />
5349
</View>
5450
<Text
5551
numberOfLines={1}

package/src/components/MessageInput/__tests__/__snapshots__/AttachButton.test.tsx.snap

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,8 @@ exports[`AttachButton should call handleAttachButtonPress when the button is cli
427427
meetOrSlice={0}
428428
minX={0}
429429
minY={0}
430+
stroke="#1a1b25"
431+
strokeLinejoin="round"
430432
strokeWidth={1.5}
431433
style={
432434
[
@@ -450,9 +452,18 @@ exports[`AttachButton should call handleAttachButtonPress when the button is cli
450452
propList={
451453
[
452454
"fill",
455+
"stroke",
453456
"strokeWidth",
457+
"strokeLinejoin",
454458
]
455459
}
460+
stroke={
461+
{
462+
"payload": 4279900965,
463+
"type": 0,
464+
}
465+
}
466+
strokeLinejoin={1}
456467
strokeWidth={1.5}
457468
>
458469
<RNSVGPath
@@ -467,8 +478,6 @@ exports[`AttachButton should call handleAttachButtonPress when the button is cli
467478
[
468479
"stroke",
469480
"strokeWidth",
470-
"strokeLinecap",
471-
"strokeLinejoin",
472481
]
473482
}
474483
stroke={
@@ -477,8 +486,6 @@ exports[`AttachButton should call handleAttachButtonPress when the button is cli
477486
"type": 0,
478487
}
479488
}
480-
strokeLinecap={1}
481-
strokeLinejoin={1}
482489
strokeWidth={1.5}
483490
/>
484491
<RNSVGPath
@@ -493,8 +500,6 @@ exports[`AttachButton should call handleAttachButtonPress when the button is cli
493500
[
494501
"stroke",
495502
"strokeWidth",
496-
"strokeLinecap",
497-
"strokeLinejoin",
498503
]
499504
}
500505
stroke={
@@ -503,8 +508,6 @@ exports[`AttachButton should call handleAttachButtonPress when the button is cli
503508
"type": 0,
504509
}
505510
}
506-
strokeLinecap={1}
507-
strokeLinejoin={1}
508511
strokeWidth={1.5}
509512
/>
510513
</RNSVGGroup>
@@ -1339,6 +1342,8 @@ exports[`AttachButton should render a enabled AttachButton 1`] = `
13391342
meetOrSlice={0}
13401343
minX={0}
13411344
minY={0}
1345+
stroke="#1a1b25"
1346+
strokeLinejoin="round"
13421347
strokeWidth={1.5}
13431348
style={
13441349
[
@@ -1362,9 +1367,18 @@ exports[`AttachButton should render a enabled AttachButton 1`] = `
13621367
propList={
13631368
[
13641369
"fill",
1370+
"stroke",
13651371
"strokeWidth",
1372+
"strokeLinejoin",
13661373
]
13671374
}
1375+
stroke={
1376+
{
1377+
"payload": 4279900965,
1378+
"type": 0,
1379+
}
1380+
}
1381+
strokeLinejoin={1}
13681382
strokeWidth={1.5}
13691383
>
13701384
<RNSVGPath
@@ -1379,8 +1393,6 @@ exports[`AttachButton should render a enabled AttachButton 1`] = `
13791393
[
13801394
"stroke",
13811395
"strokeWidth",
1382-
"strokeLinecap",
1383-
"strokeLinejoin",
13841396
]
13851397
}
13861398
stroke={
@@ -1389,8 +1401,6 @@ exports[`AttachButton should render a enabled AttachButton 1`] = `
13891401
"type": 0,
13901402
}
13911403
}
1392-
strokeLinecap={1}
1393-
strokeLinejoin={1}
13941404
strokeWidth={1.5}
13951405
/>
13961406
<RNSVGPath
@@ -1405,8 +1415,6 @@ exports[`AttachButton should render a enabled AttachButton 1`] = `
14051415
[
14061416
"stroke",
14071417
"strokeWidth",
1408-
"strokeLinecap",
1409-
"strokeLinejoin",
14101418
]
14111419
}
14121420
stroke={
@@ -1415,8 +1423,6 @@ exports[`AttachButton should render a enabled AttachButton 1`] = `
14151423
"type": 0,
14161424
}
14171425
}
1418-
strokeLinecap={1}
1419-
strokeLinejoin={1}
14201426
strokeWidth={1.5}
14211427
/>
14221428
</RNSVGGroup>
@@ -2251,6 +2257,8 @@ exports[`AttachButton should render an disabled AttachButton 1`] = `
22512257
meetOrSlice={0}
22522258
minX={0}
22532259
minY={0}
2260+
stroke="#1a1b25"
2261+
strokeLinejoin="round"
22542262
strokeWidth={1.5}
22552263
style={
22562264
[
@@ -2274,9 +2282,18 @@ exports[`AttachButton should render an disabled AttachButton 1`] = `
22742282
propList={
22752283
[
22762284
"fill",
2285+
"stroke",
22772286
"strokeWidth",
2287+
"strokeLinejoin",
22782288
]
22792289
}
2290+
stroke={
2291+
{
2292+
"payload": 4279900965,
2293+
"type": 0,
2294+
}
2295+
}
2296+
strokeLinejoin={1}
22802297
strokeWidth={1.5}
22812298
>
22822299
<RNSVGPath
@@ -2291,8 +2308,6 @@ exports[`AttachButton should render an disabled AttachButton 1`] = `
22912308
[
22922309
"stroke",
22932310
"strokeWidth",
2294-
"strokeLinecap",
2295-
"strokeLinejoin",
22962311
]
22972312
}
22982313
stroke={
@@ -2301,8 +2316,6 @@ exports[`AttachButton should render an disabled AttachButton 1`] = `
23012316
"type": 0,
23022317
}
23032318
}
2304-
strokeLinecap={1}
2305-
strokeLinejoin={1}
23062319
strokeWidth={1.5}
23072320
/>
23082321
<RNSVGPath
@@ -2317,8 +2330,6 @@ exports[`AttachButton should render an disabled AttachButton 1`] = `
23172330
[
23182331
"stroke",
23192332
"strokeWidth",
2320-
"strokeLinecap",
2321-
"strokeLinejoin",
23222333
]
23232334
}
23242335
stroke={
@@ -2327,8 +2338,6 @@ exports[`AttachButton should render an disabled AttachButton 1`] = `
23272338
"type": 0,
23282339
}
23292340
}
2330-
strokeLinecap={1}
2331-
strokeLinejoin={1}
23322341
strokeWidth={1.5}
23332342
/>
23342343
</RNSVGGroup>

package/src/components/MessageInput/__tests__/__snapshots__/SendButton.test.tsx.snap

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,8 @@ exports[`SendButton should render a SendButton 1`] = `
425425
meetOrSlice={0}
426426
minX={0}
427427
minY={0}
428+
stroke="#1a1b25"
429+
strokeLinejoin="round"
428430
strokeWidth={1.5}
429431
style={
430432
[
@@ -448,9 +450,18 @@ exports[`SendButton should render a SendButton 1`] = `
448450
propList={
449451
[
450452
"fill",
453+
"stroke",
451454
"strokeWidth",
455+
"strokeLinejoin",
452456
]
453457
}
458+
stroke={
459+
{
460+
"payload": 4279900965,
461+
"type": 0,
462+
}
463+
}
464+
strokeLinejoin={1}
454465
strokeWidth={1.5}
455466
>
456467
<RNSVGPath
@@ -465,8 +476,6 @@ exports[`SendButton should render a SendButton 1`] = `
465476
[
466477
"stroke",
467478
"strokeWidth",
468-
"strokeLinecap",
469-
"strokeLinejoin",
470479
]
471480
}
472481
stroke={
@@ -475,8 +484,6 @@ exports[`SendButton should render a SendButton 1`] = `
475484
"type": 0,
476485
}
477486
}
478-
strokeLinecap={1}
479-
strokeLinejoin={1}
480487
strokeWidth={1.5}
481488
/>
482489
<RNSVGPath
@@ -491,8 +498,6 @@ exports[`SendButton should render a SendButton 1`] = `
491498
[
492499
"stroke",
493500
"strokeWidth",
494-
"strokeLinecap",
495-
"strokeLinejoin",
496501
]
497502
}
498503
stroke={
@@ -501,8 +506,6 @@ exports[`SendButton should render a SendButton 1`] = `
501506
"type": 0,
502507
}
503508
}
504-
strokeLinecap={1}
505-
strokeLinejoin={1}
506509
strokeWidth={1.5}
507510
/>
508511
</RNSVGGroup>
@@ -1335,6 +1338,8 @@ exports[`SendButton should render a disabled SendButton 1`] = `
13351338
meetOrSlice={0}
13361339
minX={0}
13371340
minY={0}
1341+
stroke="#1a1b25"
1342+
strokeLinejoin="round"
13381343
strokeWidth={1.5}
13391344
style={
13401345
[
@@ -1358,9 +1363,18 @@ exports[`SendButton should render a disabled SendButton 1`] = `
13581363
propList={
13591364
[
13601365
"fill",
1366+
"stroke",
13611367
"strokeWidth",
1368+
"strokeLinejoin",
13621369
]
13631370
}
1371+
stroke={
1372+
{
1373+
"payload": 4279900965,
1374+
"type": 0,
1375+
}
1376+
}
1377+
strokeLinejoin={1}
13641378
strokeWidth={1.5}
13651379
>
13661380
<RNSVGPath
@@ -1375,8 +1389,6 @@ exports[`SendButton should render a disabled SendButton 1`] = `
13751389
[
13761390
"stroke",
13771391
"strokeWidth",
1378-
"strokeLinecap",
1379-
"strokeLinejoin",
13801392
]
13811393
}
13821394
stroke={
@@ -1385,8 +1397,6 @@ exports[`SendButton should render a disabled SendButton 1`] = `
13851397
"type": 0,
13861398
}
13871399
}
1388-
strokeLinecap={1}
1389-
strokeLinejoin={1}
13901400
strokeWidth={1.5}
13911401
/>
13921402
<RNSVGPath
@@ -1401,8 +1411,6 @@ exports[`SendButton should render a disabled SendButton 1`] = `
14011411
[
14021412
"stroke",
14031413
"strokeWidth",
1404-
"strokeLinecap",
1405-
"strokeLinejoin",
14061414
]
14071415
}
14081416
stroke={
@@ -1411,8 +1419,6 @@ exports[`SendButton should render a disabled SendButton 1`] = `
14111419
"type": 0,
14121420
}
14131421
}
1414-
strokeLinecap={1}
1415-
strokeLinejoin={1}
14161422
strokeWidth={1.5}
14171423
/>
14181424
</RNSVGGroup>

0 commit comments

Comments
 (0)