mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-10 14:41:49 +02:00
💳 Support payments with Stripe (#822)
This commit is contained in:
parent
969ae35971
commit
6f425edeaa
20 changed files with 712 additions and 229 deletions
|
@ -1,11 +1,9 @@
|
|||
import { trpc } from "@rallly/backend";
|
||||
|
||||
export const usePlan = () => {
|
||||
const { data } = trpc.user.getBilling.useQuery(undefined, {
|
||||
staleTime: 10 * 1000,
|
||||
});
|
||||
const { data } = trpc.user.subscription.useQuery();
|
||||
|
||||
const isPaid = Boolean(data && data.endDate.getTime() > Date.now());
|
||||
const isPaid = data?.active === true;
|
||||
|
||||
return isPaid ? "paid" : "free";
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue