generic tracking oage

This commit is contained in:
2023-02-18 16:58:50 -05:00
parent 30e960a3d8
commit e3680cb77d
6 changed files with 294 additions and 1245 deletions
@@ -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 (
<div className="currency-statics w-full mb-11">
@@ -10,19 +38,124 @@ export default function UserRecentTracking() {
<div className="content sm:flex justify-between items-center mb-5">
<div>
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-wide">
Recent Records
Recent Records
</h1>
</div>
</div>
<div className="currency-statics-chart">
SOME TABLE HERE
</div>
</div>
<div className="relative w-full overflow-x-auto sm:rounded-lg">
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400">
<tbody>
<tr className="text-base text-thin-light-gray whitespace-nowrap border-b dark:border-[#5356fb29] default-border-b dark:border-[#5356fb29] ottom ">
<td className="py-4">All Tracking</td>
<td className="py-4 text-center">Value</td>
<td className="py-4 text-center">Bits</td>
<td className="py-4 text-center">Time</td>
<td className="py-4 text-right">Status</td>
</tr>
{userTrackingHx[0]?.data?.length > 0
? userTrackingHx[0].data.map((track, index) => (
<tr className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50">
<td className=" py-4">
<div className="flex space-x-2 items-center">
<div className="w-[60px] h-[60px] rounded-full overflow-hidden flex justify-center items-center">
<img
src={dataImage2}
alt="data"
className="w-full h-full"
/>
</div>
<div className="flex flex-col">
<h1 className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
{track.code}
</h1>
<span className="text-sm text-thin-light-gray">
Added{" "}
<span className="text-purple"> {track.added}</span>
</span>
</div>
</div>
</td>
<td className="text-center py-4 px-2">
<div className="flex space-x-1 items-center justify-center">
<span>
<svg
width="18"
height="18"
viewBox="0 0 18 18"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M9 18C13.9706 18 18 13.9706 18 9C18 4.02944 13.9706 0 9 0C4.02944 0 0 4.02944 0 9C0 13.9706 4.02944 18 9 18Z"
fill="#627EEA"
/>
<path
d="M9.28125 2.25V7.23937L13.4983 9.12375L9.28125 2.25Z"
fill="white"
fillOpacity="0.602"
/>
<path
d="M9.28012 2.25L5.0625 9.12375L9.28012 7.23937V2.25Z"
fill="white"
/>
<path
d="M9.28125 12.3582V15.7483L13.5011 9.91016L9.28125 12.3582Z"
fill="white"
fillOpacity="0.602"
/>
<path
d="M9.28012 15.7483V12.3576L5.0625 9.91016L9.28012 15.7483Z"
fill="white"
/>
<path
d="M9.28125 11.572L13.4983 9.12348L9.28125 7.24023V11.572Z"
fill="white"
fillOpacity="0.2"
/>
<path
d="M5.0625 9.12348L9.28012 11.572V7.24023L5.0625 9.12348Z"
fill="white"
fillOpacity="0.602"
/>
</svg>
</span>
<span className="text-base text-dark-gray dark:text-white font-medium whitespace-nowrap">
{track.val1} {track.munit}
</span>
</div>
</td>
<td className="text-right py-4 px-2">
<span className="text-base text-dark-gray dark:text-white font-medium whitespace-nowrap">
.
</span>
</td>
<td className="text-right py-4 px-2">
<span className="text-base text-thin-light-gray whitespace-nowrap">
{track.event_time}
</span>
</td>
<td className="text-right py-4 px-2">
<button
type="button"
className="text-sm text-white bg-light-green px-2.5 py-1.5 rounded-full"
>
View
</button>
</td>
</tr>
))
: null}
</tbody>
</table>
</div>
</div>
</div>
</div>
);
}
@@ -13,8 +13,7 @@ export default function UserWeightWidget() {
background: `url(${background}) 0% 0% / cover no-repeat`,
}}
>
<div className="wallet flex justify-between">
<div className="wallet flex justify-between">
<div className="w-[100px] h-[100px] rounded-full bg-[#485199] flex justify-center items-center">
<div>
<p className="text-26 font-bold text-white tracking-wide text-center">
@@ -27,76 +26,67 @@ export default function UserWeightWidget() {
</div>
<div>
<p className="text-26 font-bold tracking-wide text-white text-right">
Weight Entry
Weight Entry
</p>
</div>
</div>
<div className="balance">
<div className="input-fl-name mb-5 sm:flex w-full sm:space-x-6 ">
<div className="input-item sm:w-1/2 w-full mb-5 sm:mb-0">
<InputCom
placeholder=""
label=""
name="first_name"
type="text"
iconName="people"
/>
</div>
<div className="input-item flex-1">
<InputCom
placeholder=""
label=""
name="Last_name"
type="text"
iconName="people"
/>
</div>
</div>
<div className="input-fl-name mb-5 sm:flex w-full sm:space-x-6 ">
<div className="input-item sm:w-1/2 w-full mb-5 sm:mb-0">
<InputCom
placeholder=""
label=""
name="first_name"
type="text"
iconName="people"
/>
</div>
<div className="input-item flex-1">
<InputCom
placeholder=""
label=""
name="Last_name"
type="text"
iconName="people"
/>
</div>
</div>
<div className="input-fl-name mb-5 sm:flex w-full sm:space-x-6 ">
<div className="input-item sm:w-1/2 w-full mb-5 sm:mb-0">
<InputCom
placeholder=""
label=""
name="first_name"
type="text"
iconName="people"
/>
</div>
<div className="input-item flex-1">
<InputCom
placeholder=""
label=""
name="Last_name"
type="text"
iconName="people"
/>
</div>
</div>
<div className="input-fl-name mb-5 sm:flex w-full sm:space-x-6 ">
<div className="input-item sm:w-1/2 w-full mb-5 sm:mb-0">
<InputCom
placeholder=""
label=""
name="first_name"
type="text"
iconName="people"
/>
</div>
<div className="input-item flex-1">
<InputCom
placeholder=""
label=""
name="Last_name"
type="text"
iconName="people"
/>
</div>
</div>
<p className="text-[44px] font-bold text-white tracking-wide leading-10 mb-2">
<div className="input-fl-name mb-5 sm:flex w-full sm:space-x-6 ">
<div className="input-item sm:w-1/2 w-full mb-5 sm:mb-0">
</div>
<div className="input-item flex-1">
<button
type="button"
className="btn-login rounded-[50px] mb-6 text-xl text-white font-bold flex justify-center bg-purple items-center "><span>Add</span>
</button>
</div>
</div>
<div className="input-fl-name mb-5 sm:flex w-full sm:space-x-6 ">
<div className="input-item sm:w-1/2 w-full mb-5 sm:mb-0"></div>
<div className="input-item flex-1">
<button
type="button"
className="btn-login rounded-[50px] mb-6 text-xl text-white font-bold flex justify-center bg-purple items-center "
>
<span>Add</span>
</button>
</div>
</div>
</p>
</div>
</div>
);
}
+5 -10
View File
@@ -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() {
<div className="my-wallets w-full h-full bg-white dark:bg-dark-white rounded-lg p-6">
<div className="mb-4">
<h1 className="text-xl font-bold tracking-wide text-dark-gray dark:text-white">
Some title HERE
Some title HERE
</h1>
</div>
<div className="content-area">
SOMETHING HERE
</div>
<div className="content-area">SOMETHING HERE</div>
</div>
</div>
</div>
File diff suppressed because it is too large Load Diff
-4
View File
@@ -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();
+1 -1
View File
@@ -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);
}