From 71b460e75c5cc15faf29a76d99e0794f894e6a02 Mon Sep 17 00:00:00 2001 From: dev-chiefworks Date: Wed, 9 Mar 2022 20:28:02 -0500 Subject: [PATCH] recent job fix --- src/Config/config.js | 1 + src/Services/JobsData.js | 152 +++------------------- src/assets/css/default.css | 3 + src/components/HomeOne/RecentJobsOne.js | 163 ++++++++++++++---------- 4 files changed, 112 insertions(+), 207 deletions(-) diff --git a/src/Config/config.js b/src/Config/config.js index 7ae4b6b..a3f1c78 100644 --- a/src/Config/config.js +++ b/src/Config/config.js @@ -16,6 +16,7 @@ function getConfig() { "support_phone": '404 855-7966', "support_us_address": 'Atlanta,GA 30339', "dummy": "2018-06-25T18:54:22.000Z", + "user_service_endpoint": "https://dashboard.wrenchboard.com/svs/user", } ]; diff --git a/src/Services/JobsData.js b/src/Services/JobsData.js index 8bee573..91ad4e5 100644 --- a/src/Services/JobsData.js +++ b/src/Services/JobsData.js @@ -1,146 +1,24 @@ -// http://172.31.4.19:8000/wordpress-data - -//import React from 'react'; import Axios from 'axios'; +import getConfig from './../Config/config' -function JobsData() { - - var callData =[ { +async function JobsData() { + var site = getConfig()[0]; + var callData = [{ "limit": 10, - "page":1 - } ]; - - console.log("~~~~~~~~ ameye jobData ~~~~~~~~~"); -var res = null; - const getWrenchBoardJobs = () => { - Axios.post("https://www.wrenchboard.com/svs/user/startjoblist",callData).then((response) => { - console.log(response); - res = response; - console.log("~~~~~~~~ jobData ~~~~~~~~~"); - return response; - // console.log(blogResultData); + "page": 1 + }]; +/* + var res = null; + const getWrenchBoardJobs = () => { + Axios.post("https://dashboard.wrenchboard.com/svs/user/startjoblist", callData).then((response) => { + res = response; + return response; }); } - - /* return ( - <> - Ameye - - ); */ -getWrenchBoardJobs(); - -//console.log(getWrenchBoardBlog()); - -//console.log("Ameye got here"); - // return blogResultData; // getWrenchBoardBlog(); - - var res1 =[ - { - "title": "Post 5 articles to social ", - "description": "This task is about posting 5 articles like from www.dorcastore.com to you Facebook page", - "id": "109", - "job_description": null, - "price": null, - "timeline_days": null, - "expire": "5th Jan 2022", - "sent": null - }, - { - "title": "Article", - "description": "Opinion (Nigeria economy/politics) for Publication", - "id": "108", - "job_description": null, - "price": null, - "timeline_days": null, - "expire": "5th Dec 2019", - "sent": null - }, - { - "title": "Create a family related article for my blog", - "description": "Propose a title and write about 500-word article for my blog", - "id": "23", - "job_description": null, - "price": null, - "timeline_days": null, - "expire": "14th Nov 2018", - "sent": null - }, - { - "title": "Promote my blog with your Facebook page", - "description": "You will need to have a Facebook page with at least 400 friends to for this task", - "id": "73", - "job_description": null, - "price": null, - "timeline_days": null, - "expire": "14th Nov 2018", - "sent": null - }, - { - "title": "Promote health care based articles", - "description": "Promote by placing my articles on your blog with good Alexa ranking ", - "id": "92", - "job_description": null, - "price": null, - "timeline_days": null, - "expire": "14th Nov 2018", - "sent": null - }, - { - "title": "Pictures of Product Display In Supermarket", - "description": "We are conducting a product research and I want to know the most common products in my line of business. Go to ten supermarkets around and take pictures of the wine sections clearly showing the wines", - "id": "103", - "job_description": null, - "price": null, - "timeline_days": null, - "expire": "9th Nov 2018", - "sent": null - }, - { - "title": "Write a Health Article for a blog", - "description": "Write a 1-page article on “The need for healthy eating in Nigeria”. The article is for publication on a health and wellness blog.", - "id": "101", - "job_description": null, - "price": null, - "timeline_days": null, - "expire": "9th Nov 2018", - "sent": null - }, - { - "title": "Who are Niger Delta's Warlords?", - "description": "Describe the situation that led to Niger Delta Amnesty Programme?", - "id": "105", - "job_description": null, - "price": null, - "timeline_days": null, - "expire": "31st Oct 2018", - "sent": null - }, - { - "title": "What is Niger Delta Ecology?", - "description": "Write article on Niger Delta Ecology", - "id": "104", - "job_description": null, - "price": null, - "timeline_days": null, - "expire": "28th Oct 2018", - "sent": null - }, - { - "title": "Promote health care based articles", - "description": "Promote by placing my articles on your blog with good Alexa ranking ", - "id": "92", - "job_description": null, - "price": null, - "timeline_days": null, - "expire": "25th Jul 2018", - "sent": null - } -]; - - - return res1; - } + let response = await Axios.post(site.user_service_endpoint + "/startjoblist", callData); + return response.data.result_list; +} export default JobsData; diff --git a/src/assets/css/default.css b/src/assets/css/default.css index e455ddc..4e0bf73 100644 --- a/src/assets/css/default.css +++ b/src/assets/css/default.css @@ -4,6 +4,9 @@ a { text-decoration: none; background-color: transparent; } +.expire{ + color:red; +} .mt-5 { margin-top: 5px; } diff --git a/src/components/HomeOne/RecentJobsOne.js b/src/components/HomeOne/RecentJobsOne.js index e1224be..0a6f8e3 100644 --- a/src/components/HomeOne/RecentJobsOne.js +++ b/src/components/HomeOne/RecentJobsOne.js @@ -1,88 +1,111 @@ -import React from 'react'; +import React, { Component } from 'react'; import blogOne from '../../assets/images/blog-1.jpg'; import blogTwo from '../../assets/images/blog-2.jpg'; import blogThree from '../../assets/images/blog-3.jpg'; import JobsData from '../../Services/JobsData'; -function RecentJobsOne() { - const jobsDataResults = JobsData(); -var dashUrl = "https://dashboard.wrenchboard.com/"; +class RecentJobsOne extends Component { - return ( - <> -
-
-
-
-
-

WrenchBoard Market

-
-
-
-
+ constructor() { + // debugger; + super(); + this.state = { jobsDataResults: [] }; + } - { - jobsDataResults.map(i=>{ +async componentDidMount(){ + debugger; + const response = await JobsData(); + this.setState({jobsDataResults:response}); +} - return (
-
- -
+ // if (jobsDataResults ()== null){ + // return null; + // } + render() { -

- - {i.title} - -

-
- -
- - Learn More - -
-
-
) + if ( this.state.jobsDataResults== undefined ){ + return null; + } + var dashUrl = "https://dashboard.wrenchboard.com/"; - - }) - } - - -
-
- -
- -

- - Find more oprotunities at our marketplace. - -

- - Login now - + return ( + <> +
+
+
+
+
+

WrenchBoard Market

+
+ { + this.state.jobsDataResults.map(i => { + var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }; + var postDt = new Date(i.expire).toLocaleDateString("en-US", options); + + return (
+ +
) + + + }) + } + + + + +
-
-
- - ); + + + ); + } } export default RecentJobsOne; \ No newline at end of file