Compare commits

..

11 Commits

7 changed files with 100 additions and 15 deletions
+1 -1
View File
@@ -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_APPSITE=" https://myfitapp.mermsemr.com"
REACT_APP_APPSITE=" https://mermsemr.com"
#REACT_APP_APPSITE="http://localhost:7012"
# Social Media Links
+2 -1
View File
@@ -29,7 +29,7 @@ const Main = ({ brdcum, bgimg }) => {
// Set a time out for the blog data to be deleted from local storage
setTimeout(() => {
localStorage.removeItem("myFit--blogData");
}, 3600000);
}, 3600);
} catch (error) {
console.log("Error from blog data ", error);
}
@@ -42,6 +42,7 @@ const Main = ({ brdcum, bgimg }) => {
}
}
};
return (
<>
+23 -3
View File
@@ -16,17 +16,36 @@ const Main = ({ brdcum }) => {
let api_call = new SiteService();
useEffect(() => {
getBlogData();
}, [blogData]);
}, []);
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_call.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);
}
}
};
return (
@@ -166,7 +185,8 @@ const Main = ({ brdcum }) => {
dangerouslySetInnerHTML={{
__html: item.post_content.substring(0, 100) + " . . .",
}}></div>
<Link to={`/blogdetails/${item.id}`}>READ MORE</Link>
<a href={`/blogdetails/${item.id}`}>READ MORE</a>
{/* <Link to={`/blogdetails/${item.id}`}>READ MORE</Link> */}
</div>
</div>
</div>
+19 -1
View File
@@ -103,6 +103,22 @@ const Main = ({ setfooter, setnavbar, setbrdcum }) => {
</p>
</div>
<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>
<Link to="https://play.google.com/store/apps/details?id=com.mermsemr.myfit">
<img className="blue_img" src={blueapp} alt="image" />
@@ -115,7 +131,9 @@ const Main = ({ setfooter, setnavbar, setbrdcum }) => {
<img className="white_img" src={white} alt="image" />
</Link>
</li>
</ul>
</ul> */}
</div>
<div
className="col-lg-6 col-md-12"
+52 -8
View File
@@ -1,20 +1,64 @@
import { Link } from 'react-router-dom'
import React from 'react'
import story1 from '../../../assets/images/story01.png'
import story2 from '../../../assets/images/story02.png'
import story3 from '../../../assets/images/story03.png'
import React, { useEffect, useState } from "react";
import { Link } from 'react-router-dom';
// import story1 from '../../../assets/images/story01.png';
// import story2 from '../../../assets/images/story02.png';
// import story3 from '../../../assets/images/story03.png';
import SiteService from "../../../vendors/service/siteService";
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 (
<>
<section className="row_am latest_story" id="blog">
<div className="container">
<div className="section_title" data-aos="fade-in" data-aos-duration="1500" data-aos-delay="100">
<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 className="row">
<div className="col-md-4">
{blogData.slice(1, 4).map((item, index) => (
<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_img">
<img src={story1} alt="image" />
@@ -53,7 +97,7 @@ const Main = () => {
<Link to="/blog-single">READ MORE</Link>
</div>
</div>
</div>
</div> */}
</div>
</div>
</section>
+1 -1
View File
@@ -55,7 +55,7 @@ const Main = ({navbar}) => {
<Link to="/contact" className="nav-link" >Contact</Link>
</li>
<li className="nav-item">
<Link to={process.env.REACT_APP_APPSITE} className="nav-link dark_btn">GET STARTED</Link>
<a href={process.env.REACT_APP_APPSITE} className="nav-link dark_btn">GET STARTED</a>
</li>
</ul>
</div>
+2
View File
@@ -6,6 +6,8 @@ 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 blueapp from "../../assets/images/appstore_blue.png";
import blue from "../../assets/images/googleplay_blue.png";
const Main = ({brdcum}) => {