diff --git a/app/package.json b/app/package.json
index 4eca751..da861d1 100755
--- a/app/package.json
+++ b/app/package.json
@@ -8,6 +8,7 @@
"react-scripts": "4.0.3"
},
"scripts": {
+ "lint": "standard",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
diff --git a/app/src/app/children/image/helpers.js b/app/src/app/children/CaptionImage/helpers.js
similarity index 100%
rename from app/src/app/children/image/helpers.js
rename to app/src/app/children/CaptionImage/helpers.js
diff --git a/app/src/app/children/image/index.js b/app/src/app/children/CaptionImage/index.js
similarity index 59%
rename from app/src/app/children/image/index.js
rename to app/src/app/children/CaptionImage/index.js
index cfeae9f..984c018 100755
--- a/app/src/app/children/image/index.js
+++ b/app/src/app/children/CaptionImage/index.js
@@ -1,9 +1,9 @@
import React from 'react'
import styles from './styles'
-import {getCaptionFromEdges} from './helpers'
+import { getCaptionFromEdges } from './helpers'
-const Image = (props) => {
- const {data} = props
+const CaptionImage = (props) => {
+ const { data } = props
return (
{
)
}
-export default Image
+export default CaptionImage
diff --git a/app/src/app/children/image/styles.js b/app/src/app/children/CaptionImage/styles.js
similarity index 100%
rename from app/src/app/children/image/styles.js
rename to app/src/app/children/CaptionImage/styles.js
diff --git a/app/src/app/children/CommentSection/children/CommentList/children/Comment/helpers.js b/app/src/app/children/CommentSection/children/CommentList/children/Comment/helpers.js
new file mode 100644
index 0000000..336e722
--- /dev/null
+++ b/app/src/app/children/CommentSection/children/CommentList/children/Comment/helpers.js
@@ -0,0 +1,19 @@
+const processText = (text, name) => {
+ const hashtagRegex = /#(\w+)/g
+ const usernameRegex = /@(\w+)/g
+
+ const textWithHashtags = text.replace(
+ hashtagRegex,
+ '#$1'
+ )
+
+ const textWithLinks = textWithHashtags.replace(
+ usernameRegex,
+ '@$1'
+ )
+ const finalHTML = `${name} ${textWithLinks}`
+ // Okay to use here since we know the HTML source
+ return
{data.edge_media_preview_like.count} likes
+{timeSincePost(data.taken_at_timestamp)}
+{data.owner.username}
+{data.location.name}
+