Skip to content

Commit c2416a7

Browse files
committed
fix: using borderTopLeft/Right radius coming from the theme
1 parent df3f34b commit c2416a7

File tree

3 files changed

+68
-51
lines changed

3 files changed

+68
-51
lines changed

examples/TypeScriptMessaging/useStreamChatTheme.ts

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -14,49 +14,49 @@ export const useStreamChatTheme = () => {
1414
colors:
1515
colorScheme === 'dark'
1616
? {
17-
accent_blue: '#005FFF',
18-
accent_green: '#20E070',
19-
accent_red: '#FF3742',
20-
bg_gradient_end: '#101214',
21-
bg_gradient_start: '#070A0D',
22-
black: '#FFFFFF',
23-
blue_alice: '#00193D',
24-
border: '#141924',
25-
grey: '#7A7A7A',
26-
grey_gainsboro: '#2D2F2F',
27-
grey_whisper: '#1C1E22',
28-
icon_background: '#FFFFFF',
29-
modal_shadow: '#000000',
30-
overlay: '#FFFFFFCC', // CC = 80% opacity
31-
shadow_icon: '#00000080', // 80 = 50% opacity
32-
targetedMessageBackground: '#302D22',
33-
transparent: 'transparent',
34-
white: '#101418',
35-
white_smoke: '#13151B',
36-
white_snow: '#070A0D',
37-
}
17+
accent_blue: '#005FFF',
18+
accent_green: '#20E070',
19+
accent_red: '#FF3742',
20+
bg_gradient_end: '#101214',
21+
bg_gradient_start: '#070A0D',
22+
black: '#FFFFFF',
23+
blue_alice: '#00193D',
24+
border: '#141924',
25+
grey: '#7A7A7A',
26+
grey_gainsboro: '#2D2F2F',
27+
grey_whisper: '#1C1E22',
28+
icon_background: '#FFFFFF',
29+
modal_shadow: '#000000',
30+
overlay: '#FFFFFFCC', // CC = 80% opacity
31+
shadow_icon: '#00000080', // 80 = 50% opacity
32+
targetedMessageBackground: '#302D22',
33+
transparent: 'transparent',
34+
white: '#101418',
35+
white_smoke: '#13151B',
36+
white_snow: '#070A0D',
37+
}
3838
: {
39-
accent_blue: '#005FFF',
40-
accent_green: '#20E070',
41-
accent_red: '#FF3742',
42-
bg_gradient_end: '#F7F7F7',
43-
bg_gradient_start: '#FCFCFC',
44-
black: '#000000',
45-
blue_alice: '#E9F2FF',
46-
border: '#00000014', // 14 = 8% opacity; top: x=0, y=-1; bottom: x=0, y=1
47-
grey: '#7A7A7A',
48-
grey_gainsboro: '#DBDBDB',
49-
grey_whisper: '#ECEBEB',
50-
icon_background: '#FFFFFF',
51-
modal_shadow: '#00000099', // 99 = 60% opacity; x=0, y= 1, radius=4
52-
overlay: '#00000099', // 99 = 60% opacity
53-
shadow_icon: '#00000040', // 40 = 25% opacity; x=0, y=0, radius=4
54-
targetedMessageBackground: '#FBF4DD', // dark mode = #302D22
55-
transparent: 'transparent',
56-
white: '#FFFFFF',
57-
white_smoke: '#F2F2F2',
58-
white_snow: '#FCFCFC',
59-
},
39+
accent_blue: '#005FFF',
40+
accent_green: '#20E070',
41+
accent_red: '#FF3742',
42+
bg_gradient_end: '#F7F7F7',
43+
bg_gradient_start: '#FCFCFC',
44+
black: '#000000',
45+
blue_alice: '#E9F2FF',
46+
border: '#00000014', // 14 = 8% opacity; top: x=0, y=-1; bottom: x=0, y=1
47+
grey: '#7A7A7A',
48+
grey_gainsboro: '#DBDBDB',
49+
grey_whisper: '#ECEBEB',
50+
icon_background: '#FFFFFF',
51+
modal_shadow: '#00000099', // 99 = 60% opacity; x=0, y= 1, radius=4
52+
overlay: '#00000099', // 99 = 60% opacity
53+
shadow_icon: '#00000040', // 40 = 25% opacity; x=0, y=0, radius=4
54+
targetedMessageBackground: '#FBF4DD', // dark mode = #302D22
55+
transparent: 'transparent',
56+
white: '#FFFFFF',
57+
white_smoke: '#F2F2F2',
58+
white_snow: '#FCFCFC',
59+
},
6060
spinner: {
6161
height: 15,
6262
width: 15,

examples/TypeScriptMessaging/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6861,10 +6861,10 @@ [email protected]:
68616861
resolved "https://registry.yarnpkg.com/stream-buffers/-/stream-buffers-2.2.0.tgz#91d5f5130d1cef96dcfa7f726945188741d09ee4"
68626862
integrity sha1-kdX1Ew0c75bc+n9yaUUYh0HQnuQ=
68636863

6864-
stream-chat-react-native-core@4.3.1:
6865-
version "4.3.1"
6866-
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-4.3.1.tgz#bc53a044c45b60f6bd3feb425e70100d077cc064"
6867-
integrity sha512-2DZO89EyDtXtmc5MhivD1kOOU6aklK/rgZVvo4RZ15419VlpVFqMjswvFAcF41z2ZJujP86cSSKg5YMhNy7uZw==
6864+
stream-chat-react-native-core@4.6.0:
6865+
version "4.6.0"
6866+
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-4.6.0.tgz#444a88017c74e0b0ac0c8f030925320175c61934"
6867+
integrity sha512-065qcp5Bv0t6TFN+UIFZlaoUTh2aXbvwkDLWAJInWYUKuMFmZkYlSfqdw+XBN9tMVlmuxoL06jltVru8HpP/NQ==
68686868
dependencies:
68696869
"@babel/runtime" "^7.12.5"
68706870
"@gorhom/bottom-sheet" "4.1.5"

package/src/components/Message/MessageSimple/MessageContent.tsx

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,16 @@ const MessageContentWithContext = <
143143
colors: { accent_red, blue_alice, grey_gainsboro, grey_whisper, transparent, white },
144144
messageSimple: {
145145
content: {
146-
container: { borderRadius, borderRadiusL, borderRadiusS, ...container },
146+
container: {
147+
borderBottomLeftRadius,
148+
borderBottomRightRadius,
149+
borderRadius,
150+
borderRadiusL,
151+
borderRadiusS,
152+
borderTopLeftRadius,
153+
borderTopRightRadius,
154+
...container
155+
},
147156
containerInner,
148157
errorContainer,
149158
errorIcon,
@@ -313,12 +322,20 @@ const MessageContentWithContext = <
313322
styles.containerInner,
314323
{
315324
backgroundColor,
316-
borderBottomLeftRadius: applyBorderRadius('left_bottom', 'left_single'),
317-
borderBottomRightRadius: applyBorderRadius('right_bottom', 'right_single'),
325+
borderBottomLeftRadius:
326+
borderBottomLeftRadius !== undefined
327+
? borderBottomLeftRadius
328+
: applyBorderRadius('left_bottom', 'left_single'),
329+
borderBottomRightRadius:
330+
borderBottomRightRadius !== undefined
331+
? borderBottomRightRadius
332+
: applyBorderRadius('right_bottom', 'right_single'),
318333
borderColor: isBorderColor ? backgroundColor : grey_whisper,
319334
borderRadius,
320-
borderTopLeftRadius: applyBorderRadius('left_top', 'right_single'),
321-
borderTopRightRadius: applyBorderRadius('right_top', 'right_single'),
335+
borderTopLeftRadius:
336+
borderTopLeftRadius !== undefined ? borderTopLeftRadius : borderRadiusL,
337+
borderTopRightRadius:
338+
borderTopRightRadius !== undefined ? borderTopRightRadius : borderRadiusL,
322339
},
323340
noBorder ? { borderWidth: 0 } : {},
324341
containerInner,

0 commit comments

Comments
 (0)