From ce1879d0a21be5887967334584de9ea0576b08de Mon Sep 17 00:00:00 2001 From: "VICTOR\\anumu" Date: Fri, 13 Jan 2023 15:03:38 +0100 Subject: [PATCH] Rendered the pricing list from the api call to th pricing_page --- src/component/HomeMain/Pricing/Main.js | 532 +++++++++---------------- src/vendors/service/siteService.js | 4 + 2 files changed, 202 insertions(+), 334 deletions(-) diff --git a/src/component/HomeMain/Pricing/Main.js b/src/component/HomeMain/Pricing/Main.js index fb75738..171b3bf 100644 --- a/src/component/HomeMain/Pricing/Main.js +++ b/src/component/HomeMain/Pricing/Main.js @@ -1,13 +1,30 @@ import { Link } from 'react-router-dom' -import React , { useState} from 'react' +import React , { useState, useEffect} from 'react' +import AOS from "aos"; import img1 from '../../../assets/images/standard.png' import img2 from '../../../assets/images/unlimited.png' import img3 from '../../../assets/images/premium.png' +import SiteService from '../../../vendors/service/siteService' + const Main = ({gredient , video}) => { const[tog, setTog] = useState() + const [prices, setPrices] = useState([]); // initial state for FAQs before API call + + let priceServices = new SiteService(); // instantiating the class + + const getAllPriceData = () => { + return priceServices.priceData(); + }; + + useEffect(() => { + getAllPriceData().then((data) => setPrices(data.data)); + AOS.init(); + AOS.refresh(); + }, []); + return ( <> {gredient ? @@ -29,37 +46,52 @@ const Main = ({gredient , video}) => {
-
-
-
- image -
-
-

Standard

- For the basics -
- $15 -
    -
  • -

    Up to 5 Website

    -
  • -
  • -

    50 GB disk space

    -
  • -
  • -

    10 Customize sub pages

    -
  • -
  • -

    2 Domains access

    -
  • -
  • -

    Support on request

    -
  • -
- BUY NOW -
-
-
+ + {prices.length > 0 && + prices.map((price, index) => { + if (index % 2 == 0) { + return ( +
+
+
+ { video ? image : image } +
+
+

{price.title}

+ {price.text} +
+ {price.price} +
    + {price.features.map((feature, index)=>

    {feature}

    )} +
+ Start Now +
+
+ ); + } else { + return ( +
+
+
+ { video ? image : image } +
+
+

{price.title}

+ {price.text} +
+ {price.price} +
    + {price.features.map((feature, index)=>

    {feature}

    )} +
+ Start Now +
+
+ ); + } + }) + } + + {/*
image @@ -86,136 +118,60 @@ const Main = ({gredient , video}) => {

24/7 Customer support

- BUY NOW + Start Now
-
-
-
-
- image -
-
-

Premium

- For small team -
- $55 -
    -
  • -

    Up to 10 Website

    -
  • -
  • -

    100 GB disk space

    -
  • -
  • -

    15 Customize sub pages

    -
  • -
  • -

    4 Domains access

    -
  • -
  • -

    24/7 Customer support

    -
  • -
- BUY NOW -
-
+
*/} +
-
-
-
- image -
-
-

Standard

- For the basics -
- $150 -
    -
  • -

    Up to 10 Website

    -
  • -
  • -

    100 GB disk space

    -
  • -
  • -

    25 Customize sub pages

    -
  • -
  • -

    4 Domains access

    -
  • -
  • -

    Support on request

    -
  • -
- BUY NOW -
-
-
-
-
- image -
-
-

Unlimited

- For the professionals -
- $999 -
    -
  • -

    Unlimited Website

    -
  • -
  • -

    400 GB disk space

    -
  • -
  • -

    40 Customize sub pages

    -
  • -
  • -

    20 Domains access

    -
  • -
  • -

    24/7 Customer support

    -
  • -
- BUY NOW -
-
+ {prices.length > 0 && + prices.map((price, index) => { + if (index % 2 == 0) { + return ( +
+
+
+ { video ? image : image } +
+
+

{price.title}

+ {price.text} +
+ {price.price} +
    + {price.features.map((feature, index)=>

    {feature}

    )} +
+ Start Now +
+
+ ); + } else { + return ( +
+
+
+ { video ? image : image } +
+
+

{price.title}

+ {price.text} +
+ {price.price} +
    + {price.features.map((feature, index)=>

    {feature}

    )} +
+ Start Now +
+
+ ); + } + }) + } -
-
-
- image -
-
-

Premium

- For small team -
- $550 -
    -
  • -

    Up to 20 Website

    -
  • -
  • -

    200 GB disk space

    -
  • -
  • -

    25 Customize sub pages

    -
  • -
  • -

    8 Domains access

    -
  • -
  • -

    24/7 Customer support

    -
  • -
- BUY NOW -
-
@@ -241,193 +197,101 @@ const Main = ({gredient , video}) => {
-
-
-
- { video ? image : image } -
-
-

Standard

- For the basics -
- $15 -
    -
  • -

    Up to 5 Website

    -
  • -
  • -

    50 GB disk space

    -
  • -
  • -

    10 Customize sub pages

    -
  • -
  • -

    2 Domains access

    -
  • -
  • -

    Support on request

    -
  • -
- BUY NOW -
-
-
-
-
- { video ? image : image } -
-
-

Unlimited

- For the professionals -
- $99 -
    -
  • -

    Unlimited Website

    -
  • -
  • -

    200 GB disk space

    -
  • -
  • -

    20 Customize sub pages

    -
  • -
  • -

    10 Domains access

    -
  • -
  • -

    24/7 Customer support

    -
  • -
- BUY NOW -
-
-
-
-
- {video ? image : image } -
-
-

Premium

- For small team -
- $55 -
    -
  • -

    Up to 10 Website

    -
  • -
  • -

    100 GB disk space

    -
  • -
  • -

    15 Customize sub pages

    -
  • -
  • -

    4 Domains access

    -
  • -
  • -

    24/7 Customer support

    -
  • -
- BUY NOW -
-
+ + {prices.length > 0 && + prices.map((price, index) => { + if (index % 2 == 0) { + return ( +
+
+
+ { video ? image : image } +
+
+

{price.title}

+ {price.text} +
+ {price.price} +
    + {price.features.map((feature, index)=>

    {feature}

    )} +
+ Start Now +
+
+ ); + } else { + return ( +
+
+
+ { video ? image : image } +
+
+

{price.title}

+ {price.text} +
+ {price.price} +
    + {price.features.map((feature, index)=>

    {feature}

    )} +
+ Start Now +
+
+ ); + } + }) + } +
-
-
-
- { video ? image : image } -
-
-

Standard

- For the basics -
- $150 -
    -
  • -

    Up to 10 Website

    -
  • -
  • -

    100 GB disk space

    -
  • -
  • -

    25 Customize sub pages

    -
  • -
  • -

    4 Domains access

    -
  • -
  • -

    Support on request

    -
  • -
- BUY NOW -
-
-
-
-
- { video ? image : } -
-
-

Unlimited

- For the professionals -
- $999 -
    -
  • -

    Unlimited Website

    -
  • -
  • -

    400 GB disk space

    -
  • -
  • -

    40 Customize sub pages

    -
  • -
  • -

    20 Domains access

    -
  • -
  • -

    24/7 Customer support

    -
  • -
- BUY NOW -
-
+ {prices.length > 0 && + prices.map((price, index) => { + if (index % 2 == 0) { + return ( +
+
+
+ { video ? image : image } +
+
+

{price.title}

+ {price.text} +
+ {price.price} +
    + {price.features.map((feature, index)=>

    {feature}

    )} +
+ Start Now +
+
+ ); + } else { + return ( +
+
+
+ { video ? image : image } +
+
+

{price.title}

+ {price.text} +
+ {price.price} +
    + {price.features.map((feature, index)=>

    {feature}

    )} +
+ Start Now +
+
+ ); + } + }) + } -
-
-
- {video ? image : image } -
-
-

Premium

- For small team -
- $550 -
    -
  • -

    Up to 20 Website

    -
  • -
  • -

    200 GB disk space

    -
  • -
  • -

    25 Customize sub pages

    -
  • -
  • -

    8 Domains access

    -
  • -
  • -

    24/7 Customer support

    -
  • -
- BUY NOW -
-
diff --git a/src/vendors/service/siteService.js b/src/vendors/service/siteService.js index 1f359c1..438f3f4 100644 --- a/src/vendors/service/siteService.js +++ b/src/vendors/service/siteService.js @@ -16,6 +16,10 @@ class SiteService { faqData() { return this.getAuxEnd("/faq", null); } + + priceData() { + return this.getAuxEnd("/pricing", null); + } //---------------------------------------- ----- //---------------------------------------- -----