From 3d5bdc2afd676096656566316b53f743bd747703 Mon Sep 17 00:00:00 2001 From: victorAnumudu Date: Tue, 19 Aug 2025 19:11:49 +0100 Subject: [PATCH] fixed payment switch btn --- src/component/home/TopBar.jsx | 3 ++- .../subscribe/SubcribePaymentOptions.jsx | 15 ++++++++++----- src/component/subscribe/Subscribe.jsx | 9 ++++++--- src/component/subscribe/SubscribePreviousCard.jsx | 4 +++- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/component/home/TopBar.jsx b/src/component/home/TopBar.jsx index 9aff302..f49de54 100644 --- a/src/component/home/TopBar.jsx +++ b/src/component/home/TopBar.jsx @@ -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() { {item?.data_span}
-
{item?.description}
+
{item?.description}
diff --git a/src/component/subscribe/SubcribePaymentOptions.jsx b/src/component/subscribe/SubcribePaymentOptions.jsx index 899e3a0..90c7e6b 100644 --- a/src/component/subscribe/SubcribePaymentOptions.jsx +++ b/src/component/subscribe/SubcribePaymentOptions.jsx @@ -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(){
- +
- +
diff --git a/src/component/subscribe/Subscribe.jsx b/src/component/subscribe/Subscribe.jsx index e2a6f06..6beae28 100644 --- a/src/component/subscribe/Subscribe.jsx +++ b/src/component/subscribe/Subscribe.jsx @@ -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() {
Current Subscription(s)
{/*

{currentSubscription?.display_name}

*/} - - + + {activePaymentType == 'new' ? + : + }
diff --git a/src/component/subscribe/SubscribePreviousCard.jsx b/src/component/subscribe/SubscribePreviousCard.jsx index 52f7ea1..a37aea8 100644 --- a/src/component/subscribe/SubscribePreviousCard.jsx +++ b/src/component/subscribe/SubscribePreviousCard.jsx @@ -1,4 +1,5 @@ import React from 'react' +import { IoMdArrowDropdown } from 'react-icons/io' export default function SubscribePreviousCard() { @@ -14,11 +15,12 @@ export default function SubscribePreviousCard() {
-
+
+