Skip to content

Commit 74a3d04

Browse files
authored
fix: add property to customize the wrapper style of message (#3052)
* fix: add property to customize the wrapper style of message * fix: add property to customize the wrapper style of message * tests: update snapshot
1 parent 3e49044 commit 74a3d04

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

package/src/components/Message/Message.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ const MessageWithContext = <
296296
const {
297297
theme: {
298298
colors: { targetedMessageBackground },
299-
messageSimple: { targetedMessageContainer, unreadUnderlayColor },
299+
messageSimple: { targetedMessageContainer, unreadUnderlayColor, wrapper },
300300
screenPadding,
301301
},
302302
} = useTheme();
@@ -737,8 +737,12 @@ const MessageWithContext = <
737737
<View
738738
style={[
739739
{ marginTop: 2, paddingHorizontal: screenPadding },
740+
wrapper,
740741
(isTargetedMessage || message.pinned) && !isMessageTypeDeleted
741-
? { backgroundColor: targetedMessageBackground, ...targetedMessageContainer }
742+
? {
743+
backgroundColor: targetedMessageBackground,
744+
...targetedMessageContainer,
745+
}
742746
: {},
743747
]}
744748
testID='message-wrapper'

package/src/components/Thread/__tests__/__snapshots__/Thread.test.js.snap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ exports[`Thread should match thread snapshot 1`] = `
276276
"paddingHorizontal": 8,
277277
},
278278
{},
279+
{},
279280
]
280281
}
281282
testID="message-wrapper"
@@ -787,6 +788,7 @@ exports[`Thread should match thread snapshot 1`] = `
787788
"paddingHorizontal": 8,
788789
},
789790
{},
791+
{},
790792
]
791793
}
792794
testID="message-wrapper"
@@ -1336,6 +1338,7 @@ exports[`Thread should match thread snapshot 1`] = `
13361338
"paddingHorizontal": 8,
13371339
},
13381340
{},
1341+
{},
13391342
]
13401343
}
13411344
testID="message-wrapper"
@@ -1837,6 +1840,7 @@ exports[`Thread should match thread snapshot 1`] = `
18371840
"paddingHorizontal": 8,
18381841
},
18391842
{},
1843+
{},
18401844
]
18411845
}
18421846
testID="message-wrapper"

package/src/contexts/themeContext/utils/theme.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,7 @@ export type Theme = {
674674
roundedView: ViewStyle;
675675
};
676676
unreadUnderlayColor?: ColorValue;
677+
wrapper: ViewStyle;
677678
};
678679
poll: {
679680
allOptions: {
@@ -1466,6 +1467,7 @@ export const defaultTheme: Theme = {
14661467
container: {},
14671468
roundedView: {},
14681469
},
1470+
wrapper: {},
14691471
},
14701472
poll: {
14711473
allOptions: {

0 commit comments

Comments
 (0)