From c1275a5e3893685cf2832dcdae4ce39c01e286db Mon Sep 17 00:00:00 2001 From: MananTank Date: Wed, 7 Jan 2026 20:23:14 +0000 Subject: [PATCH] [MNY-354] Portal: Add Buy Widget iframe docs (#8614) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ## PR-Codex overview This PR introduces the `Buy Widget`, enhancing the portal with a new iframe component for purchasing crypto. It includes documentation, features, and examples for users to integrate the widget easily. ### Detailed summary - Added `IframeCodePreview` component in `iframe-code-preview.tsx`. - Updated sidebar links to reflect the new `Buy Widget` and `Swap Widget`. - Created documentation for the `Buy Widget` in `page.mdx`, detailing features and integration. - Added example usage of the `BuyWidget` component in `react/page.mdx`. - Developed `iframe/page.mdx` with customization options and event listening for the widget. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` ## Summary by CodeRabbit * **New Features** * Added an iframe embed preview with code/preview tabs for trying the Buy widget. * **Documentation** * Added comprehensive Buy widget docs (overview, React and iframe guides, examples, customization, event listening, live playgrounds). * **Chores** * Updated site navigation: Widgets section reorganized to list Swap, Buy, and Checkout widgets with updated links. ✏️ Tip: You can customize this high-level summary in your review settings. --- .../buy-widget/iframe/iframe-code-preview.tsx | 36 ++++ .../src/app/bridge/buy-widget/iframe/page.mdx | 168 ++++++++++++++++++ .../portal/src/app/bridge/buy-widget/page.mdx | 61 +++++++ .../src/app/bridge/buy-widget/react/page.mdx | 127 +++++++++++++ apps/portal/src/app/bridge/sidebar.tsx | 30 +++- 5 files changed, 414 insertions(+), 8 deletions(-) create mode 100644 apps/portal/src/app/bridge/buy-widget/iframe/iframe-code-preview.tsx create mode 100644 apps/portal/src/app/bridge/buy-widget/iframe/page.mdx create mode 100644 apps/portal/src/app/bridge/buy-widget/page.mdx create mode 100644 apps/portal/src/app/bridge/buy-widget/react/page.mdx diff --git a/apps/portal/src/app/bridge/buy-widget/iframe/iframe-code-preview.tsx b/apps/portal/src/app/bridge/buy-widget/iframe/iframe-code-preview.tsx new file mode 100644 index 00000000000..5b2375bb4d9 --- /dev/null +++ b/apps/portal/src/app/bridge/buy-widget/iframe/iframe-code-preview.tsx @@ -0,0 +1,36 @@ +import { CodeBlock, Tabs, TabsContent, TabsList, TabsTrigger } from "@doc"; + +export function IframeCodePreview(props: { src: string }) { + const includesImage = props.src.includes("image="); + const height = includesImage ? "850px" : "700px"; + return ( + + + Code + Preview + + + `} + lang="html" + /> + + +