diff --git a/src/component/contacts/Contacts.js b/src/component/contacts/Contacts.js index d896698..b920d46 100644 --- a/src/component/contacts/Contacts.js +++ b/src/component/contacts/Contacts.js @@ -47,7 +47,7 @@ export default function Contacts() { if (id == "0") { filteredConData = contactsData; } else { - filteredConData = contactsData.filter((item) => item.category == `A00000${id}`); + filteredConData = contactsData.filter((item) => item.category == id); } setFiltererdContactData(filteredConData); changeActiveUID(filteredConData[0]?.uid); @@ -87,7 +87,7 @@ export default function Contacts() {
@@ -197,20 +197,20 @@ export default function Contacts() {
-
-
-
+
0 ? 'col-md-8 col-xxl-4' : 'col-md-8 col-xxl-10'} border-md-t`}> +
+ {/*
- {/*
*/} - {/* */} - {/* */} - {/*
*/} +
+ + +
-
+
*/}
- {contactsData && + { filteredContactData.length ? filteredContactData?.map((contact, index) => { const isActive = contact?.uid == activeContactUID || @@ -282,16 +282,20 @@ export default function Contacts() {
); - })} + }) + : +

Messages will appear here as soon as they are available for selection

+ }
+ {filteredContactData.length > 0 &&
user @@ -333,6 +337,7 @@ export default function Contacts() {
+ }
diff --git a/src/component/home/DashPayments.jsx b/src/component/home/DashPayments.jsx new file mode 100644 index 0000000..fd29a52 --- /dev/null +++ b/src/component/home/DashPayments.jsx @@ -0,0 +1,91 @@ +import React from 'react' +import { getDashPayments } from '../../services/services' +import { useQuery } from '@tanstack/react-query' +import queryKeys from '../../services/queryKeys' +import getImage from '../../utils/getImage' + +export default function DashPayments() { + + + const {data, isFetching, isError, error} = useQuery({ + queryKey: queryKeys.dash_payments, + queryFn: () => { + let reqData = { + token: localStorage.getItem('token'), // USER TOKEN + uid: localStorage.getItem('uid') // USER UID + } + return getDashPayments(reqData) + } + }) + + const payments = data?.data + // console.log('data', payments) + + return ( + <> +
+
+
+
+

Payments

+
+
+
+
+ {isFetching ? + <> +
+
+

Loading...

+
+
+ + : isError ? +
+
+

{error.message}

+
+
+ : + + + + {/* */} + + + + + + + + {payments.length > 0 ? + payments.map((item, index) => { + return ( + + + + + + + + ) + }) + : + + } + +
#DateSubscriptionAmount
{Number(item?.id).toString().padStart(6,'0')} + {externalUrl} - {item?.description} + {statusText} + + next + +
No record found
+ } +
+
+
+
+ + ) +} diff --git a/src/component/home/HomeSections.jsx b/src/component/home/HomeSections.jsx index d7727e6..e65dc45 100644 --- a/src/component/home/HomeSections.jsx +++ b/src/component/home/HomeSections.jsx @@ -5,6 +5,7 @@ import Products from "./Products"; import TopBar from "./TopBar"; import ProductsURL from "./ProductsURL"; import { SocketContextValues } from "../context/SocketIOContext"; +import DashPayments from "./DashPayments"; export default function HomeSections(){ @@ -52,41 +53,7 @@ export default function HomeSections(){
-
-
-
-
-

Payments

-
- {/*
*/} - {/* */} - {/*
*/} - {/*
Action
*/} - {/* View*/} - {/* reports*/} - {/* Edit reports*/} - {/* Statistics*/} - {/*
Export
*/} - {/* Export*/} - {/* to PDF*/} - {/* Export*/} - {/* to CSV*/} - {/*
*/} - {/*
*/} -
-
- {/*
We only started collecting data from February 2019
*/} - {/*

Questions about the Net Earnings number? Click here

*/} -
- . -
-
-
-
+
; diff --git a/src/component/home/TopBar.jsx b/src/component/home/TopBar.jsx index ff0d851..f369ea5 100644 --- a/src/component/home/TopBar.jsx +++ b/src/component/home/TopBar.jsx @@ -64,28 +64,30 @@ export default function TopBar() { } return ( -
-
-
-
-
-
-
-

{item?.value || 0}

- {item?.extra_style ? dataSpan : item?.data_span} +
+ +
+
+
+
+
+
+

{item?.value || 0}

+ {item?.extra_style ? dataSpan : item?.data_span} +
+
+
{item?.description}
+
+
+
+
+
-
-
{item?.description}
-
-
-
-
-
+
-
) })} diff --git a/src/services/queryKeys.js b/src/services/queryKeys.js index 082d694..b4069af 100644 --- a/src/services/queryKeys.js +++ b/src/services/queryKeys.js @@ -1,6 +1,7 @@ const queryKeys = { user_details: ['user_details'], product_url: ['product_url'], + dash_payments: ['dash_payments'], products: ['product-data'], myproduct_provision: ['myproduct_provision'], product_page: ['product_page'], diff --git a/src/services/services.js b/src/services/services.js index d9cf8a5..12bd03f 100644 --- a/src/services/services.js +++ b/src/services/services.js @@ -114,6 +114,14 @@ export const productsURL = (reqData) => { return postAuxEnd(`/panel/account/products/url`, postData, false) } +// FUNCTION TO GET DASHBOARD PRODUCT URL DATA SECTION +export const getDashPayments = (reqData) => { + let postData = { + ...reqData, + } + return postAuxEnd(`/panel/account/payments`, postData, false) +} + // FUNCTION TO GET DASHBOARD PRODUCT DATA SECTION export const productsData = (reqData) => { let postData = {