Skip to content

Commit f6ee974

Browse files
feat: allow theming the container for pinned messages (#1867)
* feat: allow theming the container for pinned messages * Update package/src/components/Message/Message.tsx Co-authored-by: Santhosh Vaiyapuri <[email protected]> Co-authored-by: Santhosh Vaiyapuri <[email protected]>
1 parent a2c0357 commit f6ee974

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

package/src/components/Message/Message.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ const MessageWithContext = <
282282
const {
283283
theme: {
284284
colors: { bg_gradient_start, targetedMessageBackground },
285-
messageSimple: { targetedMessageUnderlay },
285+
messageSimple: { targetedMessageContainer, targetedMessageUnderlay },
286286
},
287287
} = useTheme();
288288

@@ -698,7 +698,12 @@ const MessageWithContext = <
698698

699699
return (
700700
<View
701-
style={[message.pinned && { backgroundColor: targetedMessageBackground }]}
701+
style={[
702+
message.pinned && {
703+
...targetedMessageContainer,
704+
backgroundColor: targetedMessageBackground,
705+
},
706+
]}
702707
testID='message-wrapper'
703708
>
704709
<View

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,7 @@ export type Theme = {
501501
statusContainer: ViewStyle;
502502
timeIcon: IconProps;
503503
};
504+
targetedMessageContainer: ViewStyle;
504505
targetedMessageUnderlay: ViewStyle;
505506
videoThumbnail: {
506507
container: ViewStyle;
@@ -1042,6 +1043,7 @@ export const defaultTheme: Theme = {
10421043
width: DEFAULT_STATUS_ICON_SIZE,
10431044
},
10441045
},
1046+
targetedMessageContainer: {},
10451047
targetedMessageUnderlay: {},
10461048
videoThumbnail: {
10471049
container: {},

0 commit comments

Comments
 (0)