Migrate from redux to context

This commit is contained in:
MD. Ariful Alam
2021-09-16 00:30:22 +06:00
parent d5c715e16e
commit 8f167cc940
21 changed files with 157 additions and 446 deletions

View File

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