fixed payment switch btn

This commit was merged in pull request #72.
This commit is contained in:
victorAnumudu
2025-08-19 19:11:49 +01:00
parent cdb676a047
commit 3d5bdc2afd
4 changed files with 21 additions and 10 deletions
@@ -1,6 +1,11 @@
import React from 'react'
export default function SubcribePaymentOptions(){
export default function SubcribePaymentOptions({activePaymentType, setActivePaymentType}){
const handleSwitch = ({target:{name, value}}) => {
console.log('SWITCH', name, value)
setActivePaymentType(value)
}
return <>
@@ -13,13 +18,13 @@ export default function SubcribePaymentOptions(){
<div className="card-body">
<div className="form-check form-check-inline">
<input className="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio1"
value="option1" />
<input onChange={handleSwitch} className="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio1"
value="previous" checked={activePaymentType == 'previous'} />
<label className="form-check-label" htmlFor="inlineRadio1">Previous Cards</label>
</div>
<div className="form-check form-check-inline">
<input className="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio2"
value="option2" />
<input onChange={handleSwitch} className="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio2"
value="new" checked={activePaymentType == 'new'} />
<label className="form-check-label" htmlFor="inlineRadio2">Add New card</label>
</div>
</div>