virtual card display and banner and popout fixed
This commit was merged in pull request #838.
This commit is contained in:
@@ -2,10 +2,31 @@ import React, { useState } from 'react'
|
||||
import { localImgLoad } from '../../../../lib'
|
||||
import { PriceFormatter } from '../../../Helpers/PriceFormatter'
|
||||
import FamilyAddFundPopout from './FamilyAddFundPopout'
|
||||
import VirtualAddCardFamilyPopout from './VirtualAddCardFamilyPopout'
|
||||
|
||||
function Wallet({wallet, familyData, setFamilyWalletReload}) {
|
||||
const [addFundPopout, setAddFundPopout] = useState({ show: false, data: {} })
|
||||
|
||||
// virtual add card popout
|
||||
const [virtualPopup, setVirtualPopup] = useState({ show: false, data: {} });
|
||||
|
||||
/*OPENS the virtual add card popout*/
|
||||
const openVirtualPopUp = (value) => {
|
||||
setVirtualPopup({
|
||||
show: true,
|
||||
data: { ...value },
|
||||
});
|
||||
};
|
||||
|
||||
/*Closes the virtual add card popout*/
|
||||
const closeVirtualPopUp = () => {
|
||||
setVirtualPopup({ show: false, data: {} });
|
||||
// dispatch(tableReload({ type: "WALLETTABLE" }));
|
||||
};
|
||||
|
||||
// console.log('Extra Actions', Object.keys(wallet.extra_actions))
|
||||
let extraActions = Object.keys(wallet.extra_actions) // VARIABLE TO HOLD EXTRA ACTIONS VALUES
|
||||
|
||||
return (
|
||||
<div className='w-full p-4 bg-[aliceblue] rounded-lg'
|
||||
// style={{
|
||||
@@ -48,13 +69,28 @@ function Wallet({wallet, familyData, setFamilyWalletReload}) {
|
||||
>
|
||||
Add Money
|
||||
</button>
|
||||
<button
|
||||
className="w-[150px] h-[48px] rounded-full text-base text-white bg-[#4687ba] hover:bg-[#009ef7]"
|
||||
name="plan"
|
||||
// onClick={onClose}
|
||||
>
|
||||
Add Card
|
||||
</button>
|
||||
|
||||
{/* EXTRA ACTIONS BTN */}
|
||||
{(extraActions && extraActions?.length > 0) &&
|
||||
extraActions.map((action, index) => (
|
||||
<div key={index}>
|
||||
<button
|
||||
onClick={() => {
|
||||
action == 'ADD_VIRTUAL_CARD' ?
|
||||
openVirtualPopUp({wallet})
|
||||
:
|
||||
null
|
||||
}}
|
||||
className={`w-[150px] h-[48px] rounded-full text-base text-white bg-[#4687ba] hover:bg-[#009ef7]`}
|
||||
>
|
||||
{/* Add Card */}
|
||||
{wallet?.extra_actions?.[action][0]?.text}
|
||||
</button>
|
||||
{/* <WalletExtraFamilyActionBtn /> // TO BE USED lATER IF NEED BE */}
|
||||
</div>
|
||||
))
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -71,6 +107,17 @@ function Wallet({wallet, familyData, setFamilyWalletReload}) {
|
||||
familyData={familyData}
|
||||
/>
|
||||
}
|
||||
|
||||
{/* VIRTUAL CARD POPOUT */}
|
||||
{virtualPopup.show && (
|
||||
<VirtualAddCardFamilyPopout
|
||||
details={virtualPopup.data}
|
||||
walletItem={wallet}
|
||||
onClose={closeVirtualPopUp}
|
||||
situation={virtualPopup.show}
|
||||
familyData={familyData}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user