From 9633a0ba85f931050cf2eb62be5368deff91f47a Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Fri, 19 Sep 2025 11:38:03 -0400 Subject: [PATCH] temp fix for main poduction builds (zustand state commented out) (#832) --- .../src/components/signaled/TopBar/TopBar.tsx | 9 +++--- frontend/apps/editor3d/tsconfig.json | 30 +++++++++---------- .../components/pricing-modal/package.json | 3 -- .../pricing-modal/src/lib/credits-modal.tsx | 24 +++++++-------- .../pricing-modal/src/lib/pricing-modal.tsx | 8 +++-- .../src/lib/panes/BillingSettingsPane.tsx | 29 ++++++++++-------- frontend/package-lock.json | 5 +--- 7 files changed, 55 insertions(+), 53 deletions(-) diff --git a/frontend/apps/editor3d/app/src/components/signaled/TopBar/TopBar.tsx b/frontend/apps/editor3d/app/src/components/signaled/TopBar/TopBar.tsx index f703e76ca6..10907d2ebf 100644 --- a/frontend/apps/editor3d/app/src/components/signaled/TopBar/TopBar.tsx +++ b/frontend/apps/editor3d/app/src/components/signaled/TopBar/TopBar.tsx @@ -156,12 +156,13 @@ export const TopBar = ({ pageName, loginSignUpPressed }: Props) => { const creditsStore = useCreditsState(); const sumTotalCredits = creditsStore.totalCredits; - const subscriptionStore = useSubscriptionState(); - const hasPaidPlan = subscriptionStore.hasPaidPlan(); + //const subscriptionStore = useSubscriptionState(); + //const hasPaidPlan = subscriptionStore.hasPaidPlan(); + const hasPaidPlan = false; useEffect(() => { creditsStore.fetchFromServer(); - subscriptionStore.fetchFromServer(); + //subscriptionStore.fetchFromServer(); }, []); useCreditsBalanceChangedEvent(async () => { @@ -169,7 +170,7 @@ export const TopBar = ({ pageName, loginSignUpPressed }: Props) => { }); useSubscriptionPlanChangedEvent(async () => { - subscriptionStore.fetchFromServer(); + //subscriptionStore.fetchFromServer(); }); const disableTabSwitcher = () => { diff --git a/frontend/apps/editor3d/tsconfig.json b/frontend/apps/editor3d/tsconfig.json index 21d77afc73..92a5fce868 100644 --- a/frontend/apps/editor3d/tsconfig.json +++ b/frontend/apps/editor3d/tsconfig.json @@ -52,9 +52,6 @@ { "path": "../../libs/components/button-dropdown" }, - { - "path": "../../libs/components/pricing-modal" - }, { "path": "../../libs/components/toaster" }, @@ -86,16 +83,25 @@ "path": "../../libs/model-list" }, { - "path": "../../libs/components/popover" + "path": "../../libs/common" }, { - "path": "../../libs/common" + "path": "../../libs/state/subscription" }, { "path": "../../libs/state/credits" }, { - "path": "../../libs/state/subscription" + "path": "../../libs/tauri-events" + }, + { + "path": "../../libs/components/pricing-modal" + }, + { + "path": "../../libs/components/provider-billing-modal" + }, + { + "path": "../../libs/components/provider-setup-modal" }, { "path": "../../libs/analytics/google-analytics" @@ -109,6 +115,9 @@ { "path": "../../libs/components/settings-modal" }, + { + "path": "../../libs/components/popover" + }, { "path": "../../libs/components/gravatar" }, @@ -121,12 +130,6 @@ { "path": "../../libs/components/upload-modal" }, - { - "path": "../../libs/components/provider-setup-modal" - }, - { - "path": "../../libs/components/provider-billing-modal" - }, { "path": "../../libs/components/modal" }, @@ -148,9 +151,6 @@ { "path": "../../libs/tauri-utils" }, - { - "path": "../../libs/tauri-events" - }, { "path": "../../libs/api" } diff --git a/frontend/libs/components/pricing-modal/package.json b/frontend/libs/components/pricing-modal/package.json index 74dd45d00a..f4f702c199 100644 --- a/frontend/libs/components/pricing-modal/package.json +++ b/frontend/libs/components/pricing-modal/package.json @@ -13,8 +13,5 @@ "import": "./dist/index.js", "default": "./dist/index.js" } - }, - "dependencies": { - "@tauri-apps/api": "^2.4.0" } } diff --git a/frontend/libs/components/pricing-modal/src/lib/credits-modal.tsx b/frontend/libs/components/pricing-modal/src/lib/credits-modal.tsx index ce3b9088c0..c398d635d5 100644 --- a/frontend/libs/components/pricing-modal/src/lib/credits-modal.tsx +++ b/frontend/libs/components/pricing-modal/src/lib/credits-modal.tsx @@ -99,23 +99,23 @@ export function CreditsModal({ }; const cardBase = - "relative rounded-xl border p-6 h-full flex flex-col justify-between bg-ui-panel border-ui-panel-border hover:bg-ui-controls/10 transition-all"; + "relative rounded-xl border p-6 h-full flex flex-col justify-between bg-[#1F1F1F] border-white/10 hover:border-white/20 transition-all"; return ( {})} - className="rounded-xl bg-ui-panel border border-ui-panel-border max-h-[90vh] max-w-screen-2xl overflow-y-auto flex flex-col" + className="rounded-xl bg-[#1A1A1A] max-h-[90vh] max-w-screen-2xl overflow-y-auto flex flex-col" allowBackgroundInteraction={false} showClose={true} closeOnOutsideClick={true} resizable={false} - backdropClassName="" + backdropClassName="bg-black/80" > -
+
-

Buy credits

-

+

Buy credits

+

Choose a one-time credits package. No subscription required.

@@ -124,7 +124,7 @@ export function CreditsModal({ {creditPacks.map((pack) => (
{pack.badge && ( -
+
{pack.badge}
)} @@ -132,7 +132,7 @@ export function CreditsModal({
-
+
{pack.bonus > 0 && ( -
+
Total: {pack.base.toLocaleString()} {" + "} - + {pack.bonus.toLocaleString()} Bonus
@@ -150,12 +150,12 @@ export function CreditsModal({
-
+
${pack.priceUsd}
diff --git a/frontend/libs/components/pricing-modal/src/lib/pricing-modal.tsx b/frontend/libs/components/pricing-modal/src/lib/pricing-modal.tsx index db9ce83882..8aab0208e1 100644 --- a/frontend/libs/components/pricing-modal/src/lib/pricing-modal.tsx +++ b/frontend/libs/components/pricing-modal/src/lib/pricing-modal.tsx @@ -30,11 +30,13 @@ interface PricingModalProps {} export function PricingModal({}: PricingModalProps = {}) { const { isOpen, closeModal } = usePricingModalStore(); - const subscriptionStore = useSubscriptionState(); + //const subscriptionStore = useSubscriptionState(); - const hasActiveSub = subscriptionStore.hasPaidPlan(); + //const hasActiveSub = subscriptionStore.hasPaidPlan(); + const hasActiveSub = false; - const activePlanId = subscriptionStore.subscriptionInfo?.productSlug; + //const activePlanId = subscriptionStore.subscriptionInfo?.productSlug; + const activePlanId = "free"; const [billingType, setBillingType] = useState("yearly"); const isYearly = billingType === "yearly"; diff --git a/frontend/libs/components/settings-modal/src/lib/panes/BillingSettingsPane.tsx b/frontend/libs/components/settings-modal/src/lib/panes/BillingSettingsPane.tsx index 5415612b6c..008ab91d3f 100644 --- a/frontend/libs/components/settings-modal/src/lib/panes/BillingSettingsPane.tsx +++ b/frontend/libs/components/settings-modal/src/lib/panes/BillingSettingsPane.tsx @@ -23,31 +23,36 @@ interface BillingSettingsPaneProps {} export const BillingSettingsPane = (args: BillingSettingsPaneProps) => { const { toggleModal: toggleSubscriptionModal } = usePricingModalStore(); - const creditsStore = useCreditsState(); - const sumTotalCredits = creditsStore.totalCredits; + //const creditsStore = useCreditsState(); + //const sumTotalCredits = creditsStore.totalCredits; + const sumTotalCredits = 100; - const subscriptionStore = useSubscriptionState(); + //const subscriptionStore = useSubscriptionState(); - const maybePlanSlug = subscriptionStore.subscriptionInfo?.productSlug; + //const maybePlanSlug = subscriptionStore.subscriptionInfo?.productSlug; + const maybePlanSlug = "free"; const currentPlanDetails: SubscriptionPlanDetails = maybePlanSlug ? SUBSCRIPTION_PLANS_BY_SLUG.get(maybePlanSlug) || FREE_PLAN : FREE_PLAN; - const canCancelPlan = subscriptionStore.canCancelPlan(); + //const canCancelPlan = subscriptionStore.canCancelPlan(); + const canCancelPlan = false; - const nextBillAt = - subscriptionStore.subscriptionInfo?.nextBillAt?.toLocaleDateString(); - const subscriptionEndAt = - subscriptionStore.subscriptionInfo?.subscriptionEndAt?.toLocaleDateString(); + //const nextBillAt = + // subscriptionStore.subscriptionInfo?.nextBillAt?.toLocaleDateString(); + const nextBillAt = ""; + //const subscriptionEndAt = + // subscriptionStore.subscriptionInfo?.subscriptionEndAt?.toLocaleDateString(); + const subscriptionEndAt = ""; const changeOrUpgradePlanButtonLabel = canCancelPlan ? "Change plan" : "Upgrade plan"; useEffect(() => { - creditsStore.fetchFromServer(); - subscriptionStore.fetchFromServer(); + //creditsStore.fetchFromServer(); + //subscriptionStore.fetchFromServer(); }, []); return ( @@ -118,7 +123,7 @@ export const BillingSettingsPane = (args: BillingSettingsPaneProps) => {
- + {/**/}
diff --git a/frontend/package-lock.json b/frontend/package-lock.json index f32446f863..1ee11f3c9c 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1291,10 +1291,7 @@ }, "libs/components/pricing-modal": { "name": "@storyteller/ui-pricing-modal", - "version": "0.0.1", - "dependencies": { - "@tauri-apps/api": "^2.4.0" - } + "version": "0.0.1" }, "libs/components/progress": { "name": "@storyteller/ui-progress",