File tree 5 files changed +22
-9
lines changed
5 files changed +22
-9
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ import React, {
7
7
import { FlatList , useColorScheme } from "react-native" ;
8
8
import type { MarkdownProps } from "./types" ;
9
9
import useMarkdown from "../hooks/useMarkdown" ;
10
- import colors from "../theme/colors" ;
11
10
12
11
const Markdown = ( {
13
12
value,
@@ -45,10 +44,7 @@ const Markdown = ({
45
44
maxToRenderPerBatch = { 8 }
46
45
initialNumToRender = { 8 }
47
46
style = { {
48
- backgroundColor :
49
- colorScheme === "light"
50
- ? colors . light . background
51
- : colors . dark . background ,
47
+ backgroundColor : colorScheme === "light" ? "#ffffff" : "#000000" ,
52
48
} }
53
49
{ ...flatListProps }
54
50
data = { rnElements }
Original file line number Diff line number Diff line change @@ -2412,6 +2412,7 @@ exports[`Headings Alternate Syntax: Heading level 1 1`] = `
2412
2412
{
2413
2413
" borderBottomColor" : " #d0d7de" ,
2414
2414
" borderBottomWidth" : 1 ,
2415
+ " color" : " #333333" ,
2415
2416
" fontSize" : 32 ,
2416
2417
" fontWeight" : " bold" ,
2417
2418
" letterSpacing" : 0 ,
@@ -2460,6 +2461,7 @@ exports[`Headings Alternate Syntax: Heading level 1 1`] = `
2460
2461
{
2461
2462
" borderBottomColor" : " #d0d7de" ,
2462
2463
" borderBottomWidth" : 1 ,
2464
+ " color" : " #333333" ,
2463
2465
" fontSize" : 32 ,
2464
2466
" fontWeight" : " bold" ,
2465
2467
" letterSpacing" : 0 ,
@@ -2588,6 +2590,7 @@ exports[`Headings Best Practice 1`] = `
2588
2590
{
2589
2591
" borderBottomColor" : " #d0d7de" ,
2590
2592
" borderBottomWidth" : 1 ,
2593
+ " color" : " #333333" ,
2591
2594
" fontSize" : 32 ,
2592
2595
" fontWeight" : " bold" ,
2593
2596
" letterSpacing" : 0 ,
@@ -2698,6 +2701,7 @@ exports[`Headings Best Practice 1`] = `
2698
2701
{
2699
2702
" borderBottomColor" : " #d0d7de" ,
2700
2703
" borderBottomWidth" : 1 ,
2704
+ " color" : " #333333" ,
2701
2705
" fontSize" : 32 ,
2702
2706
" fontWeight" : " bold" ,
2703
2707
" letterSpacing" : 0 ,
@@ -2758,6 +2762,7 @@ exports[`Headings Heading level 1 1`] = `
2758
2762
{
2759
2763
" borderBottomColor" : " #d0d7de" ,
2760
2764
" borderBottomWidth" : 1 ,
2765
+ " color" : " #333333" ,
2761
2766
" fontSize" : 32 ,
2762
2767
" fontWeight" : " bold" ,
2763
2768
" letterSpacing" : 0 ,
@@ -2806,6 +2811,7 @@ exports[`Headings Heading level 1 1`] = `
2806
2811
{
2807
2812
" borderBottomColor" : " #d0d7de" ,
2808
2813
" borderBottomWidth" : 1 ,
2814
+ " color" : " #333333" ,
2809
2815
" fontSize" : 32 ,
2810
2816
" fontWeight" : " bold" ,
2811
2817
" letterSpacing" : 0 ,
Original file line number Diff line number Diff line change 1
- export type ColorKeysType = "background" | "code" | "link" | "text" | "border" ;
2
- export type ColorsPropType = Record < ColorKeysType , string > ;
1
+ import type { ColorValue } from "react-native" ;
2
+
3
+ export interface ColorsPropType {
4
+ code : ColorValue ;
5
+ link : ColorValue ;
6
+ text : ColorValue ;
7
+ border : ColorValue ;
8
+ /**
9
+ * @deprecated Use flatlist containerStyle or style prop for setting background color
10
+ */
11
+ background ?: ColorValue ;
12
+ }
3
13
4
14
const colors : Record < "light" | "dark" , ColorsPropType > = {
5
15
light : {
Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ const getStyles = (
75
75
userStyles ?. blockquote ,
76
76
] ) ,
77
77
h1 : StyleSheet . flatten ( [
78
+ fontStyle . heading ,
78
79
{
79
80
fontSize : 32 ,
80
81
lineHeight : 40 ,
Original file line number Diff line number Diff line change 1
1
import type { ImageStyle , TextStyle , ViewStyle } from "react-native" ;
2
- import type { ColorKeysType } from "./colors" ;
2
+ import type { ColorsPropType } from "./colors" ;
3
3
import type { SpacingKeysType } from "./spacing" ;
4
4
5
5
export interface MarkedStyles {
@@ -28,6 +28,6 @@ export interface MarkedStyles {
28
28
}
29
29
30
30
export interface UserTheme {
31
- colors ?: Record < ColorKeysType , string > ;
31
+ colors ?: ColorsPropType ;
32
32
spacing ?: Record < SpacingKeysType , number > ;
33
33
}
You can’t perform that action at this time.
0 commit comments