diff --git a/src/components/Tracking/TrackAction/UserRecentTracking.jsx b/src/components/Tracking/TrackAction/UserRecentTracking.jsx index f0b2e0b..356f25e 100644 --- a/src/components/Tracking/TrackAction/UserRecentTracking.jsx +++ b/src/components/Tracking/TrackAction/UserRecentTracking.jsx @@ -1,7 +1,35 @@ -import React, { useState } from "react"; +import React, { useEffect, useState } from "react"; +import usersService from "../../../services/UsersService"; +import dataImage1 from "../../../assets/images/data-table-user-1.png"; +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 UserRecentTracking() { + 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(); + }, []); + return (
@@ -10,19 +38,124 @@ export default function UserRecentTracking() {

- Recent Records + Recent Records

-
-
- - SOME TABLE HERE -
-
- - + +
+ + + + + + + + + + {userTrackingHx[0]?.data?.length > 0 + ? userTrackingHx[0].data.map((track, index) => ( + + + + + + + + )) + : null} + +
All TrackingValueBitsTimeStatus
+
+
+ data +
+
+

+ {track.code} +

+ + Added{" "} + {track.added} + +
+
+
+
+ + + + + + + + + + + + + {track.val1} {track.munit} + +
+
+ + . + + + + {track.event_time} + + + +
+ + + + + + + ); } diff --git a/src/components/Tracking/TrackAction/UserWeightWidget.jsx b/src/components/Tracking/TrackAction/UserWeightWidget.jsx index 4e706b7..7411bb6 100644 --- a/src/components/Tracking/TrackAction/UserWeightWidget.jsx +++ b/src/components/Tracking/TrackAction/UserWeightWidget.jsx @@ -13,8 +13,7 @@ export default function UserWeightWidget() { background: `url(${background}) 0% 0% / cover no-repeat`, }} > - -
+

@@ -27,76 +26,67 @@ export default function UserWeightWidget() {

- Weight Entry + Weight Entry

- -
-
- -
-
- -
-
-
- -
- -
-
- -
-
- - +
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+

-

- -
- -
-
- -
-
- - +
+
+
+ +
+

-
); } diff --git a/src/components/Tracking/TrackAction/index.jsx b/src/components/Tracking/TrackAction/index.jsx index 32fa655..0a1bc38 100644 --- a/src/components/Tracking/TrackAction/index.jsx +++ b/src/components/Tracking/TrackAction/index.jsx @@ -1,15 +1,14 @@ import React from "react"; -import { useParams } from 'react-router-dom' +import { useParams } from "react-router-dom"; import Layout from "../../Partials/Layout"; import UserWeightWidget from "./UserWeightWidget"; import UserRecentTracking from "./UserRecentTracking"; export default function TrackAction() { - - let {trackpage} = useParams(); + let { trackpage } = useParams(); - console.log("TRACK PAGE = = ",trackpage); + console.log("TRACK PAGE = = ", trackpage); return ( <> @@ -24,14 +23,10 @@ export default function TrackAction() {

- Some title HERE + Some title HERE

-
- - SOMETHING HERE - -
+
SOMETHING HERE
diff --git a/src/components/Tracking/TrackingTable.jsx b/src/components/Tracking/TrackingTable.jsx index 97885e0..98f712f 100755 --- a/src/components/Tracking/TrackingTable.jsx +++ b/src/components/Tracking/TrackingTable.jsx @@ -5,13 +5,13 @@ 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"; //userTrackingHx -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); + // debugger; + console.log("-----~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-------"); + console.log(userTrackingHx); + //console.log(userTrackingHx[0].data); return (
- All Product + All Tracking Value - USD - 24H% Bits Time Status - { - - (userTrackingHx[0]?.data?.length > 0) ?( - userTrackingHx[0].data.map((track, index) => ( - - + {userTrackingHx[0]?.data?.length > 0 + ? userTrackingHx[0].data.map((track, index) => ( - -
-
- data + +
+
+ data +
+
+

+ {track.code} +

+ + Added{" "} + {track.added} + +
-
-

- Mullican Computer Joy -

- - Owned by Xoeyam + + +
+ + + + + + + + + + + + + {track.val1} {track.munit}
-
- - -
- - - - - - - - - - - + + - 7473 ETH + . -
- - -
- - - - - - - + + + + {track.event_time} - - 6392.99$ - -
- - - - -24.75 (11.5%) - - - - - 343 - - - - - 2 Hours 1 min 30s - - - - - - - - - ) ) - ):null - - } - {selectedCategory === "All Categories" ? ( - <> - - -
-
- data -
-
-

- Mullican Computer Joy -

- - Owned by Xoeyam - -
-
- - -
- - - - - - - - - - - - - 7473 ETH - -
- - -
- - - - - - - - - - 6392.99$ - -
- - - - -24.75 (11.5%) - - - - - 343 - - - - - 2 Hours 1 min 30s - - - - - - - - -
-
- data -
-
-

- Mullican Computer Joy -

- - Owned by Xoeyam - -
-
- - -
- - - - - - - - - - - - - 7473 ETH - -
- - -
- - - - - - - - - - 6392.99$ - -
- - - - -24.75 (11.5%) - - - - - 343 - - - - - 2 Hours 1 min 30s - - - - - - - - -
-
- data -
-
-

- Mullican Computer Joy -

- - Owned by Xoeyam - -
-
- - -
- - - - - - - - - - - - - 7473 ETH - -
- - -
- - - - - - - - - - 6392.99$ - -
- - - - -24.75 (11.5%) - - - - - 343 - - - - - 2 Hours 1 min 30s - - - - - - - - -
-
- data -
-
-

- Mullican Computer Joy -

- - Owned by Xoeyam - -
-
- - -
- - - - - - - - - - - - - 7473 ETH - -
- - -
- - - - - - - - - - 6392.99$ - -
- - - - -24.75 (11.5%) - - - - - 343 - - - - - 2 Hours 1 min 30s - - - - - - - - ) : selectedCategory === "Explore" ? ( - <> - - -
-
- data -
-
-

- Mullican Computer Joy -

- - Owned by Xoeyam - -
-
- - -
- - - - - - - - - - - - - 7473 ETH - -
- - -
- - - - - - - - - - 6392.99$ - -
- - - - -24.75 (11.5%) - - - - - 343 - - - - - 2 Hours 1 min 30s - - - - - - - - -
-
- data -
-
-

- Mullican Computer Joy -

- - Owned by Xoeyam - -
-
- - -
- - - - - - - - - - - - - 7473 ETH - -
- - -
- - - - - - - - - - 6392.99$ - -
- - - - -24.75 (11.5%) - - - - - 343 - - - - - 2 Hours 1 min 30s - - - - - - - - ) : ( - <> - - -
-
- data -
-
-

- Mullican Computer Joy -

- - Owned by Xoeyam - -
-
- - -
- - - - - - - - - - - - - 7473 ETH - -
- - -
- - - - - - - - - - 6392.99$ - -
- - - - -24.75 (11.5%) - - - - - 343 - - - - - 2 Hours 1 min 30s - - - - - - - - -
-
- data -
-
-

- Mullican Computer Joy -

- - Owned by Xoeyam - -
-
- - -
- - - - - - - - - - - - - 7473 ETH - -
- - -
- - - - - - - - - - 6392.99$ - -
- - - - -24.75 (11.5%) - - - - - 343 - - - - - 2 Hours 1 min 30s - - - - - - - - )} + + + + + + )) + : null}
diff --git a/src/components/Tracking/index.jsx b/src/components/Tracking/index.jsx index e4d45f9..314dc24 100755 --- a/src/components/Tracking/index.jsx +++ b/src/components/Tracking/index.jsx @@ -15,11 +15,7 @@ export default function Tracking(props) { const api = new usersService(); const [isLoading, setIsLoading] = useState(true) - - const [userTrackingHx, setUserTrackingHx] = useState([]); - - const getUserTrackingHx = async () => { try { const res = await api.getUserTrackingHistory(); diff --git a/src/services/UsersService.js b/src/services/UsersService.js index 7ece919..102acd7 100644 --- a/src/services/UsersService.js +++ b/src/services/UsersService.js @@ -31,7 +31,7 @@ class usersService { getUserTrackingHistory(){ var reqData = { member_id: localStorage.getItem("member_id"), - guid: localStorage.getItem("guid") + member_uuid: localStorage.getItem("member_uuid") }; return this.getAuxEnd("/trackinghx", reqData); }