From 8eefbbede85afd2c4e5171984cb76163735f9402 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Thu, 14 Aug 2025 09:12:53 -0400 Subject: [PATCH] subscribe add --- src/component/subscribe/Subscribe.jsx | 90 +++++++++++++++++++++++++++ src/views/Subscribe.jsx | 3 +- 2 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 src/component/subscribe/Subscribe.jsx diff --git a/src/component/subscribe/Subscribe.jsx b/src/component/subscribe/Subscribe.jsx new file mode 100644 index 0000000..94b218a --- /dev/null +++ b/src/component/subscribe/Subscribe.jsx @@ -0,0 +1,90 @@ +import React from 'react' +import BreadcrumbComBS from "../breadcrumb/BreadcrumbComBS"; +import getImage from "../../utils/getImage"; +import { getSubscriptions } from '../../services/services'; +import { useQuery } from '@tanstack/react-query'; +import queryKeys from '../../services/queryKeys'; +import siteLinks from "../../links/siteLinks"; +import { Link, useNavigate } from 'react-router-dom' + +export default function Subscribe() { + const navigate = useNavigate() + const pricingFields ={ + starter: { name: 'Starter', price: 5.99, active: true }, + basic: { name: 'Basic', price: 12.99, active: true }, + premium: { name: 'Premium', price: 20.00, active: true }, + } + + const {data, isFetching, isError, error} = useQuery({ + queryKey: queryKeys.subscriptions, + queryFn: () => { + let reqData = { + token: localStorage.getItem('token'), // USER TOKEN + uid: localStorage.getItem('uid') // USER UID + } + return getSubscriptions(reqData) + } + }) + + const currentSubscription = data?.data?.current_product + const otherSubscriptions = data?.data?.options + console.log('urlData', data?.data) + + return ( + <> + + + {isFetching ? + <> +
+

Loading...

+
+ + : isError ? +
+

{error.message}

+
+ : +
+
+
+
+
+
Current Subscription(s)
+

{currentSubscription?.display_name}

+
+
+
+
+ + <> + {Object.entries(otherSubscriptions)?.map(([key, value]) => ( + +
+
+
+
+
{value.display_name}
+

${value.monthly}

+

/ Monthly

+
    + {value?.items?.map(item =>( +
  • {item}
  • + ))} +
+
+ +
+
+
+
+
+ + ))} + + +
+ } + + ) +} \ No newline at end of file diff --git a/src/views/Subscribe.jsx b/src/views/Subscribe.jsx index c06b27f..81b3ae1 100644 --- a/src/views/Subscribe.jsx +++ b/src/views/Subscribe.jsx @@ -1,8 +1,9 @@ import React from 'react' //import Signup2 from '../component/auth/Signup2' +import Subscribe from '../component/subscribe/Subscribe' export default function SubscribePage() { return ( - <>Subscribe Payment Start + ) }