-
Notifications
You must be signed in to change notification settings - Fork 417
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
trying to add ability to add block elements to a header. Related to i…
…ssue #14
- Loading branch information
Showing
9 changed files
with
220 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,34 @@ | ||
import { StyleSheet } from 'react-native'; | ||
import { StyleSheet } from "react-native"; | ||
|
||
/** | ||
* | ||
*/ | ||
const customMarkdownStyle = StyleSheet.create({ | ||
view: {}, | ||
codeBlock: { | ||
fontFamily: 'Courier', | ||
fontWeight: '500', | ||
}, | ||
del: { | ||
backgroundColor: '#000000', | ||
}, | ||
em: { | ||
fontStyle: 'italic', | ||
}, | ||
heading: {}, | ||
heading1: { | ||
view: {}, | ||
codeBlock: { | ||
fontFamily: "Courier", | ||
fontWeight: "500" | ||
}, | ||
del: { | ||
backgroundColor: "#000000" | ||
}, | ||
em: { | ||
fontStyle: "italic" | ||
}, | ||
|
||
backgroundColor: "#FFCC00" | ||
}, | ||
text: {fontSize: 20,}, | ||
strikethrough: { | ||
textDecorationLine: 'line-through', | ||
color: '#FF0000' | ||
}, | ||
a: { | ||
textDecorationLine: 'underline', | ||
color: '#FF0000' | ||
}, | ||
u: { | ||
borderColor: '#000000', | ||
borderBottomWidth: 1, | ||
}, | ||
text: { fontSize: 20 }, | ||
strikethrough: { | ||
textDecorationLine: "line-through", | ||
color: "#FF0000" | ||
}, | ||
a: { | ||
textDecorationLine: "underline", | ||
color: "#FF0000" | ||
}, | ||
u: { | ||
borderColor: "#000000", | ||
borderBottomWidth: 1 | ||
} | ||
}); | ||
|
||
export default customMarkdownStyle; | ||
export default customMarkdownStyle; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,33 @@ | ||
import React from "react" | ||
import { StyleSheet, Text, View, ScrollView, Picker } from 'react-native'; | ||
import React from "react"; | ||
import { StyleSheet, Text, View, ScrollView, Picker } from "react-native"; | ||
|
||
const rules = { | ||
checkbox: (node, children, parents, style) => { | ||
return <View style={{flexDirection: 'row', borderWidth: 1, borderColor: '#000000'}} key={node.key}> | ||
{children} | ||
</View>; | ||
}, | ||
checkbox_input: (node, children, parents, style) => { | ||
return <View key={node.key} style={{borderRadius: 20, backgroundColor: 'blue', width: 20, height: 20, marginRight:10}}></View>; | ||
}, | ||
label: (node, children, parents, style) => { | ||
return <Text key={node.key}>{children}</Text>; | ||
}, | ||
|
||
checkbox: (node, children, parents, style) => { | ||
return ( | ||
<View | ||
style={{ flexDirection: "row", borderWidth: 1, borderColor: "#000000" }} | ||
key={node.key} | ||
> | ||
{children} | ||
</View> | ||
); | ||
}, | ||
checkbox_input: (node, children, parents, style) => { | ||
return ( | ||
<View | ||
key={node.key} | ||
style={{ | ||
borderRadius: 20, | ||
backgroundColor: "blue", | ||
width: 20, | ||
height: 20, | ||
marginRight: 10 | ||
}} | ||
/> | ||
); | ||
}, | ||
label: (node, children, parents, style) => { | ||
return <Text key={node.key}>{children}</Text>; | ||
} | ||
}; | ||
export default rules; | ||
export default rules; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import React, { PureComponent } from "react"; | ||
import { Image } from "react-native"; | ||
import PropTypes from "prop-types"; | ||
import MarkdownIt from "markdown-it"; | ||
import PluginContainer from "./plugin/PluginContainer"; | ||
import AstRenderer from "./AstRenderer"; | ||
|
||
export default class ImageComponent extends PureComponent { | ||
static propTypes = { | ||
scaling: PropTypes.oneOf(["strict"]).isRequired, | ||
uri: PropTypes.string.isRequired | ||
}; | ||
|
||
/** | ||
* Default Props | ||
*/ | ||
static defaultProps = {}; | ||
|
||
ref = null; | ||
|
||
constructor(props) { | ||
super(props); | ||
|
||
this.state = {}; | ||
} | ||
|
||
onLoad = () => { | ||
console.log(this.ref); | ||
}; | ||
onLoadStart = () => {}; | ||
|
||
render() { | ||
return ( | ||
<Image | ||
ref={ref => (this.ref = ref)} | ||
onLoad={this.onLoad} | ||
onLoadStart={this.onLoadStart} | ||
style={{ width: 50, height: 50 }} | ||
source={{ | ||
uri: this.props.uri | ||
}} | ||
/> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.