diff --git a/components/Article.js b/components/Article.js
index 4d9f70a..3cd6c36 100644
--- a/components/Article.js
+++ b/components/Article.js
@@ -1,9 +1,8 @@
/**
* Article Component
- * https://github.com/facebook/react-native
- * @flow
*/
+//React components
import React, { Component } from 'react';
import {
View,
@@ -13,46 +12,40 @@ import {
Text,
} from 'react-native';
+//utils
import colors from '../utils/colors';
import Dimensions from 'Dimensions';
+const width = Dimensions.get('window').width;
-const height = Dimensions.get('window').height;
-const width = Dimensions.get('window').width;
-
-const Article = ({
- articleData
-}) => {
+/**
+* Article component class
+*/
+export default Article = ({ articleData }) => {
return (
-
- { articleData.sectionName }
-
-
- { articleData.headline }
-
-
- { articleData.trailText }
-
+ { articleData.sectionName }
+
+ { articleData.headline }
+
+ { articleData.trailText }
+
{ articleData.byline + '\n\n'}
-
- { articleData.date }
-
+
+ { articleData.date }
+
-
- { articleData.body}
-
+
+ { articleData.body }
);
};
-export default Article;
-
const styles = StyleSheet.create({
container: {
backgroundColor: colors.white,
diff --git a/components/ListArticle.js b/components/ListArticle.js
index dbf63dd..880f7ca 100644
--- a/components/ListArticle.js
+++ b/components/ListArticle.js
@@ -1,23 +1,21 @@
/**
- * Sample React Native App
- * https://github.com/facebook/react-native
- * @flow
+ * List Article Component
*/
-
- import React, { Component } from 'react';
- import {
+//React components
+import React, { Component } from 'react';
+import {
StyleSheet,
Text,
TouchableOpacity,
Image,
View
- } from 'react-native';
+} from 'react-native';
+//utis and assets
import colors from '../utils/colors';
-
const placeholder = require('../assets/default.png');
-const ListArticle = ({ text, image, navState, navigator }) => {
+export default ListArticle = ({ text, image, navState, navigator }) => {
return (
{
- { text }
+ { text }
);
};
-export default ListArticle;
-
const styles = StyleSheet.create({
mediaObject: {
flex: 1,
diff --git a/utils/articleParser.js b/utils/articleParser.js
index 1222cee..477defb 100644
--- a/utils/articleParser.js
+++ b/utils/articleParser.js
@@ -7,6 +7,8 @@ export default function parseArticleHTMLText(body){
parsedBody = parsedBody.replace(/