From 477f47ef80d194ecaf3f9fc6c5e661d0f51ca4fd Mon Sep 17 00:00:00 2001 From: victorAnumudu Date: Mon, 10 Apr 2023 21:47:08 +0100 Subject: [PATCH] image and featured blog implemented --- .env | 1 + public/assets/css/style.css | 4 +-- src/App.js | 4 +-- src/components/BlogItems.js | 19 ++++++---- src/pages/Blog_listing.js | 72 +++++++++++++++++++++---------------- src/svs/SiteService.js | 2 +- 6 files changed, 59 insertions(+), 43 deletions(-) diff --git a/.env b/.env index 8599fdd..f29de0a 100644 --- a/.env +++ b/.env @@ -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_IMAGE_LINK='https://blog.float.sg/wp-content/uploads/' diff --git a/public/assets/css/style.css b/public/assets/css/style.css index dc1a00a..5afc1b1 100644 --- a/public/assets/css/style.css +++ b/public/assets/css/style.css @@ -4714,8 +4714,8 @@ h5.posts-category { .featured-badge { z-index: 70; position: absolute; - top: 20px; - right: 20px; + top: 10px; + right: 10px; width: 45px; height: 45px; -webkit-border-radius: 100%; diff --git a/src/App.js b/src/App.js index 62f40f0..1aa3b1b 100644 --- a/src/App.js +++ b/src/App.js @@ -39,12 +39,12 @@ function App() { try { const res = await siteApi.blogData(); if(res.status == 200 /* && res.data.status > 0*/){ - console.log(res.data.payload, res.data); + console.log(res.data); setBlogData(res.data) return } }catch(error) { - setBlogData({payload: {blogdata: []}}) + setBlogData({blogdata: []}) } }; diff --git a/src/components/BlogItems.js b/src/components/BlogItems.js index 4699e3c..c5ea798 100644 --- a/src/components/BlogItems.js +++ b/src/components/BlogItems.js @@ -27,23 +27,27 @@ const BlogItems = ({blogData}) => { return (
{ - blogData?.payload == undefined ? // API CALL IN PROGRESS -
Loading...
+ blogData?.blogdata == undefined ? // API CALL IN PROGRESS + //
Loading...
+
+
+
+
: // API CALL FINISHED ( - blogData?.payload?.blogdata.length < 1 ? + blogData?.blogdata.length < 1 ?
No Blog Currently Found!
: - blogData?.payload?.blogdata.map((blog, index) => { + blogData?.blogdata.map((blog, index) => { if(location == '/blogs'){ return(
{/* BLOG POST IMAGE */}
- blog-post-image - {/* blog-post-image */} + {/* blog-post-image */} + blog-post-image
{/* BLOG POST TEXT */}
@@ -73,7 +77,8 @@ const BlogItems = ({blogData}) => {
{/* BLOG POST IMAGE */}
- blog-post-image + {/* blog-post-image */} + blog-post-image
{/* BLOG POST TEXT */}
diff --git a/src/pages/Blog_listing.js b/src/pages/Blog_listing.js index 3d84133..1ac6e6f 100644 --- a/src/pages/Blog_listing.js +++ b/src/pages/Blog_listing.js @@ -12,8 +12,8 @@ class Blog_listing extends React.Component { console.log("OLU-AMEY BLOG LISTING ",props.blogData); } - - render() { + + render() { // const [blogData, setBlogData] = useState([]) // for holding //const siteApi = new SiteService(); // instantiating the API SERVICE @@ -53,35 +53,45 @@ class Blog_listing extends React.Component {
{/* FEATURED POST */} -
-
-
- -
- {/* BLOG POST IMAGE */} -
- blog-post-image -
- {/* BLOG POST TEXT */} -
- {/* Post Tag */} -

NordEx News

- {/* Post Link */} -
- Tempor sapien donec gravida a suscipit and porta justo vitae -
- {/* Text */} -

Aliqum mullam blandit vitae and tempor sapien and donec lipsum gravida a porta - undo velna dolor in cubilia laoreet -

- {/* Post Meta */} -
-
author-avatar
-

12 min read

-
-
{/* END BLOG POST TEXT */} -
{/* End row */} -
{/* END FEATURED POST */} + { + this.props.blogData?.featured == undefined ? // API CALL IN PROGRESS +
+
+
+
+ : +
+
+
+ +
+ {/* BLOG POST IMAGE */} +
+ blog-post-image +
+ {/* BLOG POST TEXT */} +
+ {/* Post Tag */} +

Float News

+ {/* Post Link */} +
+ {this.props.blogData?.featured.post_title} +
+ {/* Text */} + {/*

Aliqum mullam blandit vitae and tempor sapien and donec lipsum gravida a porta + undo velna dolor in cubilia laoreet +

*/} +
+ {/* Post Meta */} +
+
author-avatar
+

12 min read

+
+
{/* END BLOG POST TEXT */} +
{/* End row */} +
+ } {/* END FEATURED POST */} + {/* POSTS WRAPPER */}
{/* BLOG POSTS CATEGORY */} diff --git a/src/svs/SiteService.js b/src/svs/SiteService.js index 96888a1..188d259 100644 --- a/src/svs/SiteService.js +++ b/src/svs/SiteService.js @@ -8,7 +8,7 @@ class SiteService { } // Blog Data {Get} blogData() { - return this.getAuxEnd("/blogdata/10", null); + return this.getAuxEnd("/blogdata", null); } // Country Data {GET} -- 2.34.1