diff --git a/src/components/Helpers/Inputs/InputCom/index.jsx b/src/components/Helpers/Inputs/InputCom/index.jsx
index 3479d73..9839068 100644
--- a/src/components/Helpers/Inputs/InputCom/index.jsx
+++ b/src/components/Helpers/Inputs/InputCom/index.jsx
@@ -14,9 +14,7 @@ export default function InputCom({
forgotPassword,
onClick,
disable,
- blurHandler,
- onMouseEnter,
- onMouseLeave
+ blurHandler
}) {
const inputRef = useRef(null)
// Entry Validation
@@ -92,7 +90,6 @@ export default function InputCom({
ref={inputRef}
readOnly={disable}
onBlur={blurHandler}
- onMouseLeave={onMouseLeave}
/>
{iconName && (
diff --git a/src/components/MyWallet/ConfirmTransfer.jsx b/src/components/MyWallet/ConfirmTransfer.jsx
new file mode 100644
index 0000000..c77c4f0
--- /dev/null
+++ b/src/components/MyWallet/ConfirmTransfer.jsx
@@ -0,0 +1,134 @@
+import React, {useState} from 'react'
+import {useLocation, useNavigate} from 'react-router-dom'
+import RecentActivityTable from './WalletComponent/RecentActivityTable'
+import LoadingSpinner from '../Spinners/LoadingSpinner'
+import InputCom from '../Helpers/Inputs/InputCom'
+
+function ConfirmTransfer({payment, wallet}) {
+ const navigate = useNavigate()
+
+ let {state} = useLocation()
+ // what happens if not state redirect user
+ if(!state){
+ navigate('../transfer-fund',{replace: true})
+ }
+
+ let [requestStatus, setRequestStatus] = useState({message: '', loading: false, status: false})
+
+ //FUNCTION TO HANDLE SUBMIT
+ const handleSubmit = () => {
+ // let [requestStatus, setRequestStatus] = useState({message: '', loading: true, status: false})
+
+ //valid inputs before submitting. Just for texting remove later
+
+ }
+ return (
+
+
+
+
+ {wallet.loading ?
+
+ :
+ wallet.data.length ?
+
+ {wallet.data.map(item => {
+ if(item.description == 'Naira'){
+ return `Withdraw from Naira Wallet : ${item.symbol}${(item.amount*1).toFixed(2)}`
+ }
+ })}
+
+ :
+ wallet.error ?
+ Opps! An Error Occured
+ :
+ No Wallet Information Found!
+ }
+
+
+
+
Confirm Withdraw to Account
+ {/* AMOUNT */}
+
+
+
+
+ {/* RECIPIENT ACC: */}
+
+
+
+
+ {/* PROCESSING FEE: */}
+
+
+
+
+ {/* TOTAL */}
+
+
+
+
+ {/* COMMENT/NOTE */}
+
+
+
+
+
+
+
+
+ {requestStatus.loading ?
+
+ :
+
+ }
+
+
+
+
+
+
+
Recent Activity
+
Activity Report
+ {payment.loading ?
+
+ :
+
+ }
+
+
+
+ )
+}
+
+export default ConfirmTransfer
\ No newline at end of file
diff --git a/src/components/MyWallet/TransferFund.jsx b/src/components/MyWallet/TransferFund.jsx
index 5212eac..740981d 100644
--- a/src/components/MyWallet/TransferFund.jsx
+++ b/src/components/MyWallet/TransferFund.jsx
@@ -1,5 +1,5 @@
import React, {useEffect, useState} from 'react'
-import { Link } from 'react-router-dom'
+import { Link, useNavigate } from 'react-router-dom'
import RecentActivityTable from './WalletComponent/RecentActivityTable'
import LoadingSpinner from '../Spinners/LoadingSpinner'
import InputCom from '../Helpers/Inputs/InputCom'
@@ -16,22 +16,26 @@ const validationSchema = Yup.object().shape({
.typeError("you must specify a number")
.min(1, 'Amount must be greater than 0')
.required('Amount is required'),
- recipient: Yup.string()
- .min(3, 'Minimum 3 characters')
+ recipientID: Yup.string()
+ .min(1, 'Minimum 1 characters')
.max(50, 'Maximum 50 characters')
.required('Recipient is required'),
})
const initialValues = {
amount: '',
- recipient: '',
+ recipientID: '',
comment: '',
}
function TransferFund({payment, wallet}) {
- const apiCall = new usersService()
+ const apiCall = new usersService() // API CLASS CALL
- let [recepients, setRecipients] = useState({ // FOR COUPON HISTORY
+ const navigate = useNavigate()
+
+ let [requestStatus, setRequestStatus] = useState(false)
+
+ let [recipients, setRecipients] = useState({ // FOR COUPON HISTORY
loading: true,
data: [],
error: false
@@ -70,12 +74,15 @@ function TransferFund({payment, wallet}) {
//FUNCTION TO HANDLE SUBMIT
- const handleSubmit = () => {
- // setRequestStatus({message: '', loading: true, status: false})
- let reqData = {}
+ const handleSubmit = (values, helpers) => {
+ setRequestStatus(true)
+ let recipientDetails = recipients.data?.filter(item => item.recipient_id == values.recipientID)
+ let stateData = {...values, ...sendMoneyFee, details:{...recipientDetails[0]}}
- // MAKE API CALL
-
+ setTimeout(()=>{
+ setRequestStatus(false)
+ navigate('confirm-transfer', {state: stateData})
+ }, 1000)
}
useEffect(()=>{
@@ -116,8 +123,11 @@ function TransferFund({payment, wallet}) {
placeholder='0'
value={props.values.amount}
inputHandler={props.handleChange}
- blurHandler={props.handleBlur}
- onMouseLeave={(e)=>{getSendMoneyFee(e)}}
+ blurHandler={(e)=>{
+ getSendMoneyFee(e)
+ props.handleBlur
+ }}
+ // onMouseLeave={(e)=>{getSendMoneyFee(e)}}
/>
{(props.errors.amount && props.touched.amount) &&
{props.errors.amount}
}
@@ -155,19 +165,19 @@ function TransferFund({payment, wallet}) {