made confirm withdrawal a pop up
This commit was merged in pull request #329.
This commit is contained in:
@@ -1,37 +1,40 @@
|
||||
import React, { useState } from 'react'
|
||||
import { Link } from 'react-router-dom';
|
||||
import NairaWithdraw from './Popup/NairaWithdraw';
|
||||
import ConfirmNairaWithdraw from './ConfirmNairaWithdraw';
|
||||
import React, { useState } from "react";
|
||||
import ConfirmNairaWithdraw from "./Popup/ConfirmNairaWithdraw";
|
||||
import NairaWithdraw from "./Popup/NairaWithdraw";
|
||||
|
||||
function WalletAction({walletItem, payment, openPopUp}) {
|
||||
const [showNairaWithdraw, setShowNairaWithdraw] = useState(false) // DETERMINES WHEN NAIRA WITHDRAWAL POPS UP
|
||||
function WalletAction({ walletItem, payment, openPopUp }) {
|
||||
const [showNairaWithdraw, setShowNairaWithdraw] = useState(false); // DETERMINES WHEN NAIRA WITHDRAWAL POPS UP
|
||||
|
||||
const [showConfirmNairaWithdraw, setShowConfirmNairaWithdraw] = useState({show: false, state: {}}) // DETERMINES WHEN CONFIRM NAIRA WITHDRAWAL POPS UP
|
||||
|
||||
const [showConfirmNairaWithdraw, setShowConfirmNairaWithdraw] = useState({
|
||||
show: false,
|
||||
state: {},
|
||||
}); // DETERMINES WHEN CONFIRM NAIRA WITHDRAWAL POPS UP
|
||||
|
||||
return (
|
||||
<div className="counters w-full flex justify-between gap-2">
|
||||
<div className='w-1/2 flex justify-center items-center'>
|
||||
<div className="w-1/2 flex justify-center items-center">
|
||||
<button
|
||||
onClick={()=>{setShowNairaWithdraw(true)}}
|
||||
className={`${
|
||||
onClick={() => {
|
||||
setShowNairaWithdraw(true);
|
||||
}}
|
||||
className={`${
|
||||
walletItem.code != "NAIRA" && "invisible"
|
||||
} px-4 h-10 flex justify-center items-center btn-gradient text-base rounded-full text-white`}
|
||||
} px-4 h-10 flex justify-center items-center btn-gradient text-base rounded-full text-white`}
|
||||
>
|
||||
Spend
|
||||
Spend
|
||||
</button>
|
||||
</div>
|
||||
<div className='w-1/2 flex justify-center items-center'>
|
||||
</div>
|
||||
<div className="w-1/2 flex justify-center items-center">
|
||||
<button
|
||||
className='px-4 h-10 flex justify-center items-center btn-gradient text-base rounded-full text-white'
|
||||
onClick={() => {
|
||||
className="px-4 h-10 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||
onClick={() => {
|
||||
openPopUp({
|
||||
payment: payment,
|
||||
currency: walletItem?.description,
|
||||
payment: payment,
|
||||
currency: walletItem?.description,
|
||||
});
|
||||
}}
|
||||
}}
|
||||
>
|
||||
{/* <span className="">
|
||||
{/* <span className="">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="38"
|
||||
@@ -46,20 +49,36 @@ function WalletAction({walletItem, payment, openPopUp}) {
|
||||
></path>
|
||||
</svg>
|
||||
</span> */}
|
||||
<span className="">Add Credit</span>
|
||||
<span className="">Add Credit</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{showNairaWithdraw &&
|
||||
<NairaWithdraw wallet={walletItem} action={()=>{setShowNairaWithdraw(prev => !prev)}} situation={showNairaWithdraw} setShowConfirmNairaWithdraw={setShowConfirmNairaWithdraw} />
|
||||
}
|
||||
</div>
|
||||
|
||||
{showConfirmNairaWithdraw.show &&
|
||||
<ConfirmNairaWithdraw wallet={walletItem} state={showConfirmNairaWithdraw.state} action={()=>{setShowConfirmNairaWithdraw(prev => ({...prev, show: !prev.show}))}} situation={showConfirmNairaWithdraw.show} />
|
||||
}
|
||||
{showNairaWithdraw && (
|
||||
<NairaWithdraw
|
||||
wallet={walletItem}
|
||||
action={() => {
|
||||
setShowNairaWithdraw((prev) => !prev);
|
||||
}}
|
||||
situation={showNairaWithdraw}
|
||||
setShowConfirmNairaWithdraw={setShowConfirmNairaWithdraw}
|
||||
/>
|
||||
)}
|
||||
|
||||
{showConfirmNairaWithdraw.show && (
|
||||
<ConfirmNairaWithdraw
|
||||
wallet={walletItem}
|
||||
state={showConfirmNairaWithdraw.state}
|
||||
action={() => {
|
||||
setShowConfirmNairaWithdraw((prev) => ({
|
||||
...prev,
|
||||
show: !prev.show,
|
||||
}));
|
||||
}}
|
||||
situation={showConfirmNairaWithdraw.show}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
export default WalletAction
|
||||
export default WalletAction;
|
||||
|
||||
Reference in New Issue
Block a user