From f344fb5fbd553881b5f4ec5dbc7f6de879f7e1ca Mon Sep 17 00:00:00 2001 From: MananTank Date: Mon, 5 Jan 2026 21:40:36 +0000 Subject: [PATCH] [MNY-351] Portal: Add swap widget iframe docs (#8604) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ## PR-Codex overview This PR enhances the `Swap Widget` functionality by adding an `iframe` integration option and a new `React Component`. It updates documentation and examples for better usability and expands features like dark/light mode support and customizable token selections. ### Detailed summary - Added `links` for `React Component` and `Iframe` in `sidebar.tsx`. - Introduced `IframeCodePreview` component in `iframe-code-preview.tsx`. - Updated `page.mdx` for `iframe` integration with features and examples. - Revised `page.mdx` for `react` with improved descriptions and features. - Enhanced API reference and examples for token selection configurations. - Added iframe event listening instructions for swap results. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` --- apps/portal/src/app/bridge/sidebar.tsx | 10 ++ .../iframe/iframe-code-preview.tsx | 34 ++++ .../app/bridge/swap-widget/iframe/page.mdx | 168 ++++++++++++++++++ .../src/app/bridge/swap-widget/page.mdx | 133 +++----------- .../src/app/bridge/swap-widget/react/page.mdx | 155 ++++++++++++++++ 5 files changed, 389 insertions(+), 111 deletions(-) create mode 100644 apps/portal/src/app/bridge/swap-widget/iframe/iframe-code-preview.tsx create mode 100644 apps/portal/src/app/bridge/swap-widget/iframe/page.mdx create mode 100644 apps/portal/src/app/bridge/swap-widget/react/page.mdx diff --git a/apps/portal/src/app/bridge/sidebar.tsx b/apps/portal/src/app/bridge/sidebar.tsx index 37e4fb4e929..f26740aed07 100644 --- a/apps/portal/src/app/bridge/sidebar.tsx +++ b/apps/portal/src/app/bridge/sidebar.tsx @@ -57,6 +57,16 @@ export const sidebar: SideBar = { { name: "Swap Widget", href: `${bridgeSlug}/swap-widget`, + links: [ + { + href: `${bridgeSlug}/swap-widget/react`, + name: "React Component", + }, + { + href: `${bridgeSlug}/swap-widget/iframe`, + name: "Iframe", + }, + ], }, ], }, diff --git a/apps/portal/src/app/bridge/swap-widget/iframe/iframe-code-preview.tsx b/apps/portal/src/app/bridge/swap-widget/iframe/iframe-code-preview.tsx new file mode 100644 index 00000000000..dfc87958968 --- /dev/null +++ b/apps/portal/src/app/bridge/swap-widget/iframe/iframe-code-preview.tsx @@ -0,0 +1,34 @@ +import { CodeBlock, Tabs, TabsContent, TabsList, TabsTrigger } from "@doc"; + +export function IframeCodePreview(props: { src: string }) { + return ( + + + Code + Preview + + + `} + lang="html" + /> + + +