From efc4700dccb9a634790316b606e171a33b61b4f4 Mon Sep 17 00:00:00 2001 From: Mient-jan Stelling Date: Mon, 29 Jan 2018 15:27:41 +0100 Subject: [PATCH] clean up of code, removing console.log's etc. #19 --- example/App.js | 14 ++++++------ src/lib/ImageComponent.js | 45 --------------------------------------- src/lib/renderRules.js | 1 - src/lib/styles.js | 1 - 4 files changed, 6 insertions(+), 55 deletions(-) delete mode 100644 src/lib/ImageComponent.js diff --git a/example/App.js b/example/App.js index cd94f15f..d640729f 100644 --- a/example/App.js +++ b/example/App.js @@ -1,11 +1,8 @@ -import React, { Component } from "react"; -import { StyleSheet, Text, View, ScrollView, Picker } from "react-native"; +import React, {Component} from "react"; +import {Picker, ScrollView, StyleSheet, Text, View} from "react-native"; import Markdown, { - AstRenderer, - styles, - renderRules, - getUniqueID, - PluginContainer + AstRenderer, getUniqueID, PluginContainer, renderRules, + styles } from "./react-native-markdown-renderer"; import markdownItCheckbox from "markdown-it-checkbox"; @@ -55,7 +52,7 @@ export default class App extends Component { { description: "custom style sheet" }, { description: "custom rules" }, { description: "custom rules & styles" }, - { description: "plugins (checkbox)" } + { description: "plugins (checkbox)" }, ]; getView(value) { @@ -93,6 +90,7 @@ export default class App extends Component { /> ); } + default: { return # Text; } diff --git a/src/lib/ImageComponent.js b/src/lib/ImageComponent.js deleted file mode 100644 index 754c8c1d..00000000 --- a/src/lib/ImageComponent.js +++ /dev/null @@ -1,45 +0,0 @@ -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 ( - (this.ref = ref)} - onLoad={this.onLoad} - onLoadStart={this.onLoadStart} - style={{ width: 50, height: 50 }} - source={{ - uri: this.props.uri - }} - /> - ); - } -} diff --git a/src/lib/renderRules.js b/src/lib/renderRules.js index e0d07f14..345fae68 100644 --- a/src/lib/renderRules.js +++ b/src/lib/renderRules.js @@ -51,7 +51,6 @@ const renderRules = { }, // a link: (node, children, parent, styles) => { - console.log(node); return (