mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-16 14:52:31 +00:00
uncomment
This commit is contained in:
1 parent
fb57899c19
commit
6135ff0d26
3 files changed
+9
-19
No files matched your search
@@ -82,14 +82,12 @@ export function CreditsModal({
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
await invoke("storyteller_open_credits_purchase_command", {
|
||||
request: {
|
||||
credits_pack: pack.id,
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Hook up Stripe/checkout here
|
||||
// Example: redirect to checkout with pack.priceId
|
||||
// await stripe.redirectToCheckout({ lineItems: [{ price: pack.priceId, quantity: 1 }], mode: 'payment', ... })
|
||||
|
||||
@@ -30,13 +30,11 @@ interface PricingModalProps {}
|
||||
export function PricingModal({}: PricingModalProps = {}) {
|
||||
const { isOpen, closeModal } = usePricingModalStore();
|
||||
|
||||
//const subscriptionStore = useSubscriptionState();
|
||||
const subscriptionStore = useSubscriptionState();
|
||||
|
||||
//const hasActiveSub = subscriptionStore.hasPaidPlan();
|
||||
const hasActiveSub = false;
|
||||
const hasActiveSub = subscriptionStore.hasPaidPlan();
|
||||
|
||||
//const activePlanId = subscriptionStore.subscriptionInfo?.productSlug;
|
||||
const activePlanId = "free";
|
||||
const activePlanId = subscriptionStore.subscriptionInfo?.productSlug;
|
||||
|
||||
const [billingType, setBillingType] = useState("yearly");
|
||||
const isYearly = billingType === "yearly";
|
||||
|
||||
@@ -27,24 +27,18 @@ export const BillingSettingsPane = (args: BillingSettingsPaneProps) => {
|
||||
|
||||
const sumTotalCredits = creditsStore.totalCredits;
|
||||
|
||||
//const subscriptionStore = useSubscriptionState();
|
||||
const subscriptionStore = useSubscriptionState();
|
||||
|
||||
//const maybePlanSlug = subscriptionStore.subscriptionInfo?.productSlug;
|
||||
const maybePlanSlug = "free";
|
||||
const maybePlanSlug = subscriptionStore.subscriptionInfo?.productSlug;
|
||||
|
||||
const currentPlanDetails: SubscriptionPlanDetails = maybePlanSlug
|
||||
? SUBSCRIPTION_PLANS_BY_SLUG.get(maybePlanSlug) || FREE_PLAN
|
||||
: FREE_PLAN;
|
||||
|
||||
//const canCancelPlan = subscriptionStore.canCancelPlan();
|
||||
const canCancelPlan = false;
|
||||
const canCancelPlan = subscriptionStore.canCancelPlan();
|
||||
|
||||
//const nextBillAt =
|
||||
// subscriptionStore.subscriptionInfo?.nextBillAt?.toLocaleDateString();
|
||||
const nextBillAt = "";
|
||||
//const subscriptionEndAt =
|
||||
// subscriptionStore.subscriptionInfo?.subscriptionEndAt?.toLocaleDateString();
|
||||
const subscriptionEndAt = "";
|
||||
const nextBillAt = subscriptionStore.subscriptionInfo?.nextBillAt?.toLocaleDateString();
|
||||
const subscriptionEndAt = subscriptionStore.subscriptionInfo?.subscriptionEndAt?.toLocaleDateString();
|
||||
|
||||
const changeOrUpgradePlanButtonLabel = canCancelPlan
|
||||
? "Change plan"
|
||||
@@ -52,7 +46,7 @@ export const BillingSettingsPane = (args: BillingSettingsPaneProps) => {
|
||||
|
||||
useEffect(() => {
|
||||
creditsStore.fetchFromServer();
|
||||
//subscriptionStore.fetchFromServer();
|
||||
subscriptionStore.fetchFromServer();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
||||
Reference in new issue
Block a user