mirror of
https://github.com/ahmadk953/tasko.git
synced 2025-01-31 00:53:37 +00:00
General Updates
This commit is contained in:
parent
d4586b1fa5
commit
beb661143b
4 changed files with 12 additions and 7 deletions
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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.
|
||||
|
@ -25,9 +26,9 @@ declare global {
|
|||
|
||||
// Custom events, for useBroadcastEvent, useEventListener
|
||||
RoomEvent: {};
|
||||
// Example has two events, using a union
|
||||
// | { type: "PLAY" }
|
||||
// | { type: "REACTION"; emoji: "🔥" };
|
||||
// Example has two events, using a union
|
||||
// | { type: "PLAY" }
|
||||
// | { type: "REACTION"; emoji: "🔥" };
|
||||
|
||||
// Custom metadata set on threads, for useThreads, useCreateThread, etc.
|
||||
ThreadMetadata: {
|
||||
|
|
Loading…
Reference in a new issue