From 05f30c224ccda5c39ed8d141c4614cd7894417fc Mon Sep 17 00:00:00 2001 From: "DESKTOP-QHP1O2H\\MIKE" Date: Sat, 14 Jan 2023 13:52:40 -0800 Subject: [PATCH] Routed the blog data to th single blog page --- src/component/Blog/Blog/Main.js | 3 +- src/component/Blog/BlogSingle/Index.js | 7 + src/component/Blog/BlogSingle/Main copy.js | 513 ++++++++++++++ src/component/Blog/BlogSingle/Main.js | 733 +++++++-------------- src/routes/index.js | 1 - src/vendors/service/siteService.js | 5 +- 6 files changed, 773 insertions(+), 489 deletions(-) create mode 100644 src/component/Blog/BlogSingle/Index.js create mode 100644 src/component/Blog/BlogSingle/Main copy.js diff --git a/src/component/Blog/Blog/Main.js b/src/component/Blog/Blog/Main.js index ee37bb5..44f4340 100644 --- a/src/component/Blog/Blog/Main.js +++ b/src/component/Blog/Blog/Main.js @@ -19,6 +19,7 @@ const Main = ({ brdcum, bgimg }) => { setBlogData(res.data); console.log("data", res.data); console.log("Blog details ", res); + console.log('main blog') } catch (error) { console.log("Error from blog data ", error); } @@ -114,7 +115,7 @@ const Main = ({ brdcum, bgimg }) => {

{data.post_title}

- + READ MORE
diff --git a/src/component/Blog/BlogSingle/Index.js b/src/component/Blog/BlogSingle/Index.js new file mode 100644 index 0000000..0b514c5 --- /dev/null +++ b/src/component/Blog/BlogSingle/Index.js @@ -0,0 +1,7 @@ +const Main = ({ brdcum }) => { +console.log('something else'); + + +}; + +export default Main; diff --git a/src/component/Blog/BlogSingle/Main copy.js b/src/component/Blog/BlogSingle/Main copy.js new file mode 100644 index 0000000..76ca801 --- /dev/null +++ b/src/component/Blog/BlogSingle/Main copy.js @@ -0,0 +1,513 @@ +import React, { useEffect, useState } from "react"; +import { Link } from "react-router-dom"; +import Bredcrumb from "../../Bredcrumb/Main"; +import BGImg from "../../../assets/images/bread_crumb_bg.png"; +import BGImg1 from "../../../assets/images/bread_crumb_bg_one.png"; +import BGImg2 from "../../../assets/images/bread_crumb_bg_two.png"; +import SiteService from "../../../vendors/service/siteService"; +import { useParams } from "react-router-dom"; + +const Main = ({ brdcum }) => { + const [blogData, setBlogData] = useState([]); + const { id } = useParams(); + + const api = new SiteService(); + useEffect(() => { + getBlogData(); + }, []); + + const getBlogData = async () => { + try { + const res = await api.blogData(id); + setBlogData(res.data); + console.log("data", res.data); + console.log("Blog details ", res); + } catch (error) { + console.log("Error from blog data ", error); + } + }; + + return ( + <> + {brdcum.b1 && ( + + )} + + {brdcum.b2 && ( + + )} + + {brdcum.b5 && ( + + )} + + {brdcum.b3 && } + + {brdcum.b4 && ( + + )} + +
+
+
+
+ Review + 45 min ago +
+
+

Top rated app of the year!

+
+
+ image +
+
+

+ 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. +

+

Why we are best

+

+ 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. +

    +
  • +
+
+
+
+
+ image +
+
+ image +
+
+
+
+

Why we are best

+

+ 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. +

+
+
+ + image + +

+ Lorem Ipsum is simply dummy text of the printing and typesetting + in dustry lorem Ipsum has been the industrys standard dummy. +

+

+ 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. +

+
+
+
+ image +
+
+

By: John Dow

+ July 25, 2022 +
+
+
+
    +
  • + + + +
  • +
  • + + + +
  • +
  • + + + +
  • +
  • + + + +
  • +
+
+
+
+
    +
  • +

    Tags:

    +
  • +
  • + app, +
  • +
  • + rating, +
  • +
  • + development +
  • +
+
+
+
+
+
+
+
+

3 Comments

+
+
    +
  • +
    +
    + image +
    +
    + 30 min ago +

    Dolly Shell

    +
    +
    +
    +

    + 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.{" "} +

    +
    +
  • +
  • +
    +
    + image +
    +
    + 15 min ago +

    Devil Joe

    +
    +
    +
    +

    + 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. +

    +
    +
  • +
  • +
    +
    + image +
    +
    + 2 days ago +

    Sherly Shie

    +
    +
    +
    +

    + 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.{" "} +

    +
    +
  • +
+
+
+ +
+
+
+

+ Leave a comment +

+

+ Your email address will not be published. Required fields are + marked * +

+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+ +
+
+
+
+
+ +
+
+
+

+ Read latest story +

+

+ Lorem Ipsum is simply dummy text of the printing and typese tting{" "} +
indus orem Ipsum has beenthe standard dummy. +

+
+
+
+
+
+ image + 45 min ago +
+
+

Cool features added!

+

+ Lorem Ipsum is simply dummy text of the printing and + typesetting industry lorem Ipsum has. +

+ READ MORE +
+
+
+
+
+
+ image + 45 min ago +
+
+

Top rated app! Yupp.

+

+ Simply dummy text of the printing and typesetting industry + lorem Ipsum has Lorem Ipsum is. +

+ READ MORE +
+
+
+
+
+
+ image + 45 min ago +
+
+

Creative ideas on app.

+

+ Printing and typesetting industry lorem Ipsum has Lorem + simply dummy text of the. +

+ READ MORE +
+
+
+
+
+
+ + ); +}; + +export default Main; diff --git a/src/component/Blog/BlogSingle/Main.js b/src/component/Blog/BlogSingle/Main.js index 76ca801..96d97d7 100644 --- a/src/component/Blog/BlogSingle/Main.js +++ b/src/component/Blog/BlogSingle/Main.js @@ -1,513 +1,276 @@ import React, { useEffect, useState } from "react"; -import { Link } from "react-router-dom"; -import Bredcrumb from "../../Bredcrumb/Main"; -import BGImg from "../../../assets/images/bread_crumb_bg.png"; -import BGImg1 from "../../../assets/images/bread_crumb_bg_one.png"; -import BGImg2 from "../../../assets/images/bread_crumb_bg_two.png"; -import SiteService from "../../../vendors/service/siteService"; +import { Link, useLocation } from 'react-router-dom' +import Bredcrumb from '../../Bredcrumb/Main' +import BGImg from "../../../assets/images/bread_crumb_bg.png" +import BGImg1 from "../../../assets/images/bread_crumb_bg_one.png" +import BGImg2 from "../../../assets/images/bread_crumb_bg_two.png" +// import SiteService from "../../../vendors/service/siteService"; import { useParams } from "react-router-dom"; -const Main = ({ brdcum }) => { - const [blogData, setBlogData] = useState([]); - const { id } = useParams(); +const Main = ({brdcum}) => { - const api = new SiteService(); - useEffect(() => { - getBlogData(); - }, []); + // const [blogData, setBlogData] = useState([]); + const { id } = useParams(); + const location = useLocation(); + const data = location.state?.data; - const getBlogData = async () => { - try { - const res = await api.blogData(id); - setBlogData(res.data); - console.log("data", res.data); - console.log("Blog details ", res); - } catch (error) { - console.log("Error from blog data ", error); - } - }; + + console.log("location", location, data); + + // const api = new SiteService(); + + // const getBlogData = async () => { + // try { + // const res = await api.blogData(); + // setBlogData(res.data); + // console.log("data", res.data); + // console.log("Blog details ", res); + // console.log("good"); + // } catch (error) { + // console.log("Error from blog data ", error); + // } + // }; + + // useEffect(() => { + // getBlogData(); + // }, []); + + return ( <> - {brdcum.b1 && ( - - )} + + {brdcum.b1 && + } - {brdcum.b2 && ( - - )} + {brdcum.b2 && + } - {brdcum.b5 && ( - - )} + {brdcum.b5 && + } - {brdcum.b3 && } + {brdcum.b3 && + } - {brdcum.b4 && ( - - )} + {brdcum.b4 && + } -
-
-
-
- Review - 45 min ago -
-
-

Top rated app of the year!

-
-
- image -
-
-

- 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. -

-

Why we are best

-

- 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. -

    -
  • -
-
-
-
-
- image +
+
+
+
+ Review + {data && data.post_modified} +
+
+

{data && data.post_title}

+
+
+ image +
+
+

{data && data.post_title}

+

{data && data.post_content}

+ +
+ + +
+
+
+ image +
+
+

{data && data.post_author}

+ {data && data.post_date} +
+
+
+
    +
  • +
  • +
  • +
  • +
+
+
+
+
    +
  • Tags:

  • +
  • app,
  • +
  • rating,
  • +
  • development
  • +
+
-
- image -
-
-
-

Why we are best

-

- 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. -

-
-
- - image - -

- Lorem Ipsum is simply dummy text of the printing and typesetting - in dustry lorem Ipsum has been the industrys standard dummy. -

-

- 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. -

-
-
-
- image +
+
+
+
+

3 Comments

-
-

By: John Dow

- July 25, 2022 -
-
-
    -
  • - - - -
  • -
  • - - - -
  • -
  • - - - -
  • -
  • - - - -
  • +
  • +
    +
    + image +
    +
    + 30 min ago +

    Dolly Shell

    +
    +
    +
    +

    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.

    +
    +
  • +
  • +
    +
    + image +
    +
    + 15 min ago +

    Devil Joe

    +
    +
    +
    +

    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.

    +
    +
  • +
  • +
    +
    + image +
    +
    + 2 days ago +

    Sherly Shie

    +
    +
    +
    +

    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.

    +
    +
-
-
-
    -
  • -

    Tags:

    -
  • -
  • - app, -
  • -
  • - rating, -
  • -
  • - development -
  • -
-
- - -
-
-
-
-

3 Comments

-
-
    -
  • -
    -
    - image -
    -
    - 30 min ago -

    Dolly Shell

    -
    -
    -
    -

    - 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.{" "} -

    -
    -
  • -
  • -
    -
    - image -
    -
    - 15 min ago -

    Devil Joe

    -
    -
    -
    -

    - 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. -

    -
    -
  • -
  • -
    -
    - image -
    -
    - 2 days ago -

    Sherly Shie

    -
    -
    -
    -

    - 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.{" "} -

    -
    -
  • -
-
-
+ -
-
-
-

- Leave a comment -

-

- Your email address will not be published. Required fields are - marked * -

-
-
-
-
-
- +
+
+
+

Leave a comment

+

Your email address will not be published. Required fields are marked *

-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
- -
+ +
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+ +
+
+
- -
-
+ -
-
-
-

- Read latest story -

-

- Lorem Ipsum is simply dummy text of the printing and typese tting{" "} -
indus orem Ipsum has beenthe standard dummy. -

-
-
-
-
-
- image - 45 min ago +
+
+
+

Read latest story

+

Lorem Ipsum is simply dummy text of the printing and typese tting
indus orem Ipsum has beenthe standard dummy.

-
-

Cool features added!

-

- Lorem Ipsum is simply dummy text of the printing and - typesetting industry lorem Ipsum has. -

- READ MORE +
+
+
+
+ image + 45 min ago +
+
+

Cool features added!

+

Lorem Ipsum is simply dummy text of the printing and typesetting + industry lorem Ipsum has.

+ READ MORE +
+
+
+
+
+
+ image + 45 min ago +
+
+

Top rated app! Yupp.

+

Simply dummy text of the printing and typesetting industry lorem Ipsum has Lorem Ipsum is.

+ READ MORE +
+
+
+
+
+
+ image + 45 min ago +
+
+

Creative ideas on app.

+

Printing and typesetting industry lorem Ipsum has Lorem simply dummy text of the.

+ READ MORE +
+
+
-
-
-
-
- image - 45 min ago -
-
-

Top rated app! Yupp.

-

- Simply dummy text of the printing and typesetting industry - lorem Ipsum has Lorem Ipsum is. -

- READ MORE -
-
-
-
-
-
- image - 45 min ago -
-
-

Creative ideas on app.

-

- Printing and typesetting industry lorem Ipsum has Lorem - simply dummy text of the. -

- READ MORE -
-
-
-
-
-
+ - ); -}; + ) +} -export default Main; +export default Main \ No newline at end of file diff --git a/src/routes/index.js b/src/routes/index.js index 2e2edb3..9ec5232 100644 --- a/src/routes/index.js +++ b/src/routes/index.js @@ -12,7 +12,6 @@ import SignUp from "../component/Pages/SignUp/Main"; import Pricing from "../component/Pricing/Main"; import Blog from "../component/Blog/Blog/Main"; import BlogSingle from "../component/Blog/BlogSingle/Main"; - import Terms from "../component/Terms/Main"; import Privacy from "../component/Privacy/Main"; diff --git a/src/vendors/service/siteService.js b/src/vendors/service/siteService.js index e4bdd82..7e06003 100644 --- a/src/vendors/service/siteService.js +++ b/src/vendors/service/siteService.js @@ -5,8 +5,9 @@ class SiteService { constructor() { console.log("Er are here anyway"); } - blogData(id = "") { - return this.getAuxEnd(`/blogdata${id ? "/" + id : ""}`, null); + blogData() { + return this.getAuxEnd(`/blogdata`, null); + // return this.getAuxEnd(`/blogdata${id ? "/" + id : ""}`, null); } countryData() {}