Skip to content

Commit

Permalink
separate payment methods page
Browse files Browse the repository at this point in the history
  • Loading branch information
williamstein committed Dec 10, 2024
1 parent 199fbba commit 1ad67e0
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/packages/frontend/account/account-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { labels } from "@cocalc/frontend/i18n";
import PurchasesPage from "@cocalc/frontend/purchases/purchases-page";
import PayAsYouGoPage from "@cocalc/frontend/purchases/payg-page";
import PaymentsPage from "@cocalc/frontend/purchases/payments-page";
import PaymentMethodsPage from "@cocalc/frontend/purchases/payment-methods-page";
import StatementsPage from "@cocalc/frontend/purchases/statements-page";
import SubscriptionsPage from "@cocalc/frontend/purchases/subscriptions-page";
import { SupportTickets } from "@cocalc/frontend/support";
Expand Down Expand Up @@ -154,6 +155,15 @@ export const AccountPage: React.FC = () => {
),
children: active_page === "payments" && <PaymentsPage />,
});
items.push({
key: "payment-methods",
label: (
<span>
<Icon name="credit-card" /> Payment Methods
</span>
),
children: active_page === "payment-methods" && <PaymentMethodsPage />,
});
items.push({
key: "statements",
label: (
Expand Down
8 changes: 8 additions & 0 deletions src/packages/frontend/purchases/address.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ function StripeAddressElement({ style, onFinished }: { style?; onFinished? }) {
theme: "stripe",
},
loader: "never",
fields: {
phone: "always",
},
validation: {
phone: {
required: "never",
},
},
}}
stripe={loadStripe()}
>
Expand Down
9 changes: 9 additions & 0 deletions src/packages/frontend/purchases/payment-methods-page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import PaymentMethods from "./payment-methods";

export default function PaymentsPage() {
return (
<div>
<PaymentMethods />
</div>
);
}
2 changes: 0 additions & 2 deletions src/packages/frontend/purchases/payments-page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import Payments from "./payments";
import PaymentMethods from "./payment-methods";

export default function PaymentsPage() {
return (
<div>
<PaymentMethods />
<Payments />
</div>
);
Expand Down
5 changes: 5 additions & 0 deletions src/packages/next/components/account/navtab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ export default function AccountNavTab({ style }: Props) {
<A href="/settings/payments">Payments</A>,
"credit-card",
),
menuItem(
"payment-methods",
<A href="/settings/payment-methods">Payment Methods</A>,
"credit-card",
),
menuItem(
"statements",
<A href="/settings/statements">Statements</A>,
Expand Down

0 comments on commit 1ad67e0

Please sign in to comment.