Skip to content

Commit 065c457

Browse files
committed
SDK: Fix Embed widget container size
1 parent b888413 commit 065c457

File tree

7 files changed

+17
-18
lines changed

7 files changed

+17
-18
lines changed

.changeset/social-showers-see.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Fix Embed container size

apps/dashboard/src/@/components/blocks/BuyAndSwapEmbed.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export function BuyAndSwapEmbed(props: {
6767
}, [props.pageType]);
6868

6969
return (
70-
<div className="bg-card rounded-2xl border overflow-hidden flex flex-col relative z-10 shadow-xl">
70+
<div className="bg-card rounded-2xl border overflow-hidden flex flex-col relative z-10 shadow-xl min-w-0">
7171
<div className="flex gap-2.5 p-4 border-b border-dashed">
7272
<TabButton
7373
label="Swap"

apps/dashboard/src/@/components/blocks/grid-pattern-embed-container.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export function GridPatternEmbedContainer(props: {
44
children: React.ReactNode;
55
}) {
66
return (
7-
<div className="sm:flex sm:justify-center w-full sm:border sm:border-dashed sm:bg-accent/20 sm:py-12 rounded-xl overflow-hidden relative">
7+
<div className="flex justify-center w-full sm:border sm:border-dashed sm:bg-accent/20 sm:py-12 sm:rounded-xl sm:overflow-hidden relative">
88
<GridPattern
99
width={30}
1010
height={30}
@@ -17,7 +17,7 @@ export function GridPatternEmbedContainer(props: {
1717
"linear-gradient(to bottom right,white,transparent,transparent)",
1818
}}
1919
/>
20-
<div className="z-10">{props.children}</div>
20+
<div className="z-10 min-w-0">{props.children}</div>
2121
</div>
2222
);
2323
}

apps/dashboard/src/app/bridge/components/client/UniversalBridgeEmbed.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@ export function UniversalBridgeEmbed({
1616
const chain = useV5DashboardChain(chainId || 1);
1717

1818
return (
19-
<div className="w-full lg:w-[400px]">
20-
<BuyAndSwapEmbed
21-
chain={chain}
22-
buyAmount={amount}
23-
tokenAddress={token?.address}
24-
pageType="bridge"
25-
/>
26-
</div>
19+
<BuyAndSwapEmbed
20+
chain={chain}
21+
buyAmount={amount}
22+
tokenAddress={token?.address}
23+
pageType="bridge"
24+
/>
2725
);
2826
}

apps/dashboard/src/app/bridge/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export default async function BridgePage({
5454
<div className="grow flex flex-col relative overflow-hidden">
5555
<PageHeader />
5656

57-
<div className="flex grow flex-col items-center justify-center py-36 px-4 min-h-dvh relative overflow-hidden">
57+
<div className="flex grow items-center justify-center py-36 px-4 min-h-dvh relative overflow-hidden">
5858
<DotsBackgroundPattern />
5959
<UniversalBridgeEmbed
6060
amount={amount as string}

packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,8 +479,7 @@ export const EmbedContainer = /* @__PURE__ */ StyledDiv<{
479479
lineHeight: "normal",
480480
overflow: "hidden",
481481
position: "relative",
482-
width: "100vw",
483-
maxWidth:
484-
modalSize === "compact" ? modalMaxWidthCompact : modalMaxWidthWide,
482+
maxWidth: "100%",
483+
width: modalSize === "compact" ? modalMaxWidthCompact : modalMaxWidthWide,
485484
};
486485
});

packages/thirdweb/src/stories/ConnectEmbed.stories.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ import { storyClient } from "./utils.js";
77

88
const meta: Meta<typeof ConnectEmbed> = {
99
title: "Connect/ConnectEmbed",
10-
parameters: {
11-
layout: "centered",
12-
},
1310
decorators: [
1411
(Story) => {
1512
return (

0 commit comments

Comments
 (0)