Fixed the prop drill
This commit was merged in pull request #286.
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
import React, { useState } from "react";
|
||||
import RecentActivityTable from "./WalletComponent/RecentActivityTable";
|
||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||
import { useNavigate, useLocation } from "react-router-dom";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import InputCom from "../Helpers/Inputs/InputCom";
|
||||
|
||||
import AddFundDollars from "./AddFundDollars";
|
||||
|
||||
function AddFund({ payment }) {
|
||||
function AddFund({ paymentHistory, currency }) {
|
||||
const navigate = useNavigate();
|
||||
const { currency } = useLocation()?.state; //GETS THE USER CURRENCY FOR ADD FUND
|
||||
// const { currency } = useLocation()?.state; //GETS THE USER CURRENCY FOR ADD FUND
|
||||
|
||||
//STATE FOR CONTROLLED INPUT
|
||||
let [input, setInput] = useState("");
|
||||
@@ -42,6 +42,8 @@ function AddFund({ payment }) {
|
||||
|
||||
setInput("");
|
||||
};
|
||||
console.log("walletItem >>", paymentHistory);
|
||||
|
||||
return (
|
||||
<div>
|
||||
{/* heading */}
|
||||
@@ -134,13 +136,15 @@ function AddFund({ payment }) {
|
||||
<div className="lg:w-2/2 w-full mb-10 lg:mb-0">
|
||||
<div className="wallet w-full md:p-8 p-4 h-full min-h-[590px] bg-white dark:bg-dark-white rounded-2xl shadow">
|
||||
<h2 className="text-gray-900 dark:text-white text-xl lg:text-2xl font-medium">
|
||||
Recent Activity
|
||||
{/* Recent Activity */}Working in Progress
|
||||
</h2>
|
||||
<p>This popup has taking time because of the prop drilling. I have got it right now</p>
|
||||
{/* <p className='text-base text-gray-600 dark:text-white'>Activity Report</p> */}
|
||||
{payment.loading ? (
|
||||
{paymentHistory?.loading ? (
|
||||
<LoadingSpinner size="16" color="sky-blue" />
|
||||
) : (
|
||||
<RecentActivityTable payment={payment} />
|
||||
// <RecentActivityTable payment={paymentHistory} />
|
||||
""
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
@@ -150,4 +154,4 @@ function AddFund({ payment }) {
|
||||
);
|
||||
}
|
||||
|
||||
export default AddFund;
|
||||
export default AddFund;
|
||||
|
||||
Reference in New Issue
Block a user