Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 175e66d132 | |||
| 2d5412c1df | |||
| c795c861a9 | |||
| 58c5773776 | |||
| bb7b54f8a4 | |||
| d39e404f0b | |||
| 745cd01429 |
@@ -6,6 +6,7 @@ import BGImg2 from "../../../assets/images/bread_crumb_bg_two.png";
|
|||||||
import SiteService from "../../../vendors/service/siteService";
|
import SiteService from "../../../vendors/service/siteService";
|
||||||
const Main = ({ brdcum, bgimg }) => {
|
const Main = ({ brdcum, bgimg }) => {
|
||||||
const [blogData, setBlogData] = useState([]);
|
const [blogData, setBlogData] = useState([]);
|
||||||
|
console.log(blogData);
|
||||||
|
|
||||||
const api = new SiteService();
|
const api = new SiteService();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -18,7 +19,7 @@ const Main = ({ brdcum, bgimg }) => {
|
|||||||
|
|
||||||
setBlogData(res.data);
|
setBlogData(res.data);
|
||||||
|
|
||||||
console.log(res.data);
|
// console.log(res.data);
|
||||||
|
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -124,7 +125,7 @@ const Main = ({ brdcum, bgimg }) => {
|
|||||||
<div className="story_text">
|
<div className="story_text">
|
||||||
<h3>{data.post_title}</h3>
|
<h3>{data.post_title}</h3>
|
||||||
<div dangerouslySetInnerHTML={{__html: data && data.post_content.substring(0,100)+' . . .'}}></div>
|
<div dangerouslySetInnerHTML={{__html: data && data.post_content.substring(0,100)+' . . .'}}></div>
|
||||||
<Link to={`/blog-single/${data.id}`} state={{data}}>
|
<Link to={`/blog-single/${data.id}`} state={{data, allData: blogData}}>
|
||||||
READ MORE
|
READ MORE
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,15 +5,46 @@ import BGImg from "../../../assets/images/bread_crumb_bg.png"
|
|||||||
import BGImg1 from "../../../assets/images/bread_crumb_bg_one.png"
|
import BGImg1 from "../../../assets/images/bread_crumb_bg_one.png"
|
||||||
import BGImg2 from "../../../assets/images/bread_crumb_bg_two.png"
|
import BGImg2 from "../../../assets/images/bread_crumb_bg_two.png"
|
||||||
import { useParams } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
|
import SiteService from "../../../vendors/service/siteService";
|
||||||
|
|
||||||
|
|
||||||
const Main = ({brdcum}) => {
|
const Main = ({brdcum}) => {
|
||||||
|
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const data = location.state?.data;
|
const [blogData, setBlogData] = useState([]);
|
||||||
|
const [newAllData, setNewAllData] = useState([]);
|
||||||
console.log("location", location, data);
|
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getBlogData();
|
||||||
|
getLatestBlog();
|
||||||
|
}, [location.state?.data]);
|
||||||
|
|
||||||
|
const api = new SiteService();
|
||||||
|
const data = location.state?.data;
|
||||||
|
const allData = location.state?.allData;
|
||||||
|
|
||||||
|
|
||||||
|
const getLatestBlog = () =>{
|
||||||
|
const arrData = [ ...allData ];
|
||||||
|
const itemIndex = arrData.findIndex(x => x.id === data.id)
|
||||||
|
arrData.splice(itemIndex, 1);
|
||||||
|
const newAllData = arrData.splice(0, 3);
|
||||||
|
setNewAllData(newAllData);
|
||||||
|
|
||||||
|
console.log('All data ', arrData, newAllData);
|
||||||
|
}
|
||||||
|
|
||||||
|
const getBlogData = async () => {
|
||||||
|
try {
|
||||||
|
const res = await api.blogData();
|
||||||
|
setBlogData(res.data);
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.log("Error from blog data ", error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|
||||||
@@ -238,21 +269,34 @@ const Main = ({brdcum}) => {
|
|||||||
<p>Lorem Ipsum is simply dummy text of the printing and typese tting <br/> indus orem Ipsum has beenthe standard dummy.</p>
|
<p>Lorem Ipsum is simply dummy text of the printing and typese tting <br/> indus orem Ipsum has beenthe standard dummy.</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="col-md-4">
|
|
||||||
<div className="story_box" data-aos="fade-up" data-aos-duration="1500">
|
{newAllData.map((data) => {
|
||||||
<div className="story_img">
|
|
||||||
<img src="assets/images/story01.png" alt="image" />
|
return (
|
||||||
<span>45 min ago</span>
|
|
||||||
</div>
|
<div className="col-md-4">
|
||||||
<div className="story_text">
|
<div className="story_box" data-aos="fade-up" data-aos-duration="1500">
|
||||||
<h3>Cool features added!</h3>
|
<div className="story_img">
|
||||||
<p>Lorem Ipsum is simply dummy text of the printing and typesetting
|
<img src={data.meta_value} alt="image" />
|
||||||
industry lorem Ipsum has.</p>
|
<span>45 min ago</span>
|
||||||
<Link to="#">READ MORE</Link>
|
</div>
|
||||||
</div>
|
<div className="story_text">
|
||||||
</div>
|
<h3>{data.post_title}</h3>
|
||||||
</div>
|
<div dangerouslySetInnerHTML={{__html: data.post_content.substring(0,300)+' . . .'}}></div>
|
||||||
<div className="col-md-4">
|
<Link to={`/blog-single/${data.id}`} state={{data}}>
|
||||||
|
READ MORE
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
)})}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{/* <div className="col-md-4">
|
||||||
<div className="story_box" data-aos="fade-up" data-aos-duration="1500">
|
<div className="story_box" data-aos="fade-up" data-aos-duration="1500">
|
||||||
<div className="story_img">
|
<div className="story_img">
|
||||||
<img src="assets/images/story02.png" alt="image" />
|
<img src="assets/images/story02.png" alt="image" />
|
||||||
@@ -277,7 +321,7 @@ const Main = ({brdcum}) => {
|
|||||||
<Link to="#">READ MORE</Link>
|
<Link to="#">READ MORE</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> */}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -94,13 +94,13 @@ const Main = ({ footer }) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="col-lg-3 col-md-6 col-12">
|
<div className="col-lg-3 col-md-6 col-12">
|
||||||
<div className="links">
|
<div className="links">
|
||||||
<h3>Help & Suport</h3>
|
<h3>Help & Support</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<Link to="/faq">FAQs</Link>
|
<Link to="/faq">FAQs</Link>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<Link to="/#how_it_work">How it works</Link>
|
<Link to="/how_it_work">How it works</Link>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<Link to="/terms">Terms & conditions</Link>
|
<Link to="/terms">Terms & conditions</Link>
|
||||||
@@ -231,13 +231,13 @@ const Main = ({ footer }) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="col-lg-3 col-md-6 col-12">
|
<div className="col-lg-3 col-md-6 col-12">
|
||||||
<div className="links">
|
<div className="links">
|
||||||
<h3>Help & Suport</h3>
|
<h3>Help & Support</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<Link to="/faq">FAQs</Link>
|
<Link to="/faq">FAQs</Link>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<Link to="/#how_it_work">How it works</Link>
|
<Link to="/how_it_work">How it works</Link>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<Link to="/terms">Terms & conditions</Link>
|
<Link to="/terms">Terms & conditions</Link>
|
||||||
@@ -367,7 +367,7 @@ const Main = ({ footer }) => {
|
|||||||
<Link to="#">Support</Link>
|
<Link to="#">Support</Link>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<Link to="/work">How it works</Link>
|
<Link to="/how_it_work">How it works</Link>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<Link to="/terms">Terms & conditions</Link>
|
<Link to="/terms">Terms & conditions</Link>
|
||||||
@@ -483,7 +483,7 @@ const Main = ({ footer }) => {
|
|||||||
|
|
||||||
<div className="col-lg-3 col-md-6 col-12">
|
<div className="col-lg-3 col-md-6 col-12">
|
||||||
<div className="links">
|
<div className="links">
|
||||||
<h3>Help & Suport</h3>
|
<h3>Help & Support</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<Link to="/faq">FAQs</Link>
|
<Link to="/faq">FAQs</Link>
|
||||||
@@ -492,7 +492,7 @@ const Main = ({ footer }) => {
|
|||||||
<Link to="#">Support</Link>
|
<Link to="#">Support</Link>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<Link to="/work">How it works</Link>
|
<Link to="/how_it_work">How it works</Link>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<Link to="/terms">Terms & conditions</Link>
|
<Link to="/terms">Terms & conditions</Link>
|
||||||
@@ -615,7 +615,7 @@ const Main = ({ footer }) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="col-lg-3 col-md-6 col-12">
|
<div className="col-lg-3 col-md-6 col-12">
|
||||||
<div className="links">
|
<div className="links">
|
||||||
<h3>Help & Suport</h3>
|
<h3>Help & Support</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<Link to="/faq">FAQs</Link>
|
<Link to="/faq">FAQs</Link>
|
||||||
@@ -624,7 +624,7 @@ const Main = ({ footer }) => {
|
|||||||
<Link to="#">Support</Link>
|
<Link to="#">Support</Link>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<Link to="/work">How it works</Link>
|
<Link to="/how_it_work">How it works</Link>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<Link to="/terms">Terms & conditions</Link>
|
<Link to="/terms">Terms & conditions</Link>
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ const Main = ({navbar}) => {
|
|||||||
<Link smooth to="/#features" className="nav-link">Features</Link>
|
<Link smooth to="/#features" className="nav-link">Features</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className="nav-item">
|
<li className="nav-item">
|
||||||
<Link smooth to="/#how_it_work" className="nav-link">How it works</Link>
|
<Link smooth to="#how_it_work" className="nav-link">How it works</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className="nav-item" >
|
<li className="nav-item" >
|
||||||
<Link to="/blog" className="nav-link">Blog</Link>
|
<Link to="/blog" className="nav-link">Blog</Link>
|
||||||
@@ -286,7 +286,7 @@ const Main = ({navbar}) => {
|
|||||||
<span className="drp_btn" ><i className="icofont-rounded-down"></i></span>
|
<span className="drp_btn" ><i className="icofont-rounded-down"></i></span>
|
||||||
<div className="sub_menu" style={{ display: show ? "block" : "none" }}>
|
<div className="sub_menu" style={{ display: show ? "block" : "none" }}>
|
||||||
<ul>
|
<ul>
|
||||||
<li><Link to="/">Home Defoult</Link></li>
|
<li><Link to="/">Home Default</Link></li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@@ -359,7 +359,7 @@ const Main = ({navbar}) => {
|
|||||||
<span className="drp_btn" ><i className="icofont-rounded-down"></i></span>
|
<span className="drp_btn" ><i className="icofont-rounded-down"></i></span>
|
||||||
<div className="sub_menu">
|
<div className="sub_menu">
|
||||||
<ul>
|
<ul>
|
||||||
<li><Link to="/">Home Defoult</Link></li>
|
<li><Link to="/">Home Default</Link></li>
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
@@ -404,7 +404,7 @@ const Main = ({navbar}) => {
|
|||||||
<span className="drp_btn" ><i className="icofont-rounded-down"></i></span>
|
<span className="drp_btn" ><i className="icofont-rounded-down"></i></span>
|
||||||
<div className="sub_menu" style={{ display: show ? "block" : "none" }}>
|
<div className="sub_menu" style={{ display: show ? "block" : "none" }}>
|
||||||
<ul>
|
<ul>
|
||||||
<li><Link to="/">Home Defoult</Link></li>
|
<li><Link to="/">Home Default</Link></li>
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
@@ -477,7 +477,7 @@ const Main = ({navbar}) => {
|
|||||||
<span className="drp_btn" ><i className="icofont-rounded-down"></i></span>
|
<span className="drp_btn" ><i className="icofont-rounded-down"></i></span>
|
||||||
<div className="sub_menu">
|
<div className="sub_menu">
|
||||||
<ul>
|
<ul>
|
||||||
<li><Link to="/">Home Defoult</Link></li>
|
<li><Link to="/">Home Default</Link></li>
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
@@ -533,7 +533,7 @@ const Main = ({navbar}) => {
|
|||||||
<span className="drp_btn" ><i className="icofont-rounded-down"></i></span>
|
<span className="drp_btn" ><i className="icofont-rounded-down"></i></span>
|
||||||
<div className="sub_menu" style={{ display: show ? "block" : "none" }}>
|
<div className="sub_menu" style={{ display: show ? "block" : "none" }}>
|
||||||
<ul>
|
<ul>
|
||||||
<li><Link to="/">Home Defoult</Link></li>
|
<li><Link to="/">Home Default</Link></li>
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -328,16 +328,16 @@ const Main = ({brdcum}) => {
|
|||||||
<h2>Let’s download free from apple and play store</h2>
|
<h2>Let’s download free from apple and play store</h2>
|
||||||
<p>Instant free download from apple and play store. All you need is an iPhone or Android device to enjoy all personalized metrics for personal use. Welcome to myFit App.</p>
|
<p>Instant free download from apple and play store. All you need is an iPhone or Android device to enjoy all personalized metrics for personal use. Welcome to myFit App.</p>
|
||||||
</div>
|
</div>
|
||||||
<ul className="app_btn">
|
<ul className="app_btn">
|
||||||
<li>
|
<li>
|
||||||
<Link to="#">
|
<a href={process.env.REACT_APP_ANDROID_URL}>
|
||||||
<img src="assets/images/appstore_blue.png" alt="image" />
|
<img src={blueapp} alt="image" />
|
||||||
</Link>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<Link to="#">
|
<a href={process.env.REACT_APP_IOS_URL}>
|
||||||
<img src="assets/images/googleplay_blue.png" alt="image" />
|
<img src={blue} alt="image" />
|
||||||
</Link>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { Route, Routes, useLocation } from "react-router-dom";
|
|||||||
import Navbar from "../component/Navbar/Main";
|
import Navbar from "../component/Navbar/Main";
|
||||||
import Footer from "../component/Footer/Main";
|
import Footer from "../component/Footer/Main";
|
||||||
import Home from "../component/Home/Main";
|
import Home from "../component/Home/Main";
|
||||||
|
import Work from "../component/HomeMain/Work/Main"
|
||||||
import AboutUs from "../component/AboutUs/Main";
|
import AboutUs from "../component/AboutUs/Main";
|
||||||
import Review from "../component/Pages/Review/Main";
|
import Review from "../component/Pages/Review/Main";
|
||||||
import Contact from "../component/Contact/Main";
|
import Contact from "../component/Contact/Main";
|
||||||
@@ -13,6 +14,7 @@ import Pricing from "../component/Pricing/Main";
|
|||||||
import Blog from "../component/Blog/Blog/Main";
|
import Blog from "../component/Blog/Blog/Main";
|
||||||
import BlogSingle from "../component/Blog/BlogSingle/Main";
|
import BlogSingle from "../component/Blog/BlogSingle/Main";
|
||||||
|
|
||||||
|
|
||||||
import Terms from "../component/Terms/Main";
|
import Terms from "../component/Terms/Main";
|
||||||
import Privacy from "../component/Privacy/Main";
|
import Privacy from "../component/Privacy/Main";
|
||||||
|
|
||||||
@@ -87,6 +89,8 @@ const Routing = () => {
|
|||||||
<Route path="/blog-single/:id" element={<BlogSingle brdcum={brdcum} />} />
|
<Route path="/blog-single/:id" element={<BlogSingle brdcum={brdcum} />} />
|
||||||
<Route path="/terms" element={<Terms brdcum={brdcum} />} />
|
<Route path="/terms" element={<Terms brdcum={brdcum} />} />
|
||||||
<Route path="/privacy" element={<Privacy brdcum={brdcum} />} />
|
<Route path="/privacy" element={<Privacy brdcum={brdcum} />} />
|
||||||
|
<Route path="/how_it_work" element={<Work brdcum={brdcum} />} />
|
||||||
|
|
||||||
</Routes>
|
</Routes>
|
||||||
{footerpage && <Footer footer={footer} />}
|
{footerpage && <Footer footer={footer} />}
|
||||||
</>
|
</>
|
||||||
|
|||||||
Vendored
+1
-1
@@ -6,7 +6,7 @@ class SiteService {
|
|||||||
console.log("Er are here anyway");
|
console.log("Er are here anyway");
|
||||||
}
|
}
|
||||||
// Blog Data {Get}
|
// Blog Data {Get}
|
||||||
blogData() {
|
blogData(id) {
|
||||||
return this.getAuxEnd("/blogdata", null);
|
return this.getAuxEnd("/blogdata", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user