Compare commits

...

3 Commits

Author SHA1 Message Date
victorAnumudu 3d5bdc2afd fixed payment switch btn 2025-08-19 19:11:49 +01:00
CHIEFSOFT\ameye cdb676a047 payment forms 2025-08-19 11:54:55 -04:00
ameye 34febdedfa Merge branch 'selected-subscribe' of MERMS/MermsPanelReactJS into master 2025-08-18 19:09:17 +00:00
5 changed files with 73 additions and 12 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
import { useQuery } from '@tanstack/react-query'
import { topBar } from '../../services/services'
import queryKeys from '../../services/queryKeys'
import { Link } from 'react-router-dom'
export default function TopBar() {
@@ -68,7 +69,7 @@ export default function TopBar() {
<small className="d-block">{item?.data_span}</small>
</div>
<div className="col text-right">
<h5 className="text-muted mb-0"><a href={item?.link}>{item?.description}</a></h5>
<h5 className="text-muted mb-0"><Link to={item?.link}>{item?.description}</Link></h5>
</div>
</div>
<div className="apexchart-wrapper">
@@ -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>
+6 -3
View File
@@ -1,4 +1,4 @@
import React from 'react'
import React, { useState } from 'react'
import BreadcrumbComBS from "../breadcrumb/BreadcrumbComBS";
import getImage from "../../utils/getImage";
import { getSubscriptions } from '../../services/services';
@@ -15,6 +15,7 @@ export default function Subscribe() {
const {state:{selectedSubscription}} = useLocation()
// console.log('selectedSubscription', selectedSubscription)
let [activePaymentType, setActivePaymentType] = useState('previous')
return (
<>
@@ -27,10 +28,12 @@ export default function Subscribe() {
<div className="pricing-content-card">
<h5>Current Subscription(s)</h5>
{/*<h2 className="text-primary pt-3">{currentSubscription?.display_name}</h2>*/}
<SubcribePaymentOptions />
<SubcribePaymentOptions activePaymentType={activePaymentType} setActivePaymentType={setActivePaymentType} />
{activePaymentType == 'new' ?
<SubscribeNewCard />
:
<SubscribePreviousCard />
}
</div>
</div>
+23 -1
View File
@@ -1,6 +1,28 @@
import React from 'react'
export default function SubscribeNewCard(){
return <>Previous Card</>
return <>
<div className="row">
<div className="col-md-12 col-12 selects-contant">
<div className="card card-statistics">
<div className="card-header">
<div className="card-heading" style={{textAlign: 'left'}}>
<h4 className="card-title">Pay with New Card</h4>
</div>
</div>
<div className="card-body">
<div className="form-group mb-0">
</div>
</div>
</div>
</div>
</div>
</>
}
@@ -1,6 +1,36 @@
import React from 'react'
export default function SubscribePreviousCard(){
import { IoMdArrowDropdown } from 'react-icons/io'
return <>Previous Card</>
export default function SubscribePreviousCard() {
return <>
{/*<div className="row select-wrapper">*/}
{/* <div className="col-md-12 col-12 selects-contant">*/}
<div className="row">
<div className="col-md-12 col-12 selects-contant">
<div className="card card-statistics">
<div className="card-header">
<div className="card-heading" style={{textAlign: 'left'}}>
<h4 className="card-title">Pay with Previous Card</h4>
</div>
</div>
<div className="card-body">
<div className="position-relative form-group mb-0">
<select className="js-basic-single form-control" name="state">
<option value="AK">Visa xxxx xxxx xxxx 1234</option>
<option value="HI">Mastercard xxxx xxxx xxxx 1234</option>
</select>
<IoMdArrowDropdown className='position-absolute w-auto' style={{top: '50%', right: '2px', transform: 'translateY(-50%)'}} />
</div>
</div>
</div>
</div>
{/* </div>*/}
{/*</div>*/}
</div>
</>
}