Skip to content

Commit 8fdef82

Browse files
committed
[Playground] Fix: Filter UB Backend API for only GETs (#6604)
<!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on enhancing the layout and functionality of the `Page` component in `apps/playground-web/src/app/connect/pay/backend/page.tsx`. It improves the presentation of the Universal Bridge REST API information and adds a link to view all endpoints. ### Detailed summary - Wrapped the header and description in a `div` for better layout. - Added a `Link` component with a button to "View all endpoints". - Changed the title of the `BlueprintSection` from "Available endpoints" to "Available GET endpoints". - Updated the filtering of `blueprints` to only include those with defined `get` properties. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent cbb1569 commit 8fdef82

File tree

1 file changed

+31
-18
lines changed
  • apps/playground-web/src/app/connect/pay/backend

1 file changed

+31
-18
lines changed

apps/playground-web/src/app/connect/pay/backend/page.tsx

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Button } from "@/components/ui/button";
12
import { Table, TableBody, TableCell, TableRow } from "@/components/ui/table";
23
import Link from "next/link";
34
import { getBridgePaths } from "./utils";
@@ -7,27 +8,39 @@ export default async function Page() {
78
const paths = await getBridgePaths();
89
return (
910
<div className="pb-20">
10-
<h2 className="mb-2 font-semibold text-2xl tracking-tight">
11-
Universal Bridge REST API
12-
</h2>
13-
<p className="mb-5 text-muted-foreground">
14-
Directly interact with the Universal Bridge API from your backend,
15-
using standard REST api.
16-
</p>
11+
<div className="flex flex-col justify-between py-6 md:flex-row md:gap-8">
12+
<div>
13+
<h2 className="mb-2 font-semibold text-2xl tracking-tight">
14+
Universal Bridge REST API
15+
</h2>
16+
<p className="mb-5 text-muted-foreground">
17+
Directly interact with the Universal Bridge API from your backend,
18+
using standard REST APIs.
19+
</p>
20+
</div>
21+
22+
<Link href="https://bridge.thirdweb.com/reference" target="_blank">
23+
<Button className="max-md:w-full">View all endpoints</Button>
24+
</Link>
25+
</div>
1726

1827
<div className="flex flex-col gap-8">
1928
<BlueprintSection
20-
title="Available endpoints"
21-
blueprints={paths.map(([pathName, pathObj]) => {
22-
if (!pathObj) {
23-
throw new Error(`Path not found: ${pathName}`);
24-
}
25-
return {
26-
name: pathName,
27-
description: pathObj.get?.description || "",
28-
link: `/connect/pay/backend/reference?route=${pathName}`,
29-
};
30-
})}
29+
title="Available GET endpoints"
30+
blueprints={paths
31+
.filter(
32+
([_pathName, pathObj]) => typeof pathObj?.get !== "undefined",
33+
)
34+
.map(([pathName, pathObj]) => {
35+
if (!pathObj) {
36+
throw new Error(`Path not found: ${pathName}`);
37+
}
38+
return {
39+
name: pathName,
40+
description: pathObj.get?.description || "",
41+
link: `/connect/pay/backend/reference?route=${pathName}`,
42+
};
43+
})}
3144
/>
3245
</div>
3346
</div>

0 commit comments

Comments
 (0)