diff --git a/src/component/Blog/Blog/Main.js b/src/component/Blog/Blog/Main.js index ba78687..2a7122e 100644 --- a/src/component/Blog/Blog/Main.js +++ b/src/component/Blog/Blog/Main.js @@ -1,75 +1,45 @@ -/** @format */ - import React, { useEffect, useState } from "react"; import { Link } from "react-router-dom"; import BGImg from "../../../assets/images/bread_crumb_bg.png"; import SiteService from "../../../vendors/service/siteService"; - const Main = ({ brdcum, bgimg }) => { const [blogData, setBlogData] = useState([]); + console.log(blogData); - let api = new SiteService(); + const api = new SiteService(); useEffect(() => { getBlogData(); }, []); const getBlogData = async () => { - /* - The reason for this, is because of the breaking I had when building the blog - I decided to save to the local storage for an hour so that it won't need to be going to the server again but I can change this - */ - // Saving it locally to avoid interfering with server - if (localStorage.getItem("myFit--blogData") == null) { - try { - let res = await api.blogData(); + try { + const res = await api.blogData(); - // Set the blog data to local storage - localStorage.setItem("myFit--blogData", JSON.stringify(res.data)); - setBlogData(res.data); - // Set a time out for the blog data to be deleted from local storage - setTimeout(() => { - localStorage.removeItem("myFit--blogData"); - }, 3600); - } catch (error) { - console.log("Error from blog data ", error); - } - } else { - try { - let data = JSON.parse(localStorage.getItem("myFit--blogData")); - setBlogData(data); - } catch (error) { - console.error("Error parsing JSON data: ", error); - } + setBlogData(res.data); + + // console.log(res.data); + + + } catch (error) { + console.log("Error from blog data ", error); } }; - return ( <> -
{" "}
+
{" "}
{" "}
-
{" "}
+
{" "}
{" "}
-
{" "}
+
{" "}
Lorem Ipsum is simply dummy text of the printing and typesetting in dustry lorem Ipsum has been the industrys standard dummy text ev er since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic Lorem Ipsum is simply dummy text of the printing and typesettingindustry lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived.
+Printing and typesetting in dustry lorem Ipsum has been the industrys standard dummy text ev er since the 1500s, when an unnown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic Lorem Ipsum is simply dummy text of the printing and typesettingindustry lorem Ipsum has been the industrys centuries, but also the leap into electronic.
+Lorem Ipsum is simply dummy text of the printing and typesetting in dustry lorem Ipsum has been the industrys standard dummy text ev er since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic.
+Lorem Ipsum is simply dummy text of the printing and typesetting in
Dustry lorem Ipsum has been the industrys standard dummy text ev er since the when
Unknown printer took a galley of type and scrambled it to make.
Type specimen book. It has survived not only five centuries, but also the leap into electronic.
Lorem Ipsum is simply dummy text of the printing.
Dustry lorem Ipsum has been the industrys standard dummy text ev er since.
Unknown printer took a galley of type and scrambled it to make.
Type specimen book. It has survived not only.
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting in dustry lorem Ipsum has been the industrys standard dummy text ev er since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic Lorem Ipsum is simply dummy text of the printing and typesettingindustry lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived.
+Mr. John Doe, Apper Inc
+Lorem Ipsum is simply dummy text of the printing and typesetting in dustry lorem Ipsum has been the industrys standard dummy text ev er since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic industry.
*/} +
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting in dustry lorem Ipsum has been the in + dustrys standard dummy text ev er since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen.
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting in dustry lorem Ipsum has been the industrys standard dummy text ev er since the when.
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting in dustry lorem Ipsum has been the in + dustrys standard dummy text ev er since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen.
+Your email address will not be published. Required fields are marked *
Lorem Ipsum is simply dummy text of the printing and typese tting
indus orem Ipsum has beenthe standard dummy.
+ 45 min ago
+ Simply dummy text of the printing and typesetting industry lorem Ipsum has Lorem Ipsum is.
+ READ MORE +
+ 45 min ago
+ Printing and typesetting industry lorem Ipsum has Lorem simply dummy text of the.
+ READ MORE +