summaryrefslogtreecommitdiffhomepage
path: root/cloud/app/src/component
diff options
context:
space:
mode:
authorJay V <[email protected]>2025-09-16 19:39:34 -0400
committerJay V <[email protected]>2025-09-16 19:39:36 -0400
commit9f46068c5708d7e83163cd06b40c27ed46d4712f (patch)
treed97b9a4a023c15b5e65b9f221234d2baf78fdbfd /cloud/app/src/component
parent479cf2fa4f5f84e330ca4d02601d0d81234811d0 (diff)
downloadopencode-9f46068c5708d7e83163cd06b40c27ed46d4712f.tar.gz
opencode-9f46068c5708d7e83163cd06b40c27ed46d4712f.zip
ignore: mobile styles zen
Diffstat (limited to 'cloud/app/src/component')
-rw-r--r--cloud/app/src/component/workspace/billing-section.module.css13
-rw-r--r--cloud/app/src/component/workspace/billing-section.tsx39
-rw-r--r--cloud/app/src/component/workspace/monthly-limit-section.module.css4
3 files changed, 56 insertions, 0 deletions
diff --git a/cloud/app/src/component/workspace/billing-section.module.css b/cloud/app/src/component/workspace/billing-section.module.css
index 58589de73..0bb5709cb 100644
--- a/cloud/app/src/component/workspace/billing-section.module.css
+++ b/cloud/app/src/component/workspace/billing-section.module.css
@@ -39,6 +39,10 @@
min-width: 14.5rem;
width: fit-content;
+ @media (max-width: 30rem) {
+ width: 100%;
+ }
+
[data-slot="credit-card"] {
padding: var(--space-3-5) var(--space-4);
background-color: var(--color-bg-surface);
@@ -50,6 +54,7 @@
[data-slot="card-icon"] {
display: flex;
align-items: center;
+ color: var(--color-text-muted);
}
[data-slot="card-details"] {
@@ -78,6 +83,14 @@
gap: var(--space-2);
align-items: center;
+ @media (max-width: 30rem) {
+ flex-direction: column;
+
+ > button {
+ width: 100%;
+ }
+ }
+
[data-slot="create-form"] {
margin: 0;
}
diff --git a/cloud/app/src/component/workspace/billing-section.tsx b/cloud/app/src/component/workspace/billing-section.tsx
index c16208d31..ec314d9ef 100644
--- a/cloud/app/src/component/workspace/billing-section.tsx
+++ b/cloud/app/src/component/workspace/billing-section.tsx
@@ -38,6 +38,7 @@ const getBillingInfo = query(async (workspaceID: string) => {
export function BillingSection() {
const params = useParams()
+ // ORIGINAL CODE - COMMENTED OUT FOR TESTING
const balanceInfo = createAsync(() => getBillingInfo(params.id))
const createCheckoutUrlAction = useAction(createCheckoutUrl)
const createCheckoutUrlSubmission = useSubmission(createCheckoutUrl)
@@ -46,6 +47,44 @@ export function BillingSection() {
const disableReloadSubmission = useSubmission(disableReload)
const reloadSubmission = useSubmission(reload)
+ // DUMMY DATA FOR TESTING - UNCOMMENT ONE OF THE SCENARIOS BELOW
+
+ // Scenario 1: User has not added billing details and has no balance
+ // const balanceInfo = () => ({
+ // balance: 0,
+ // paymentMethodLast4: null as string | null,
+ // reload: false,
+ // reloadError: null as string | null,
+ // timeReloadError: null as Date | null,
+ // })
+
+ // Scenario 2: User has not added billing details but has a balance
+ // const balanceInfo = () => ({
+ // balance: 1500000000, // $15.00
+ // paymentMethodLast4: null as string | null,
+ // reload: false,
+ // reloadError: null as string | null,
+ // timeReloadError: null as Date | null
+ // })
+
+ // Scenario 3: User has added billing details (reload enabled)
+ // const balanceInfo = () => ({
+ // balance: 750000000, // $7.50
+ // paymentMethodLast4: "4242",
+ // reload: true,
+ // reloadError: null as string | null,
+ // timeReloadError: null as Date | null
+ // })
+
+ // Scenario 4: User has billing details but reload failed
+ // const balanceInfo = () => ({
+ // balance: 250000000, // $2.50
+ // paymentMethodLast4: "4242",
+ // reload: true,
+ // reloadError: "Your card was declined." as string,
+ // timeReloadError: new Date(Date.now() - 3600000) as Date // 1 hour ago
+ // })
+
const balanceAmount = createMemo(() => {
return ((balanceInfo()?.balance ?? 0) / 100000000).toFixed(2)
})
diff --git a/cloud/app/src/component/workspace/monthly-limit-section.module.css b/cloud/app/src/component/workspace/monthly-limit-section.module.css
index ebfd8e33a..02de058e4 100644
--- a/cloud/app/src/component/workspace/monthly-limit-section.module.css
+++ b/cloud/app/src/component/workspace/monthly-limit-section.module.css
@@ -15,6 +15,10 @@
min-width: 15rem;
width: fit-content;
+ @media (max-width: 30rem) {
+ width: 100%;
+ }
+
[data-slot="amount"] {
padding: var(--space-3-5) var(--space-4);
background-color: var(--color-bg-surface);