Remove Pay settings tab in project/connect (#4676)
## Problem solved
Short description of the bug fixed or feature added
<!-- start pr-codex -->
---
## PR-Codex overview
The focus of this PR is to update the `PayPageUI` component to use `clientId` instead of `apiKey` for simplicity and clarity.
### Detailed summary
- Updated `PayPageUI` component to accept `clientId` as a string instead of `apiKey`
- Removed unnecessary fields from `apiKey` object
- Updated references to `props.apiKey.key` to `props.clientId` in `PayPageUI` component
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
This commit is contained in:
@@ -1,24 +1,12 @@
|
||||
"use client";
|
||||
|
||||
import { TabButtons } from "@/components/ui/tabs";
|
||||
import type { ApiKey } from "@3rdweb-sdk/react/hooks/useApi";
|
||||
import { PayAnalytics } from "components/pay/PayAnalytics/PayAnalytics";
|
||||
import { PayConfig } from "components/pay/PayConfig";
|
||||
import { useState } from "react";
|
||||
import { WebhooksPage } from "../../../../../(dashboard)/dashboard/connect/pay/components/webhooks.client";
|
||||
|
||||
export function PayPageUI(props: {
|
||||
apiKey: Pick<
|
||||
ApiKey,
|
||||
| "key"
|
||||
| "services"
|
||||
| "id"
|
||||
| "name"
|
||||
| "domains"
|
||||
| "bundleIds"
|
||||
| "services"
|
||||
| "redirectUrls"
|
||||
>;
|
||||
clientId: string;
|
||||
}) {
|
||||
const [activeTab, setActiveTab] = useState<
|
||||
"settings" | "analytics" | "webhooks"
|
||||
@@ -42,22 +30,13 @@ export function PayPageUI(props: {
|
||||
onClick: () => setActiveTab("webhooks"),
|
||||
isEnabled: true,
|
||||
},
|
||||
{
|
||||
name: "Settings",
|
||||
isActive: activeTab === "settings",
|
||||
onClick: () => setActiveTab("settings"),
|
||||
isEnabled: true,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* TODO: split this into sub-pages */}
|
||||
{activeTab === "analytics" && (
|
||||
<PayAnalytics clientId={props.apiKey.key} />
|
||||
)}
|
||||
{activeTab === "settings" && <PayConfig apiKey={props.apiKey} />}
|
||||
{activeTab === "webhooks" && <WebhooksPage clientId={props.apiKey.key} />}
|
||||
{activeTab === "analytics" && <PayAnalytics clientId={props.clientId} />}
|
||||
{activeTab === "webhooks" && <WebhooksPage clientId={props.clientId} />}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -40,12 +40,7 @@ export default async function Page(props: {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<PayPageUI
|
||||
apiKey={{
|
||||
...project,
|
||||
key: project.publishableKey, // clientId
|
||||
}}
|
||||
/>
|
||||
<PayPageUI clientId={project.publishableKey} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user