diff --git a/src/App.js b/src/App.js index e55aa10..cda4246 100644 --- a/src/App.js +++ b/src/App.js @@ -92,7 +92,7 @@ function App() { }, [dispatch]) useEffect(() => { - // loadData(); + loadData(); }, [loadData]) return ( diff --git a/src/components/Blog.js b/src/components/Blog.js index d22c9d0..48bb882 100644 --- a/src/components/Blog.js +++ b/src/components/Blog.js @@ -2,11 +2,14 @@ import { getDevtoArticle, getMediumArticle } from "article-api"; import moment from "moment"; import { useEffect, useState } from "react"; import { CgHashtag } from 'react-icons/cg'; +import { useSelector } from "react-redux"; import config from "../config"; import { skeleton } from "../helpers/utils"; +import LazyImage from "./LazyImage"; const Blog = () => { const [articles, setArticles] = useState(null); + const loading = useSelector(state => state.loading); useEffect(() => { if ( @@ -34,74 +37,127 @@ const Blog = () => { } }, []) - return ( -
+ {moment(article.publishedAt).fromNow()} +
++ {article.description} +
+{moment(article.publishedAt).fromNow()}
-- {article.description} -
-