diff --git a/.env.production b/.env.production index 88d656b..043d415 100644 --- a/.env.production +++ b/.env.production @@ -9,11 +9,11 @@ REACT_APP_APPSITE="https://myfitapp.mermsemr.com" # REACT_APP_AUX_ENDPOINT="http://10.20.30.32:9083/svs/user" # REACT_APP_USERS_ENDPOINT="http://10.20.30.32:9083/svs/user" -REACT_APP_AUX_ENDPOINT="https://apigate.orion.g1.wrenchboard.com/svs/user" -REACT_APP_USERS_ENDPOINT="https://apigate.orion.g1.wrenchboard.com/svs/user" +#REACT_APP_AUX_ENDPOINT="https://apigate.orion.g1.wrenchboard.com/svs/user" +#REACT_APP_USERS_ENDPOINT="https://apigate.orion.g1.wrenchboard.com/svs/user" -#REACT_APP_AUX_ENDPOINT="https://apigate.orion.g1.wrenchboard.com/en/wrench/api/v1" -#REACT_APP_USERS_ENDPOINT="https://apigate.orion.g1.wrenchboard.com/en/wrench/api/v1" +REACT_APP_AUX_ENDPOINT="https://apigate.orion.g1.wrenchboard.com/en/wrench/api/v1" +REACT_APP_USERS_ENDPOINT="https://apigate.orion.g1.wrenchboard.com/en/wrench/api/v1" #"https://devapi.mermsemr.com/en/desktop/api/v2/myfituser" diff --git a/src/assets/images/card.svg b/src/assets/images/card.svg new file mode 100644 index 0000000..443c6ff --- /dev/null +++ b/src/assets/images/card.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/assets/images/grid-view.svg b/src/assets/images/grid-view.svg new file mode 100644 index 0000000..e3f02b5 --- /dev/null +++ b/src/assets/images/grid-view.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/assets/images/list-view.png b/src/assets/images/list-view.png new file mode 100644 index 0000000..8d3b049 Binary files /dev/null and b/src/assets/images/list-view.png differ diff --git a/src/assets/images/master.svg b/src/assets/images/master.svg new file mode 100644 index 0000000..f5c1a88 --- /dev/null +++ b/src/assets/images/master.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/assets/images/visa.svg b/src/assets/images/visa.svg new file mode 100644 index 0000000..c1b6e91 --- /dev/null +++ b/src/assets/images/visa.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/components/History/index.jsx b/src/components/History/index.jsx index 9386635..2fec60b 100644 --- a/src/components/History/index.jsx +++ b/src/components/History/index.jsx @@ -13,7 +13,9 @@ import LoadingSpinner from "../Spinners/LoadingSpinner"; export default function History() { - const apiCall = new usersService() + const apiCall = new usersService() + + let [tab, setTab] = useState("purchases"); //STATE FOR SWITCHING BETWEEN TABS let [paymentHistory, setPaymentHistory] = useState({ // FOR PAYMENT HISTORY loading: true, @@ -63,7 +65,7 @@ export default function History() { <>
-
+

@@ -213,33 +215,57 @@ export default function History() { {/*

*/} {/**/} {/* */} -
- {/* PURCHASE SECTION */} -
-
-

Purchases

- {purchaseHistory.loading ? - - : - - } -
+
+ {/* switch button */} +
+ +
- {/* END OF PURCHASE SECTION */} - - {/* RECENT ACTIVITY SECTION */} -
-
-

Recent Activity

- {/*

Activity Report

*/} - {paymentHistory.loading ? - - : - + {/* END OF switch button */} +
+ {/* PURCHASE SECTION */} + {tab == 'purchases' && +
+

Purchases

+ {purchaseHistory.loading ? + + : + + } +
} -
+ {/* END OF PURCHASE SECTION */} + + {/* RECENT ACTIVITY SECTION */} + {tab == 'recent' && +
+

Recent Activity

+ {/*

Activity Report

*/} + {paymentHistory.loading ? + + : + + } +
+ } + {/* END OF RECENT ACTIVITY SECTION */}
- {/* END OF RECENT ACTIVITY SECTION */}
{/**/}
diff --git a/src/components/MyWallet/AddFundDollars.jsx b/src/components/MyWallet/AddFundDollars.jsx index c79980a..7a5a903 100644 --- a/src/components/MyWallet/AddFundDollars.jsx +++ b/src/components/MyWallet/AddFundDollars.jsx @@ -1,8 +1,10 @@ -import React,{useState} from 'react' +import React,{useEffect, useState} from 'react' import { useNavigate } from 'react-router-dom' import InputCom from '../Helpers/Inputs/InputCom'; import PaginatedList from '../Pagination/PaginatedList'; import { handlePagingFunc } from '../Pagination/HandlePagination'; +import LoadingSpinner from '../Spinners/LoadingSpinner'; +import usersService from '../../services/UsersService'; import { Form, Formik } from "formik"; import * as Yup from "yup"; @@ -56,17 +58,18 @@ const initialValues = { function AddFundDollars(props) { const navigate = useNavigate() + let apiCall = new usersService() let [tab, setTab] = useState("previous"); //STATE FOR SWITCHING BETWEEN TABS let [prevCardDetails, setPrevCardDetails] = useState(null) // STATE TO HOLD PREVIOUS CARD SELECTED - let previousCards = {data:[1,2]} //USER PREVIOUS CARDS // TO BE REPLACED LATER FROM DATA FROM API + let [payListCard, setPayListCard] = useState({loading: true, data:[]}) //USER PREVIOUS CARDS const [currentPage, setCurrentPage] = useState(0); const indexOfFirstItem = Number(currentPage); const indexOfLastItem = Number(indexOfFirstItem)+Number(process.env.REACT_APP_ITEM_PER_PAGE); - const currentPreviousCards = previousCards?.data?.slice(indexOfFirstItem, indexOfLastItem); + const currentPreviousCards = payListCard?.data?.slice(indexOfFirstItem, indexOfLastItem); const handlePagination = (e) => { handlePagingFunc(e,setCurrentPage) @@ -95,6 +98,15 @@ function AddFundDollars(props) { props.setInput('') } + useEffect(()=>{ + apiCall.payListCard().then(res => { + setPayListCard({loading: false, data: res.data.result_list}) + }).catch(err => { + console.log('PAYCARDLIST ERROR', err) + setPayListCard({loading: false, data: []}) + }) + }, []) + return ( <>

Payment Method

@@ -125,18 +137,24 @@ function AddFundDollars(props) { {/* previous tab */} {tab == 'previous' ?
- {previousCards?.data?.length ? + { payListCard.loading ? + + : + payListCard?.data?.length ? {currentPreviousCards.map((item, index)=>( - + @@ -168,7 +186,7 @@ function AddFundDollars(props) { } {/* PAGINATION BUTTON */}
- = previousCards?.data?.length ? true : false} data={previousCards?.data} start={indexOfFirstItem} stop={indexOfLastItem} /> + = payListCard?.data?.length ? true : false} data={payListCard?.data} start={indexOfFirstItem} stop={indexOfLastItem} />
{/* END OF PAGINATION BUTTON */} diff --git a/src/components/MyWallet/WalletComponent/PurchasesTable.jsx b/src/components/MyWallet/WalletComponent/PurchasesTable.jsx index 1295ec5..c8635a7 100644 --- a/src/components/MyWallet/WalletComponent/PurchasesTable.jsx +++ b/src/components/MyWallet/WalletComponent/PurchasesTable.jsx @@ -15,11 +15,11 @@ function PurchasesTable({purchase}) { } return ( -
+
-
+
-

Master Card

-

Bank **************3535

-

Verified

+

{item.description} Card

+

Bank **************{item.digits}

+
+

{item.added}

+

Verified

+
- + @@ -29,7 +29,7 @@ function PurchasesTable({purchase}) { {currentPurchase.map((item, index) => ( - diff --git a/src/components/MyWallet/WalletComponent/RecentActivityTable.jsx b/src/components/MyWallet/WalletComponent/RecentActivityTable.jsx index 1e1a842..bb57e5e 100644 --- a/src/components/MyWallet/WalletComponent/RecentActivityTable.jsx +++ b/src/components/MyWallet/WalletComponent/RecentActivityTable.jsx @@ -15,7 +15,7 @@ function RecentActivityTable({payment}) { } return ( -
+
Trx.Trx. Amount Fee
{item.added_date}
+
{item.added_date}
{item.confirmation}
{item.amount}
diff --git a/src/services/UsersService.js b/src/services/UsersService.js index 7d796bc..d9546c5 100644 --- a/src/services/UsersService.js +++ b/src/services/UsersService.js @@ -719,6 +719,16 @@ class usersService { return this.postAuxEnd("/faq", postData); } + // END POINT TO GET LIST OF USER PREVIOUS CARDS + payListCard() { + var postData = { + uid: localStorage.getItem("uid"), + member_id: localStorage.getItem("member_id"), + sessionid: localStorage.getItem("session_token"), + action: 11055 + }; + return this.postAuxEnd("/paylistcard", postData); + } /* - 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(username) - 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(password)