General Updates

This commit is contained in:
Ahmad 2024-09-27 22:53:25 -04:00
parent d4586b1fa5
commit beb661143b
No known key found for this signature in database
GPG key ID: 8FD8A93530D182BF
4 changed files with 12 additions and 7 deletions

View file

@ -38,7 +38,7 @@ const handler = async (data: InputType): Promise<ReturnType> => {
const stripeSession = await stripe.checkout.sessions.create({
success_url: settingsUrl,
cancel_url: settingsUrl,
// payment_method_types: ['card', 'paypal'],
payment_method_types: ['card', 'paypal'],
mode: 'subscription',
billing_address_collection: 'auto',
customer_email: user.emailAddresses[0].emailAddress,

View file

@ -1,6 +1,7 @@
'use client';
import { toast } from 'sonner';
import { useRouter } from 'next/navigation';
import { stripeRedirect } from '@/actions/stripe-redirect';
import { Button } from '@/components/ui/button';
@ -13,10 +14,11 @@ interface SubscriptionButtonProps {
export const SubscriptionButton = ({ isPro }: SubscriptionButtonProps) => {
const proModal = useProModal();
const router = useRouter();
const { execute, isLoading } = useAction(stripeRedirect, {
onSuccess: (data) => {
window.location.href = data;
router.push(data);
},
onError: (error) => {
toast.error(error);

View file

@ -2,6 +2,7 @@
import Image from 'next/image';
import { toast } from 'sonner';
import { useRouter } from 'next/navigation';
import { Dialog, DialogContent } from '@/components/ui/dialog';
import { useProModal } from '@/hooks/use-pro-modal';
@ -11,10 +12,11 @@ import { stripeRedirect } from '@/actions/stripe-redirect';
export const ProModal = () => {
const proModal = useProModal();
const router = useRouter();
const { execute, isLoading } = useAction(stripeRedirect, {
onSuccess: (data) => {
window.location.href = data;
router.push(data);
},
onError: (error) => {
toast.error(error);

View file

@ -4,7 +4,8 @@ declare global {
interface Liveblocks {
// Each user's Presence, for useMyPresence, useOthers, etc.
Presence: {
cursor: { x: number; y: number } | null;
// Example, real-time cursor coordinates
cursor: { x: number; y: number };
};
// The Storage tree for the room, for useMutation, useStorage, etc.