changed history page tab style

This commit was merged in pull request #703.
This commit is contained in:
victorAnumudu
2024-04-08 14:51:14 +01:00
parent e5fa6544a5
commit 60ed9e7bcf
5 changed files with 60 additions and 19 deletions
+5 -5
View File
@@ -1,4 +1,4 @@
import React, {useEffect, useState} from 'react'
import React, {memo, useCallback, useEffect, useState} from 'react'
import Image from '../../assets/images/taskbanners/default.jpg'
import usersService from '../../services/UsersService';
@@ -9,8 +9,8 @@ import LoadingSpinner from '../Spinners/LoadingSpinner';
import { AmountTo2DP } from '../Helpers/PriceFormatter';
function RewardsTable() {
export const RewardsTable = memo(() => {
const apiCall = new usersService()
let [familyRewardHistory, setFamilyRewardHistory] = useState({ // FOR PURCHASE HISTORY
@@ -30,7 +30,7 @@ function RewardsTable() {
//FUNCTION TO GET FAMILY REWARD HISTORY
const getFamilyRewardHistory = ()=>{
const getFamilyRewardHistory = useCallback(()=>{
apiCall.getFamilyRewardHx().then((res)=>{
if(res.data.internal_return < 0){ // success but no data
setFamilyRewardHistory(prev => ({...prev, loading: false}))
@@ -40,7 +40,7 @@ function RewardsTable() {
}).catch((error)=>{
setFamilyRewardHistory(prev => ({...prev, loading: false, error: true}))
})
}
},[])
useEffect(()=>{
getFamilyRewardHistory()
@@ -99,5 +99,5 @@ function RewardsTable() {
</div>
)
}
)
export default RewardsTable