From 30e960a3d863a5ce06860da1fc6dfa16e54d99b4 Mon Sep 17 00:00:00 2001 From: "DESKTOP-BC3NEC6\\chiefsoft" Date: Sat, 18 Feb 2023 12:05:33 -0500 Subject: [PATCH] tracjk hx --- .env | 2 +- src/components/Tracking/TrackingTable.jsx | 146 +++++++++++++++++++++- src/components/Tracking/index.jsx | 37 +++++- src/services/UsersService.js | 7 ++ src/views/TrackActionPage.jsx | 1 - 5 files changed, 185 insertions(+), 8 deletions(-) diff --git a/.env b/.env index 9997c80..d89fd8c 100755 --- a/.env +++ b/.env @@ -11,7 +11,7 @@ REACT_APP_AUX_ENDPOINT = "https://devapi.mermsemr.com/en/desktop/api/v2/myfit" REACT_APP_USERS_ENDPOINT = "https://devapi.mermsemr.com/en/desktop/api/v2/myfituser" # REACT_APP_PASSWORD_ENDPOINT = "https://devapi.mermsemr.com/en/desktop/api/v2/myfituser/resetpass" -REACT_APP_SESSION_EXPIRE_MINUTES = 5 +REACT_APP_SESSION_EXPIRE_MINUTES = 15 REACT_APP_TRACKING="Tracking" REACT_APP_RESOURCES="Resources" \ No newline at end of file diff --git a/src/components/Tracking/TrackingTable.jsx b/src/components/Tracking/TrackingTable.jsx index 51b4225..97885e0 100755 --- a/src/components/Tracking/TrackingTable.jsx +++ b/src/components/Tracking/TrackingTable.jsx @@ -4,10 +4,15 @@ import dataImage2 from "../../assets/images/data-table-user-2.png"; import dataImage3 from "../../assets/images/data-table-user-3.png"; import dataImage4 from "../../assets/images/data-table-user-4.png"; import SelectBox from "../Helpers/SelectBox"; - -export default function TrackingTable({ className }) { +//userTrackingHx +export default function TrackingTable({ className, userTrackingHx}) { const filterCategories = ["All Categories", "Explore", "Featured"]; const [selectedCategory, setCategory] = useState(filterCategories[0]); + debugger; +console.log("-----~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-------"); +console.log(userTrackingHx); +//console.log(userTrackingHx[0].data); + return (
Time Status + { + + (userTrackingHx[0]?.data?.length > 0) ?( + userTrackingHx[0].data.map((track, index) => ( + + + + +
+
+ data +
+
+

+ Mullican Computer Joy +

+ + Owned by Xoeyam + +
+
+ + +
+ + + + + + + + + + + + + 7473 ETH + +
+ + +
+ + + + + + + + + + 6392.99$ + +
+ + + + -24.75 (11.5%) + + + + + 343 + + + + + 2 Hours 1 min 30s + + + + + + + + ) ) + ):null + + } {selectedCategory === "All Categories" ? ( <> diff --git a/src/components/Tracking/index.jsx b/src/components/Tracking/index.jsx index 8d4b323..e4d45f9 100755 --- a/src/components/Tracking/index.jsx +++ b/src/components/Tracking/index.jsx @@ -6,20 +6,49 @@ import TrackingTable from "./TrackingTable"; import MarketHistorySection from "./MarketHistorySection"; import TrackCategory from "./TrackCategory"; import datas from "../../data/product_data.json"; +import usersService from "../../services/UsersService"; + export default function Tracking(props) { console.log("IN TRACKING COMPO", props); - const trending = datas.datas; - console.log("IN TRACKING COMPO TRD", trending); - //debugger; + + const api = new usersService(); + const [isLoading, setIsLoading] = useState(true) + + + const [userTrackingHx, setUserTrackingHx] = useState([]); + + + const getUserTrackingHx = async () => { + try { + const res = await api.getUserTrackingHistory(); + if(res.status == 200){ + setUserTrackingHx([ + {data: res.data.tracking_data}, + ]); + setIsLoading(false) + return + } + setIsLoading(false) + }catch(error) { + setIsLoading(false) + } + }; + + useEffect(() => { + getUserTrackingHx(); + }, []); + + + console.log("IN TRACKING COMPO TRD", userTrackingHx); return ( <>
- +
diff --git a/src/services/UsersService.js b/src/services/UsersService.js index 97374b4..7ece919 100644 --- a/src/services/UsersService.js +++ b/src/services/UsersService.js @@ -28,6 +28,13 @@ class usersService { }; return this.getAuxEnd("/loginhx", reqData); } + getUserTrackingHistory(){ + var reqData = { + member_id: localStorage.getItem("member_id"), + guid: localStorage.getItem("guid") + }; + return this.getAuxEnd("/trackinghx", reqData); + } //END POINT TO POPULATE MODE AND CATEGORY ON ADD REMINDER PAGED getUserModeCategory(path){ diff --git a/src/views/TrackActionPage.jsx b/src/views/TrackActionPage.jsx index 4de6742..d5aac87 100644 --- a/src/views/TrackActionPage.jsx +++ b/src/views/TrackActionPage.jsx @@ -1,5 +1,4 @@ import React from "react"; -import MyWallet from "../components/MyWallet"; import TrackAction from "../components/Tracking/TrackAction"; export default function TrackActionPage() {