From 8f255379496d01a42ff84fb8e850a55ae01aea48 Mon Sep 17 00:00:00 2001 From: hosead6168 Date: Thu, 9 Dec 2021 17:43:47 -0600 Subject: [PATCH] fix(article): added skeleton to article --- src/Pages/Articles/Articles.jsx | 47 +++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/src/Pages/Articles/Articles.jsx b/src/Pages/Articles/Articles.jsx index d1d7b74b..3290d2b9 100755 --- a/src/Pages/Articles/Articles.jsx +++ b/src/Pages/Articles/Articles.jsx @@ -1,7 +1,6 @@ -import React, { useState, useContext } from 'react'; +import React, { useState, useContext, useEffect } from 'react'; import './Articles.css' -import NavBar from '../../Components/NavBar/NavBar'; import Subscribe from '../../Components/Subscribe/Subscribe' // import { articleData, categoryTags } from './ArticleData'; import ArticleCard from './ArticleCard'; @@ -9,7 +8,6 @@ import ArticleCard from './ArticleCard'; import { GlobalState } from '../../GlobalState'; import Loading from '../../Loading'; import axios from 'axios'; -import Footer from '../../Components/Footer/Footer'; import Pagination from '../../Components/Pagination/pagination'; import { StyledHr } from '../../Layout/Hr/styledHr'; @@ -121,11 +119,51 @@ const Articles = () => { // taggedArticles = filteredArticles.filter(item => item.type.includes("Software Engineer")) // } + // Load this effect on mount + // useEffect(() => { + // setLoading(true); + // const timer = setTimeout(() => { + // setLoading(false); + // }, 5000); + // // Cancel the timer while unmounting + // return () => clearTimeout(timer); + + // // eslint-disable-next-line react-hooks/exhaustive-deps + + // }, []); + if (loading) return
return ( <> + {loading && ( +
+ + + +
+ )} + {!loading && ( + + )} + {/* + +
+ +
+

Unregistered *Demo* Users

+
+ */} + {loading && ( +
+ +
+ )} + {!loading && ( + + )}
-
@@ -213,7 +251,6 @@ const Articles = () => {
-