Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4af750f7a7 |
@@ -6,7 +6,7 @@ REACT_APP_ANDROID_URL="https://play.google.com/store/apps/details?id=com.mermsem
|
|||||||
REACT_APP_IOS_URL="https://play.google.com/store/apps/details?id=com.mermsemr.myfit"
|
REACT_APP_IOS_URL="https://play.google.com/store/apps/details?id=com.mermsemr.myfit"
|
||||||
|
|
||||||
|
|
||||||
REACT_APP_APPSITE=" https://mermsemr.com"
|
REACT_APP_APPSITE=" https://myfitapp.mermsemr.com"
|
||||||
#REACT_APP_APPSITE="http://localhost:7012"
|
#REACT_APP_APPSITE="http://localhost:7012"
|
||||||
|
|
||||||
# Social Media Links
|
# Social Media Links
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ const Main = ({ brdcum, bgimg }) => {
|
|||||||
// Set a time out for the blog data to be deleted from local storage
|
// Set a time out for the blog data to be deleted from local storage
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
localStorage.removeItem("myFit--blogData");
|
localStorage.removeItem("myFit--blogData");
|
||||||
}, 3600);
|
}, 3600000);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("Error from blog data ", error);
|
console.log("Error from blog data ", error);
|
||||||
}
|
}
|
||||||
@@ -43,7 +43,6 @@ const Main = ({ brdcum, bgimg }) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -16,36 +16,17 @@ const Main = ({ brdcum }) => {
|
|||||||
let api_call = new SiteService();
|
let api_call = new SiteService();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getBlogData();
|
getBlogData();
|
||||||
}, []);
|
}, [blogData]);
|
||||||
|
|
||||||
const getBlogData = async () => {
|
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 {
|
try {
|
||||||
let res = await api_call.blogData();
|
let res = await api_call.blogData();
|
||||||
|
|
||||||
// Set the blog data to local storage
|
|
||||||
localStorage.setItem("myFit--blogData", JSON.stringify(res.data));
|
|
||||||
setBlogData(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) {
|
} catch (error) {
|
||||||
console.log("Error from blog data ", 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -185,8 +166,7 @@ const Main = ({ brdcum }) => {
|
|||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: item.post_content.substring(0, 100) + " . . .",
|
__html: item.post_content.substring(0, 100) + " . . .",
|
||||||
}}></div>
|
}}></div>
|
||||||
<a href={`/blogdetails/${item.id}`}>READ MORE</a>
|
<Link to={`/blogdetails/${item.id}`}>READ MORE</Link>
|
||||||
{/* <Link to={`/blogdetails/${item.id}`}>READ MORE</Link> */}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -103,22 +103,6 @@ const Main = ({ setfooter, setnavbar, setbrdcum }) => {
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<ul className="app_btn">
|
<ul className="app_btn">
|
||||||
<li>
|
|
||||||
<a href={process.env.REACT_APP_ANDROID_URL}>
|
|
||||||
<img src={blueapp} alt="image" />
|
|
||||||
<img className="white_img" src={whiteapp} alt="image" />
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href={process.env.REACT_APP_IOS_URL}>
|
|
||||||
<img src={blue} alt="image" />
|
|
||||||
<img className="white_img" src={white} alt="image" />
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
{/* <ul className="app_btn">
|
|
||||||
<li>
|
<li>
|
||||||
<Link to="https://play.google.com/store/apps/details?id=com.mermsemr.myfit">
|
<Link to="https://play.google.com/store/apps/details?id=com.mermsemr.myfit">
|
||||||
<img className="blue_img" src={blueapp} alt="image" />
|
<img className="blue_img" src={blueapp} alt="image" />
|
||||||
@@ -131,9 +115,7 @@ const Main = ({ setfooter, setnavbar, setbrdcum }) => {
|
|||||||
<img className="white_img" src={white} alt="image" />
|
<img className="white_img" src={white} alt="image" />
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
</ul> */}
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className="col-lg-6 col-md-12"
|
className="col-lg-6 col-md-12"
|
||||||
|
|||||||
@@ -1,64 +1,20 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import { Link } from 'react-router-dom'
|
||||||
import { Link } from 'react-router-dom';
|
import React from 'react'
|
||||||
// import story1 from '../../../assets/images/story01.png';
|
import story1 from '../../../assets/images/story01.png'
|
||||||
// import story2 from '../../../assets/images/story02.png';
|
import story2 from '../../../assets/images/story02.png'
|
||||||
// import story3 from '../../../assets/images/story03.png';
|
import story3 from '../../../assets/images/story03.png'
|
||||||
import SiteService from "../../../vendors/service/siteService";
|
|
||||||
|
|
||||||
|
|
||||||
const Main = () => {
|
const Main = () => {
|
||||||
const [blogData, setBlogData] = useState([]);
|
|
||||||
|
|
||||||
let api = new SiteService();
|
|
||||||
useEffect(() => {
|
|
||||||
getBlogData();
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const getBlogData = async () => {
|
|
||||||
try {
|
|
||||||
let res = await api.blogData();
|
|
||||||
setBlogData(res.data);
|
|
||||||
|
|
||||||
} catch (error) {
|
|
||||||
console.log("Error from blog data ", error);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<section className="row_am latest_story" id="blog">
|
<section className="row_am latest_story" id="blog">
|
||||||
<div className="container">
|
<div className="container">
|
||||||
<div className="section_title" data-aos="fade-in" data-aos-duration="1500" data-aos-delay="100">
|
<div className="section_title" data-aos="fade-in" data-aos-duration="1500" data-aos-delay="100">
|
||||||
<h2>Read latest <span>story</span></h2>
|
<h2>Read latest <span>story</span></h2>
|
||||||
|
<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">
|
||||||
{blogData.slice(1, 4).map((item, index) => (
|
<div className="col-md-4">
|
||||||
<div
|
|
||||||
className="col-md-4"
|
|
||||||
key={index}>
|
|
||||||
<div
|
|
||||||
className="story_box"
|
|
||||||
data-aos="fade-up"
|
|
||||||
data-aos-duration="1500">
|
|
||||||
<div className="story_img">
|
|
||||||
<img
|
|
||||||
src={item.meta_value}
|
|
||||||
alt="image"
|
|
||||||
/>
|
|
||||||
<span>{new Date(item.post_date).toDateString()}</span>
|
|
||||||
</div>
|
|
||||||
<div className="story_text">
|
|
||||||
<h3>{item.post_title}</h3>
|
|
||||||
<div
|
|
||||||
dangerouslySetInnerHTML={{
|
|
||||||
__html: item.post_content.substring(0, 100) + " . . .",
|
|
||||||
}}></div>
|
|
||||||
<Link to={`/blogdetails/${item.id}`}>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={story1} alt="image" />
|
<img src={story1} alt="image" />
|
||||||
@@ -97,7 +53,7 @@ const Main = () => {
|
|||||||
<Link to="/blog-single">READ MORE</Link>
|
<Link to="/blog-single">READ MORE</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div> */}
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ const Main = ({navbar}) => {
|
|||||||
<Link to="/contact" className="nav-link" >Contact</Link>
|
<Link to="/contact" className="nav-link" >Contact</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className="nav-item">
|
<li className="nav-item">
|
||||||
<a href={process.env.REACT_APP_APPSITE} className="nav-link dark_btn">GET STARTED</a>
|
<Link to={process.env.REACT_APP_APPSITE} className="nav-link dark_btn">GET STARTED</Link>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ import Bredcrumb from '../Bredcrumb/Main'
|
|||||||
import BGImg from "../../assets/images/bread_crumb_bg.png"
|
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 blueapp from "../../assets/images/appstore_blue.png";
|
|
||||||
import blue from "../../assets/images/googleplay_blue.png";
|
|
||||||
|
|
||||||
|
|
||||||
const Main = ({brdcum}) => {
|
const Main = ({brdcum}) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user