Skip to content

Commit c4ea11f

Browse files
committed
wip: zen
1 parent b8337cd commit c4ea11f

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

packages/console/app/src/routes/black/index.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
1-
import { A, useSearchParams } from "@solidjs/router"
1+
import { A, createAsync, query, useSearchParams } from "@solidjs/router"
22
import { Title } from "@solidjs/meta"
33
import { createMemo, createSignal, For, Match, onMount, Show, Switch } from "solid-js"
44
import { PlanIcon, plans } from "./common"
55
import { useI18n } from "~/context/i18n"
66
import { useLanguage } from "~/context/language"
7+
import { Resource } from "@opencode-ai/console-resource"
78

8-
const paused = true
9+
const getPaused = query(async () => {
10+
"use server"
11+
return Resource.App.stage === "production"
12+
}, "black.paused")
913

1014
export default function Black() {
1115
const [params] = useSearchParams()
1216
const i18n = useI18n()
1317
const language = useLanguage()
18+
const paused = createAsync(() => getPaused())
1419
const [selected, setSelected] = createSignal<string | null>((params.plan as string) || null)
1520
const [mounted, setMounted] = createSignal(false)
1621
const selectedPlan = createMemo(() => plans.find((p) => p.id === selected()))
@@ -44,7 +49,7 @@ export default function Black() {
4449
<>
4550
<Title>{i18n.t("black.title")}</Title>
4651
<section data-slot="cta">
47-
<Show when={!paused} fallback={<p data-slot="paused">{i18n.t("black.paused")}</p>}>
52+
<Show when={!paused()} fallback={<p data-slot="paused">{i18n.t("black.paused")}</p>}>
4853
<Switch>
4954
<Match when={!selected()}>
5055
<div data-slot="pricing">
@@ -108,7 +113,7 @@ export default function Black() {
108113
</Match>
109114
</Switch>
110115
</Show>
111-
<Show when={!paused}>
116+
<Show when={!paused()}>
112117
<p data-slot="fine-print" style={{ "view-transition-name": "fine-print" }}>
113118
{i18n.t("black.finePrint.beforeTerms")} ·{" "}
114119
<A href={language.route("/legal/terms-of-service")}>{i18n.t("black.finePrint.terms")}</A>

packages/console/app/src/routes/black/_subscribe/[plan].tsx renamed to packages/console/app/src/routes/black/subscribe/[plan].tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ import { Billing } from "@opencode-ai/console-core/billing.js"
1717
import { useI18n } from "~/context/i18n"
1818
import { useLanguage } from "~/context/language"
1919
import { formError } from "~/lib/form-error"
20+
import { Resource } from "@opencode-ai/console-resource"
21+
22+
const getEnabled = query(async () => {
23+
"use server"
24+
return Resource.App.stage !== "production"
25+
}, "black.subscribe.enabled")
2026

2127
const plansMap = Object.fromEntries(plans.map((p) => [p.id, p])) as Record<PlanID, (typeof plans)[number]>
2228
const stripePromise = loadStripe(import.meta.env.VITE_STRIPE_PUBLISHABLE_KEY!)
@@ -269,6 +275,7 @@ export default function BlackSubscribe() {
269275
const params = useParams()
270276
const i18n = useI18n()
271277
const language = useLanguage()
278+
const enabled = createAsync(() => getEnabled())
272279
const planData = plansMap[(params.plan as PlanID) ?? "20"] ?? plansMap["20"]
273280
const plan = planData.id
274281

@@ -359,7 +366,7 @@ export default function BlackSubscribe() {
359366
}
360367

361368
return (
362-
<>
369+
<Show when={enabled()}>
363370
<Title>{i18n.t("black.subscribe.title")}</Title>
364371
<section data-slot="subscribe-form">
365372
<div data-slot="form-card">
@@ -472,6 +479,6 @@ export default function BlackSubscribe() {
472479
<A href={language.route("/legal/terms-of-service")}>{i18n.t("black.finePrint.terms")}</A>
473480
</p>
474481
</section>
475-
</>
482+
</Show>
476483
)
477484
}

0 commit comments

Comments
 (0)