Skip to content

Commit d269f61

Browse files
committed
fix: giphy bg
1 parent 4bca63a commit d269f61

2 files changed

Lines changed: 10 additions & 12 deletions

File tree

package/src/components/Attachment/Giphy/Giphy.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,10 @@ const useStyles = ({
220220
return StyleSheet.create({
221221
container: {
222222
backgroundColor: hasActions
223-
? isMyMessage
224-
? semantics.chatBgAttachmentOutgoing
225-
: semantics.chatBgAttachmentIncoming
223+
? semantics.chatBgOutgoing
226224
: isMyMessage
227-
? semantics.chatBgOutgoing
228-
: semantics.chatBgIncoming,
225+
? semantics.chatBgAttachmentOutgoing
226+
: semantics.chatBgAttachmentIncoming,
229227
borderRadius: primitives.radiusLg,
230228
maxWidth: 256, // TODO: Not sure how to fix this
231229
overflow: 'hidden',

package/src/components/Attachment/__tests__/Giphy.test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,37 +117,37 @@ describe('Giphy', () => {
117117
});
118118
});
119119

120-
it('uses the default outgoing bubble background for outgoing giphys', async () => {
120+
it('uses the outgoing attachment background for outgoing giphys', async () => {
121121
render(getAttachmentComponent({ attachment }, { isMyMessage: true }));
122122

123123
await waitFor(() => {
124124
const style = screen.getByTestId('giphy-attachment').props.style;
125125
expect(style).toEqual(
126126
expect.arrayContaining([
127127
expect.objectContaining({
128-
backgroundColor: lightTheme.semantics.chatBgOutgoing,
128+
backgroundColor: lightTheme.semantics.chatBgAttachmentOutgoing,
129129
}),
130130
]),
131131
);
132132
});
133133
});
134134

135-
it('uses the default incoming bubble background for incoming giphys', async () => {
135+
it('uses the incoming attachment background for incoming giphys', async () => {
136136
render(getAttachmentComponent({ attachment }, { isMyMessage: false }));
137137

138138
await waitFor(() => {
139139
const style = screen.getByTestId('giphy-attachment').props.style;
140140
expect(style).toEqual(
141141
expect.arrayContaining([
142142
expect.objectContaining({
143-
backgroundColor: lightTheme.semantics.chatBgIncoming,
143+
backgroundColor: lightTheme.semantics.chatBgAttachmentIncoming,
144144
}),
145145
]),
146146
);
147147
});
148148
});
149149

150-
it('uses the outgoing attachment background for ephemeral giphy previews', async () => {
150+
it('uses the outgoing bubble background for ephemeral giphy previews', async () => {
151151
render(
152152
getAttachmentComponent(
153153
{
@@ -156,7 +156,7 @@ describe('Giphy', () => {
156156
actions,
157157
},
158158
},
159-
{ isMyMessage: true },
159+
{ isMyMessage: false },
160160
),
161161
);
162162

@@ -165,7 +165,7 @@ describe('Giphy', () => {
165165
expect(style).toEqual(
166166
expect.arrayContaining([
167167
expect.objectContaining({
168-
backgroundColor: lightTheme.semantics.chatBgAttachmentOutgoing,
168+
backgroundColor: lightTheme.semantics.chatBgOutgoing,
169169
}),
170170
]),
171171
);

0 commit comments

Comments
 (0)