diff --git a/src/components/profile/UserSettings.js b/src/components/profile/UserSettings.js index 9e9d045..d496b9d 100644 --- a/src/components/profile/UserSettings.js +++ b/src/components/profile/UserSettings.js @@ -46,9 +46,6 @@ const UserSettings = () => {

- - {/* Subscription Modal */} - {user && }
diff --git a/src/components/profile/subscription/SubscribeModal.js b/src/components/profile/subscription/SubscribeModal.js index a7d0b26..7393f5c 100644 --- a/src/components/profile/subscription/SubscribeModal.js +++ b/src/components/profile/subscription/SubscribeModal.js @@ -34,6 +34,7 @@ const SubscribeModal = ({ user }) => { const [nip05Visible, setNip05Visible] = useState(false); const [cancelSubscriptionVisible, setCancelSubscriptionVisible] = useState(false); const [renewSubscriptionVisible, setRenewSubscriptionVisible] = useState(false); + const [selectedPlan, setSelectedPlan] = useState('monthly'); useEffect(() => { if (user && user.role) { @@ -148,7 +149,17 @@ const SubscribeModal = ({ user }) => { return ( <> - + + {!session?.user && ( +
+ + router.push('/auth/signin')} + /> +
+ )} {subscribed && !user?.role?.nwc && (
@@ -163,7 +174,7 @@ const SubscribeModal = ({ user }) => {

Recurring subscription will AUTO renew on {subscribedUntil.toLocaleDateString()}

)} - {(!subscribed && !subscriptionExpiredAt) && ( + {(!subscribed && !subscriptionExpiredAt && session?.user) && (
{ I WILL MAKE SURE YOU WIN HARD AND LEVEL UP AS A DEV!
+ +
+
setSelectedPlan('monthly')} + > +
+
+ {selectedPlan === 'monthly' &&
} +
+ Monthly +
+
50,000 sats
+
+ +
setSelectedPlan('yearly')} + > +
+
+ {selectedPlan === 'yearly' &&
} +
+ Yearly +
+
500,000 sats
+
+
+ {
{/* Left Column - 22% */}
-
- {/* Subscription Status Messages */} - {subscribed && !user?.role?.nwc && ( -
- -

Thank you for your support 🎉

-

Pay-as-you-go subscription requires manual renewal on {subscribedUntil.toLocaleDateString()}

-
- )} - {subscribed && user?.role?.nwc && ( -
- -

Thank you for your support 🎉

-

Recurring subscription will AUTO renew on {subscribedUntil.toLocaleDateString()}

-
- )} - {(!subscribed && !subscriptionExpiredAt) && ( -
- -
- )} - {subscriptionExpiredAt && ( -
- -
- )} + {user && } +
+
diff --git a/src/pages/subscribe.js b/src/pages/subscribe.js index 9eecf5d..04c2db6 100644 --- a/src/pages/subscribe.js +++ b/src/pages/subscribe.js @@ -4,9 +4,8 @@ import { useRouter } from 'next/router'; import { useToast } from '@/hooks/useToast'; import axios from 'axios'; import { Card } from 'primereact/card'; -import { Message } from 'primereact/message'; +import SubscribeModal from '@/components/profile/subscription/SubscribeModal'; import useWindowWidth from '@/hooks/useWindowWidth'; -import { Menu } from "primereact/menu"; import GenericButton from '@/components/buttons/GenericButton'; import { ProgressSpinner } from 'primereact/progressspinner'; import SubscriptionPaymentButtons from '@/components/bitcoinConnect/SubscriptionPaymentButton'; @@ -122,61 +121,13 @@ const Subscribe = () => { }, ]; - const subscriptionCardTitleAndButton = ( -
- Plebdevs Subscription - menu.current.toggle(e)} - > - -
- ); - - const subscriptionCardTitle = ( -
- Plebdevs Subscription -
- ); - return (
{windowWidth < 768 && (

Subscription Management

)}
- {session && session?.user ? ( - <> - {subscribed && !user?.role?.nwc && ( -
- -

Thank you for your support 🎉

-

Pay-as-you-go subscription must be manually renewed on {subscribedUntil.toLocaleDateString()}

-
- )} - {subscribed && user?.role?.nwc && ( -
- -

Thank you for your support 🎉

-

Recurring subscription will AUTO renew on {subscribedUntil.toLocaleDateString()}

-
- )} - {(!subscribed && !subscriptionExpiredAt) && ( -
- -
- )} - {subscriptionExpiredAt && ( -
- -
- )} - - ) : ( -
- -
- )} +
{!session?.user && (