Compare commits

..

2 Commits

Author SHA1 Message Date
victorAnumudu 477f47ef80 image and featured blog implemented 2023-04-10 21:47:08 +01:00
tokslaw ab1618cdab Merge branch 'blog_implementation' of FloatSystems/float-www into master 2023-04-10 16:09:02 +00:00
6 changed files with 59 additions and 43 deletions
+1
View File
@@ -10,3 +10,4 @@ REACT_APP_GOOGLE_PLAY_LINK='https://apps.apple.com/us/app/float-mobility/id14653
REACT_APP_AUX_ENDPOINT='https://float-gat.dev.chiefsoft.net/en/floatweb/api/v1/' REACT_APP_AUX_ENDPOINT='https://float-gat.dev.chiefsoft.net/en/floatweb/api/v1/'
REACT_APP_IMAGE_LINK='https://blog.float.sg/wp-content/uploads/'
+2 -2
View File
@@ -4714,8 +4714,8 @@ h5.posts-category {
.featured-badge { .featured-badge {
z-index: 70; z-index: 70;
position: absolute; position: absolute;
top: 20px; top: 10px;
right: 20px; right: 10px;
width: 45px; width: 45px;
height: 45px; height: 45px;
-webkit-border-radius: 100%; -webkit-border-radius: 100%;
+2 -2
View File
@@ -39,12 +39,12 @@ function App() {
try { try {
const res = await siteApi.blogData(); const res = await siteApi.blogData();
if(res.status == 200 /* && res.data.status > 0*/){ if(res.status == 200 /* && res.data.status > 0*/){
console.log(res.data.payload, res.data); console.log(res.data);
setBlogData(res.data) setBlogData(res.data)
return return
} }
}catch(error) { }catch(error) {
setBlogData({payload: {blogdata: []}}) setBlogData({blogdata: []})
} }
}; };
+12 -7
View File
@@ -27,23 +27,27 @@ const BlogItems = ({blogData}) => {
return ( return (
<div className="row"> <div className="row">
{ {
blogData?.payload == undefined ? // API CALL IN PROGRESS blogData?.blogdata == undefined ? // API CALL IN PROGRESS
<div className='col-12 text-center display-4'>Loading...</div> // <div className='col-12 text-center display-4'>Loading...</div>
<div className="col-12 text-center">
<div className="spinner-border spinner-border-lg" role="status" style={{width: '3rem', height: '3rem'}}>
</div>
</div>
: :
// API CALL FINISHED // API CALL FINISHED
( (
blogData?.payload?.blogdata.length < 1 ? blogData?.blogdata.length < 1 ?
<div className='col-12 text-center display-4'>No Blog Currently Found!</div> <div className='col-12 text-center display-4'>No Blog Currently Found!</div>
: :
blogData?.payload?.blogdata.map((blog, index) => { blogData?.blogdata.map((blog, index) => {
if(location == '/blogs'){ if(location == '/blogs'){
return( return(
<div key={index} id="b-post-1" className="col-md-6 col-lg-4"> <div key={index} id="b-post-1" className="col-md-6 col-lg-4">
<div className="blog-post mb-40 wow fadeInUp" data-wow-delay="0.4s"> <div className="blog-post mb-40 wow fadeInUp" data-wow-delay="0.4s">
{/* BLOG POST IMAGE */} {/* BLOG POST IMAGE */}
<div className="blog-post-img rounded"> <div className="blog-post-img rounded">
<img className="img-fluid rounded" src="assets/images/blog/post-1-img.jpg" alt="blog-post-image" /> {/* <img className="img-fluid rounded" src="assets/images/blog/post-1-img.jpg" alt="blog-post-image" /> */}
{/* <img className="img-fluid" src={blog.meta_value} alt="blog-post-image" /> */} <img className="img-fluid rounded" src={process.env.REACT_APP_IMAGE_LINK + blog.meta_value} alt="blog-post-image" />
</div> </div>
{/* BLOG POST TEXT */} {/* BLOG POST TEXT */}
<div className="blog-post-txt"> <div className="blog-post-txt">
@@ -73,7 +77,8 @@ const BlogItems = ({blogData}) => {
<div className="blog-post mb-40 wow fadeInUp" data-wow-delay="0.4s"> <div className="blog-post mb-40 wow fadeInUp" data-wow-delay="0.4s">
{/* BLOG POST IMAGE */} {/* BLOG POST IMAGE */}
<div className="blog-post-img rounded"> <div className="blog-post-img rounded">
<img className="img-fluid rounded" src="assets/images/blog/post-1-img.jpg" alt="blog-post-image" /> {/* <img className="img-fluid rounded" src="assets/images/blog/post-1-img.jpg" alt="blog-post-image" /> */}
<img className="img-fluid rounded" src={process.env.REACT_APP_IMAGE_LINK + blog.meta_value} alt="blog-post-image" />
</div> </div>
{/* BLOG POST TEXT */} {/* BLOG POST TEXT */}
<div className="blog-post-txt"> <div className="blog-post-txt">
+39 -29
View File
@@ -13,7 +13,7 @@ class Blog_listing extends React.Component {
} }
render() { render() {
// const [blogData, setBlogData] = useState([]) // for holding // const [blogData, setBlogData] = useState([]) // for holding
//const siteApi = new SiteService(); // instantiating the API SERVICE //const siteApi = new SiteService(); // instantiating the API SERVICE
@@ -53,35 +53,45 @@ class Blog_listing extends React.Component {
</div> </div>
</div> </div>
{/* FEATURED POST */} {/* FEATURED POST */}
<div className="rel blog-post featured-post wide-post"> {
<div className="row d-flex align-items-center"> this.props.blogData?.featured == undefined ? // API CALL IN PROGRESS
<div className="featured-badge text-center ico-30 bg_whitesmoke yellow-color"> <div className="text-center">
<span className="flaticon-star" /> <div className="spinner-border spinner-border-lg" role="status" style={{width: '3rem', height: '3rem'}}>
</div>
{/* BLOG POST IMAGE */}
<div className="col-lg-7 blog-post-img">
<img className="img-fluid" src="assets/images/blog/post-1-img.jpg" alt="blog-post-image" />
</div>
{/* BLOG POST TEXT */}
<div className="col-lg-5 blog-post-txt">
{/* Post Tag */}
<p className="p-md post-tag">NordEx News</p>
{/* Post Link */}
<h5 className="h5-xl">
<a href="single-post.html">Tempor sapien donec gravida a suscipit and porta justo vitae</a>
</h5>
{/* Text */}
<p className="p-md">Aliqum mullam blandit vitae and tempor sapien and donec lipsum gravida a porta
undo velna dolor in cubilia laoreet
</p>
{/* Post Meta */}
<div className="post-meta">
<div className="post-author-avatar"><img src="assets/images/post-author-1.jpg" alt="author-avatar" /></div>
<p>12 min read</p>
</div> </div>
</div> {/* END BLOG POST TEXT */} </div>
</div> {/* End row */} :
</div> {/* END FEATURED POST */} <div className="rel blog-post featured-post wide-post">
<div className="row d-flex align-items-center">
<div className="featured-badge text-center ico-30 bg_whitesmoke yellow-color">
<span className="flaticon-star" />
</div>
{/* BLOG POST IMAGE */}
<div className="col-lg-7 blog-post-img">
<img className="w-auto h-100" src={process.env.REACT_APP_IMAGE_LINK + this.props.blogData?.featured.meta_value} alt="blog-post-image" />
</div>
{/* BLOG POST TEXT */}
<div className="col-lg-5 blog-post-txt">
{/* Post Tag */}
<p className="p-2 post-tag">Float News</p>
{/* Post Link */}
<h5 className="h5-xl">
<a href="single-post.html">{this.props.blogData?.featured.post_title}</a>
</h5>
{/* Text */}
{/* <p className="p-md">Aliqum mullam blandit vitae and tempor sapien and donec lipsum gravida a porta
undo velna dolor in cubilia laoreet
</p> */}
<div className="p-2" dangerouslySetInnerHTML={{__html: this.props.blogData?.featured.post_content.substring(0,300)+' . . .'}}></div>
{/* Post Meta */}
<div className="post-meta">
<div className="post-author-avatar"><img src="assets/images/post-author-1.jpg" alt="author-avatar" /></div>
<p>12 min read</p>
</div>
</div> {/* END BLOG POST TEXT */}
</div> {/* End row */}
</div>
} {/* END FEATURED POST */}
{/* POSTS WRAPPER */} {/* POSTS WRAPPER */}
<div className="posts-wrapper"> <div className="posts-wrapper">
{/* BLOG POSTS CATEGORY */} {/* BLOG POSTS CATEGORY */}
+1 -1
View File
@@ -8,7 +8,7 @@ class SiteService {
} }
// Blog Data {Get} // Blog Data {Get}
blogData() { blogData() {
return this.getAuxEnd("/blogdata/10", null); return this.getAuxEnd("/blogdata", null);
} }
// Country Data {GET} // Country Data {GET}