Skip to content

Commit e24e760

Browse files
Merge pull request #15 from ninjz/master
add default styling for blockQuote
2 parents bdaef78 + a006491 commit e24e760

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

rules.js

+9-4
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,24 @@ export default (styles) => ({
1616
},
1717
blockQuote: {
1818
react: (node, output, state) => {
19+
let block
1920
state.withinText = true
20-
return createElement(Text, {
21-
key: state.key,
22-
style: styles.blockQuote
21+
block = createElement(View, { key: state.key, style: styles. blockQuoteBlock })
22+
23+
const blockText = createElement(Text, {
24+
key: state.key + 1,
25+
style: styles.blockQuoteText
2326
}, output(node.content, state))
27+
28+
return createElement(View, { key: state.key, style: styles.blockQuote }, [block, blockText])
2429
}
2530
},
2631
br: {
2732
react: (node, output, state) => {
2833
return createElement(Text, {
2934
key: state.key,
3035
style: styles.br
31-
}, '\n\n')
36+
}, '\n')
3237
}
3338
},
3439
codeBlock: {

styles.js

+12-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
const styles = {
44
view: {},
5+
blockQuote: {
6+
flexDirection: 'row'
7+
},
8+
blockQuoteBlock: {
9+
width: 3,
10+
height: null,
11+
backgroundColor: '#DDDDDD',
12+
marginRight: 15,
13+
},
14+
blockQuoteText: {
15+
flex: 1,
16+
},
517
codeBlock: {
618
fontFamily: 'Courier',
719
fontWeight: '500',
@@ -59,7 +71,6 @@ const styles = {
5971
listItemBullet: {
6072
fontSize: 20,
6173
lineHeight: 20,
62-
marginTop: 6,
6374
},
6475
listItemNumber: {
6576
fontWeight: 'bold',

0 commit comments

Comments
 (0)