Remove context for state management

This commit is contained in:
Ariful Alam
2022-03-19 16:34:13 +06:00
parent b69ced8ce0
commit ab55fa68f1
13 changed files with 61 additions and 140 deletions

View File

@@ -1,8 +1,7 @@
import { getDevtoArticle, getMediumArticle } from 'article-api';
import moment from 'moment';
import { Fragment, useContext, useEffect, useState } from 'react';
import { Fragment, useEffect, useState } from 'react';
import { CgHashtag } from 'react-icons/cg';
import { LoadingContext } from '../../contexts/LoadingContext';
import config from '../../ezprofile.config';
import { ga, skeleton } from '../../helpers/utils';
import LazyImage from '../lazy-image';
@@ -21,9 +20,8 @@ const displaySection = () => {
}
};
const Blog = () => {
const Blog = ({loading}) => {
const [articles, setArticles] = useState(null);
const { loading } = useContext(LoadingContext);
useEffect(() => {
if (displaySection()) {