Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6c8a087196 | |||
| 80a3a4578b |
@@ -1,24 +1,35 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import loginThumb from "../../assets/images/auth-thumb.svg";
|
import { Link } from "react-router-dom";
|
||||||
import logo from "../../assets/images/wrenchboard.png"; //logo-1.svg";
|
|
||||||
|
|
||||||
export default function LoginLayout({ slogan, children }) {
|
export default function LoginLayout({ slogan, children }) {
|
||||||
const checkScreenHeight = window.screen.height;
|
|
||||||
let screen = "";
|
|
||||||
if (checkScreenHeight <= 950) {
|
|
||||||
screen = "h-screen";
|
|
||||||
// screen = "h-[950px]";
|
|
||||||
} else {
|
|
||||||
screen = "h-screen";
|
|
||||||
}
|
|
||||||
return (
|
return (
|
||||||
<div className="layout-wrapper login">
|
<div className={`layout-wrapper login`}>
|
||||||
<div className={`main-wrapper login-wrapper w-full ${screen}`}>
|
<div className={`main-wrapper login-wrapper w-full h-screen overflow-y-auto sm:p-20 p-10`}>
|
||||||
<div className="flex w-full h-full">
|
<div className="w-full h-full">
|
||||||
|
|
||||||
<div className="flex-1 flex justify-center items-center">
|
<div className="flex-1 flex justify-center items-center">
|
||||||
{children && children}
|
{children && children}
|
||||||
</div>
|
</div>
|
||||||
|
<div className="flex-1 flex justify-center items-center p-10">
|
||||||
|
<div className="flex items-center">
|
||||||
|
<Link to="#" className="text-[#a1a5b7] text-[15px] px-2 font-medium hover:text-[#009ef7]">
|
||||||
|
About
|
||||||
|
</Link>
|
||||||
|
<Link to="#" className="text-[#a1a5b7] text-[15px] px-2 font-medium hover:text-[#009ef7]">
|
||||||
|
Services
|
||||||
|
</Link>
|
||||||
|
<Link to="#" className="text-[#a1a5b7] text-[15px] px-2 font-medium hover:text-[#009ef7]">
|
||||||
|
Contact Us
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="flex-1 flex justify-center items-center p-10">
|
||||||
|
<p className="text-black text-[15px] px-2 font-medium flex items-center">
|
||||||
|
<span className="text-3xl mt-2 mr-1">©</span> 2023 - {" "}
|
||||||
|
<Link to="/" className="text-[#009ef7] ml-1">
|
||||||
|
WrenchBoard
|
||||||
|
</Link>{" "}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ export default function SignUp() {
|
|||||||
setMsgError(null);
|
setMsgError(null);
|
||||||
}, process.env.REACT_APP_SIGNUP_ERROR_TIMEOUT);
|
}, process.env.REACT_APP_SIGNUP_ERROR_TIMEOUT);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getCountryList();
|
getCountryList();
|
||||||
@@ -277,6 +277,27 @@ export default function SignUp() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="flex-1 flex justify-center items-center p-10">
|
||||||
|
<div className="flex items-center">
|
||||||
|
<Link to="#" className="text-[#a1a5b7] text-[15px] px-2 font-medium hover:text-[#009ef7]">
|
||||||
|
About
|
||||||
|
</Link>
|
||||||
|
<Link to="#" className="text-[#a1a5b7] text-[15px] px-2 font-medium hover:text-[#009ef7]">
|
||||||
|
Services
|
||||||
|
</Link>
|
||||||
|
<Link to="#" className="text-[#a1a5b7] text-[15px] px-2 font-medium hover:text-[#009ef7]">
|
||||||
|
Contact Us
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="flex-1 flex justify-center items-center p-10">
|
||||||
|
<p className="text-black text-[15px] px-2 font-medium flex items-center">
|
||||||
|
<span className="text-3xl mt-2 mr-1">©</span> 2023 - {" "}
|
||||||
|
<Link to="/" className="text-[#009ef7] ml-1">
|
||||||
|
WrenchBoard
|
||||||
|
</Link>{" "}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -31,11 +31,11 @@ function Balance({wallet, payment, coupon, purchase}) {
|
|||||||
</div>
|
</div>
|
||||||
<div className='balance-info'>
|
<div className='balance-info'>
|
||||||
<p className='py-2'>balance</p>
|
<p className='py-2'>balance</p>
|
||||||
<span className='text-sm py-1 px-2 bg-green-100 text-green-500 rounded-lg'>{item.symbol}{(item.amount*0.01).toFixed(2)}</span>
|
<span className='text-sm py-1 px-2 bg-green-100 text-green-500 rounded-lg'>{item.symbol}{(item.amount*1).toFixed(2)}</span>
|
||||||
</div>
|
</div>
|
||||||
<div className='balance-info'>
|
<div className='balance-info'>
|
||||||
<p className='py-2'>Escrow</p>
|
<p className='py-2'>Escrow</p>
|
||||||
<span className='text-sm py-1 px-2 bg-red-100 text-red-500 rounded-lg'>{item.symbol}{(item.escrow*0.01).toFixed(2)}</span>
|
<span className='text-sm py-1 px-2 bg-red-100 text-red-500 rounded-lg'>{item.symbol}{(item.escrow*1).toFixed(2)}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,10 @@
|
|||||||
import React, {useState, useEffect} from 'react'
|
import React, {useState} from 'react'
|
||||||
import {useLocation, useNavigate} from 'react-router-dom'
|
import {useLocation, useNavigate} from 'react-router-dom'
|
||||||
import RecentActivityTable from './WalletComponent/RecentActivityTable'
|
import RecentActivityTable from './WalletComponent/RecentActivityTable'
|
||||||
import LoadingSpinner from '../Spinners/LoadingSpinner'
|
import LoadingSpinner from '../Spinners/LoadingSpinner'
|
||||||
import InputCom from '../Helpers/Inputs/InputCom'
|
import InputCom from '../Helpers/Inputs/InputCom'
|
||||||
import {toast} from 'react-toastify'
|
|
||||||
|
|
||||||
import usersService from '../../services/UsersService'
|
|
||||||
|
|
||||||
function ConfirmTransfer({payment, wallet}) {
|
function ConfirmTransfer({payment, wallet}) {
|
||||||
const apiURL = new usersService()
|
|
||||||
|
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
|
|
||||||
let {state} = useLocation()
|
let {state} = useLocation()
|
||||||
@@ -19,133 +14,107 @@ function ConfirmTransfer({payment, wallet}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let [requestStatus, setRequestStatus] = useState({message: '', loading: false, status: false})
|
let [requestStatus, setRequestStatus] = useState({message: '', loading: false, status: false})
|
||||||
let [pageLoading, setPageLoading] = useState(true)
|
|
||||||
|
|
||||||
//FUNCTION TO HANDLE SUBMIT
|
//FUNCTION TO HANDLE SUBMIT
|
||||||
const handleSubmit = () => {
|
const handleSubmit = () => {
|
||||||
setRequestStatus({message: '', loading: true, status: false})
|
// let [requestStatus, setRequestStatus] = useState({message: '', loading: true, status: false})
|
||||||
let reqData = {
|
|
||||||
amount: Number(state.amount),
|
|
||||||
Fee: Number(state.fee),
|
|
||||||
recipientid: Number(state.recipientID)
|
|
||||||
}
|
|
||||||
apiURL.sendMoney(reqData).then((res)=>{
|
|
||||||
if(res.data.internal_return < 0){
|
|
||||||
setRequestStatus({message: 'Could not perform transaction', loading: false, status: false})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
setRequestStatus({message: 'transfer successful', loading: false, status: true})
|
|
||||||
toast.success('Transfer sucessful')
|
|
||||||
setTimeout(()=>{
|
|
||||||
navigate('/', {replace: true})
|
|
||||||
}, 1000)
|
|
||||||
}).catch(error=>{
|
|
||||||
setRequestStatus({message: 'Opps! something went wrong! Try Again', loading: false, status: false})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
useEffect(()=>{
|
//valid inputs before submitting. Just for texting remove later
|
||||||
setPageLoading(false)
|
|
||||||
},[])
|
}
|
||||||
return (
|
return (
|
||||||
<div className="content-wrapper w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin">
|
<div className="content-wrapper w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin">
|
||||||
{pageLoading ?
|
<div className="lg:w-1/2 w-full mb-10 lg:mb-0">
|
||||||
<LoadingSpinner size='8' color='sky-blue' />
|
<div className="add-fund w-full bg-white dark:bg-dark-white rounded-2xl shadow">
|
||||||
:
|
<div className='px-4 md:px-8 py-4'>
|
||||||
(
|
{wallet.loading ?
|
||||||
<div className="lg:w-1/2 w-full mb-10 lg:mb-0">
|
|
||||||
<div className="add-fund w-full bg-white dark:bg-dark-white rounded-2xl shadow">
|
|
||||||
<div className='px-4 md:px-8 py-4'>
|
|
||||||
{wallet.loading ?
|
|
||||||
<LoadingSpinner size='8' color='sky-blue' />
|
|
||||||
:
|
|
||||||
wallet.data.length ?
|
|
||||||
<h2 className='my-4 text-slate-500 dark:text-white text-sm xl:text-xl font-medium'>
|
|
||||||
{wallet.data.map(item => {
|
|
||||||
if(item.description == 'Naira'){
|
|
||||||
return `Withdraw from Naira Wallet : ${item.symbol}${(item.amount*0.01).toFixed(2)}`
|
|
||||||
}
|
|
||||||
})}
|
|
||||||
</h2>
|
|
||||||
:
|
|
||||||
wallet.error ?
|
|
||||||
<h2 className='my-4 text-slate-500 dark:text-white text-sm xl:text-xl font-medium'>Opps! An Error Occured</h2>
|
|
||||||
:
|
|
||||||
<h2 className='my-4 text-slate-500 dark:text-white text-sm xl:text-xl font-medium'>No Wallet Information Found!</h2>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
<hr />
|
|
||||||
<div className='px-4 md:px-8 py-4 add-fund-info'>
|
|
||||||
<h2 className='my-2 text-slate-900 dark:text-white text-sm xl:text-xl font-medium'>Confirm Withdraw to Account</h2>
|
|
||||||
{/* AMOUNT */}
|
|
||||||
<div className="field w-full mb-3">
|
|
||||||
<InputCom
|
|
||||||
label="Amount:"
|
|
||||||
type="text"
|
|
||||||
name="amount"
|
|
||||||
value={state?.amount || ''}
|
|
||||||
disable={true}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* RECIPIENT ACC: */}
|
|
||||||
<div className="field w-full mb-3">
|
|
||||||
<InputCom
|
|
||||||
label="Recipient Acc:"
|
|
||||||
type="text"
|
|
||||||
name="recipient"
|
|
||||||
value={state?.details.recipient || ''}
|
|
||||||
disable={true}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* PROCESSING FEE: */}
|
|
||||||
<div className="field w-full mb-3">
|
|
||||||
<InputCom
|
|
||||||
label="Processing Fee:"
|
|
||||||
type="text"
|
|
||||||
name="processingFee"
|
|
||||||
value={state?.fee || ''}
|
|
||||||
disable={true}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* TOTAL */}
|
|
||||||
<div className="field w-full mb-3">
|
|
||||||
<InputCom
|
|
||||||
label="Total"
|
|
||||||
type="text"
|
|
||||||
name="total"
|
|
||||||
value={state?.total || ''}
|
|
||||||
disable={true}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* COMMENT/NOTE */}
|
|
||||||
<div className="field w-full mb-3">
|
|
||||||
<InputCom
|
|
||||||
label="Comment/Note:"
|
|
||||||
type="text"
|
|
||||||
name="comment"
|
|
||||||
value={state?.comment || ''}
|
|
||||||
disable={true}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr />
|
|
||||||
{requestStatus.message && <p className={`text-base ${requestStatus.status? 'text-green-500' : 'text-red-500'} px-4 md:px-8 py-4`}>{requestStatus.message}</p>}
|
|
||||||
<div className='px-4 md:px-8 py-4 add-fund-btn flex justify-end items-center'>
|
|
||||||
{requestStatus.loading ?
|
|
||||||
<LoadingSpinner size='8' color='sky-blue' />
|
<LoadingSpinner size='8' color='sky-blue' />
|
||||||
:
|
:
|
||||||
<button onClick={handleSubmit} className='text-lg text-white bg-sky-blue px-4 py-2 hover:opacity-90 rounded-md'>Transfer</button>
|
wallet.data.length ?
|
||||||
}
|
<h2 className='my-4 text-slate-500 dark:text-white text-sm xl:text-xl font-medium'>
|
||||||
|
{wallet.data.map(item => {
|
||||||
|
if(item.description == 'Naira'){
|
||||||
|
return `Withdraw from Naira Wallet : ${item.symbol}${(item.amount*1).toFixed(2)}`
|
||||||
|
}
|
||||||
|
})}
|
||||||
|
</h2>
|
||||||
|
:
|
||||||
|
wallet.error ?
|
||||||
|
<h2 className='my-4 text-slate-500 dark:text-white text-sm xl:text-xl font-medium'>Opps! An Error Occured</h2>
|
||||||
|
:
|
||||||
|
<h2 className='my-4 text-slate-500 dark:text-white text-sm xl:text-xl font-medium'>No Wallet Information Found!</h2>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<hr />
|
||||||
|
<div className='px-4 md:px-8 py-4 add-fund-info'>
|
||||||
|
<h2 className='my-2 text-slate-900 dark:text-white text-sm xl:text-xl font-medium'>Confirm Withdraw to Account</h2>
|
||||||
|
{/* AMOUNT */}
|
||||||
|
<div className="field w-full mb-3">
|
||||||
|
<InputCom
|
||||||
|
label="Amount:"
|
||||||
|
type="text"
|
||||||
|
name="amount"
|
||||||
|
value={state?.amount || ''}
|
||||||
|
disable={true}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* RECIPIENT ACC: */}
|
||||||
|
<div className="field w-full mb-3">
|
||||||
|
<InputCom
|
||||||
|
label="Recipient Acc:"
|
||||||
|
type="text"
|
||||||
|
name="recipient"
|
||||||
|
value={state?.details.recipient || ''}
|
||||||
|
disable={true}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* PROCESSING FEE: */}
|
||||||
|
<div className="field w-full mb-3">
|
||||||
|
<InputCom
|
||||||
|
label="Processing Fee:"
|
||||||
|
type="text"
|
||||||
|
name="processingFee"
|
||||||
|
value={state?.fee || ''}
|
||||||
|
disable={true}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* TOTAL */}
|
||||||
|
<div className="field w-full mb-3">
|
||||||
|
<InputCom
|
||||||
|
label="Total"
|
||||||
|
type="text"
|
||||||
|
name="total"
|
||||||
|
value={state?.total || ''}
|
||||||
|
disable={true}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* COMMENT/NOTE */}
|
||||||
|
<div className="field w-full mb-3">
|
||||||
|
<InputCom
|
||||||
|
label="Comment/Note:"
|
||||||
|
type="text"
|
||||||
|
name="comment"
|
||||||
|
value={state?.comment || ''}
|
||||||
|
disable={true}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<hr />
|
||||||
|
<div className='px-4 md:px-8 py-4 add-fund-btn flex justify-end items-center'>
|
||||||
|
{requestStatus.loading ?
|
||||||
|
<LoadingSpinner size='8' color='sky-blue' />
|
||||||
|
:
|
||||||
|
<button onClick={handleSubmit} className='text-lg text-white bg-sky-blue px-4 py-2 hover:opacity-90 rounded-md'>Transfer</button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
</div>
|
||||||
}
|
|
||||||
|
|
||||||
<div className="lg:w-1/2 w-full mb-10 lg:mb-0">
|
<div className="lg:w-1/2 w-full mb-10 lg:mb-0">
|
||||||
<div className="wallet w-full px-4 md:px-8 py-4 h-full max-h-[800px] bg-white dark:bg-dark-white overflow-y-auto rounded-2xl shadow">
|
<div className="wallet w-full px-4 md:px-8 py-4 h-full max-h-[800px] bg-white dark:bg-dark-white overflow-y-auto rounded-2xl shadow">
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ function TransferFund({payment, wallet}) {
|
|||||||
<h2 className='my-4 py-2 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium'>
|
<h2 className='my-4 py-2 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium'>
|
||||||
{wallet.data.map(item => {
|
{wallet.data.map(item => {
|
||||||
if(item.description == 'Naira'){
|
if(item.description == 'Naira'){
|
||||||
return `Withdraw from Naira Wallet : ${item.symbol}${(item.amount*0.01).toFixed(2)}`
|
return `Withdraw from Naira Wallet : ${item.symbol}${(item.amount*1).toFixed(2)}`
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
</h2>
|
</h2>
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ export default function WalletHeader(props) {
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<p className="eth text-xl font-bold text-purple">
|
<p className="eth text-xl font-bold text-purple">
|
||||||
{(value.amount*0.01).toFixed(2)} {value.code}
|
{(value.amount*1).toFixed(2)} {value.code}
|
||||||
</p>
|
</p>
|
||||||
<p className="usd text-base text-thin-light-gray text-right">
|
<p className="usd text-base text-thin-light-gray text-right">
|
||||||
{/*(773.69 USD)*/}
|
{/*(773.69 USD)*/}
|
||||||
|
|||||||
@@ -230,19 +230,6 @@ class usersService {
|
|||||||
};
|
};
|
||||||
return this.postAuxEnd("/paymenthx", postData);
|
return this.postAuxEnd("/paymenthx", postData);
|
||||||
}
|
}
|
||||||
|
|
||||||
// API FUNCTION TO GET PAYMENT HISTORY
|
|
||||||
sendMoney(reqData){
|
|
||||||
var postData = {
|
|
||||||
uid: localStorage.getItem("uid"),
|
|
||||||
member_id: localStorage.getItem("member_id"),
|
|
||||||
sessionid: localStorage.getItem("session_token"),
|
|
||||||
senderid: localStorage.getItem("member_id"),
|
|
||||||
action: 33020,
|
|
||||||
...reqData
|
|
||||||
};
|
|
||||||
return this.postAuxEnd("/sendmoney", postData);
|
|
||||||
}
|
|
||||||
|
|
||||||
//END POINT CALL FOR REFERRAL HISTORY
|
//END POINT CALL FOR REFERRAL HISTORY
|
||||||
getReferralHx(){
|
getReferralHx(){
|
||||||
|
|||||||
Reference in New Issue
Block a user