Skip to content

Commit 3df4d7a

Browse files
committed
fix: colors in md rendering
1 parent 27b9b78 commit 3df4d7a

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

examples/SampleApp/src/hooks/useStreamChatTheme.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const getChatStyle = (colorScheme: ColorSchemeName): DeepPartial<Theme> => ({
1717
border: '#141924',
1818
button_background: '#FFFFFF',
1919
button_text: '#005FFF',
20+
code_block: '#222222',
2021
grey: '#7A7A7A',
2122
grey_gainsboro: '#2D2F2F',
2223
grey_whisper: '#1C1E22',

package/src/components/Message/MessageSimple/utils/renderText.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ const ReactiveScrollView = ({ children }: { children: ReactNode }) => {
8888

8989
const defaultMarkdownStyles: MarkdownStyle = {
9090
codeBlock: {
91-
backgroundColor: '#DDDDDD',
9291
fontFamily: Platform.OS === 'ios' ? 'Courier' : 'Monospace',
9392
fontWeight: '500',
9493
marginVertical: 8,
@@ -127,14 +126,12 @@ const defaultMarkdownStyles: MarkdownStyle = {
127126
marginTop: 8,
128127
},
129128
table: {
130-
borderColor: '#222222',
131129
borderRadius: 3,
132130
borderWidth: 1,
133131
flex: 1,
134132
flexDirection: 'row',
135133
},
136134
tableHeader: {
137-
backgroundColor: '#7A7A7A',
138135
flexDirection: 'row',
139136
justifyContent: 'space-around',
140137
},
@@ -143,7 +140,6 @@ const defaultMarkdownStyles: MarkdownStyle = {
143140
},
144141
tableRow: {
145142
alignItems: 'center',
146-
borderColor: '#222222',
147143
justifyContent: 'space-around',
148144
},
149145
tableRowCell: {
@@ -204,6 +200,8 @@ export const renderText = <
204200
},
205201
codeBlock: {
206202
...defaultMarkdownStyles.codeBlock,
203+
backgroundColor: colors.code_block,
204+
color: colors.black,
207205
padding: 8,
208206
...markdownStyles?.codeBlock,
209207
},
@@ -221,11 +219,13 @@ export const renderText = <
221219
},
222220
table: {
223221
...defaultMarkdownStyles.table,
222+
borderColor: colors.grey_dark,
224223
marginVertical: 8,
225224
...markdownStyles?.table,
226225
},
227226
tableHeader: {
228227
...defaultMarkdownStyles.tableHeader,
228+
backgroundColor: colors.grey,
229229
...markdownStyles?.tableHeader,
230230
},
231231
tableHeaderCell: {
@@ -239,6 +239,7 @@ export const renderText = <
239239
},
240240
tableRowCell: {
241241
...defaultMarkdownStyles.tableRowCell,
242+
borderColor: colors.grey_dark,
242243
padding: 5,
243244
...markdownStyles?.tableRowCell,
244245
},

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export const Colors = {
1919
black: '#000000',
2020
blue_alice: '#E9F2FF',
2121
border: '#00000014', // 14 = 8% opacity; top: x=0, y=-1; bottom: x=0, y=1
22+
code_block: '#DDDDDD',
2223
disabled: '#B4BBBA',
2324
grey: '#7A7A7A',
2425
grey_dark: '#72767E',

0 commit comments

Comments
 (0)