Skip to content

Commit ce52df9

Browse files
committed
update
1 parent f71dfe8 commit ce52df9

11 files changed

+100
-141
lines changed

packages/thirdweb/src/stories/Bridge/CheckoutWidget.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const meta = {
1717
currency: "USD",
1818
},
1919
component: StoryVariant,
20-
title: "Bridge/CheckoutWidget",
20+
title: "Bridge/Checkout/CheckoutWidget",
2121
} satisfies Meta<typeof StoryVariant>;
2222

2323
export default meta;

packages/thirdweb/src/stories/Bridge/ErrorBanner.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const meta: Meta<typeof ErrorBanner> = {
2525
</ModalThemeWrapper>
2626
),
2727
],
28-
title: "Bridge/ErrorBanner",
28+
title: "Bridge/screens/ErrorBanner",
2929
};
3030

3131
export default meta;

packages/thirdweb/src/stories/Bridge/FundWallet.stories.tsx

Lines changed: 0 additions & 63 deletions
This file was deleted.

packages/thirdweb/src/stories/Bridge/PaymentDetails.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const meta: Meta<typeof PaymentDetails> = {
8383
),
8484
],
8585
component: PaymentDetails,
86-
title: "Bridge/PaymentDetails",
86+
title: "Bridge/screens/PaymentDetails",
8787
};
8888

8989
export default meta;

packages/thirdweb/src/stories/Bridge/PaymentSelection.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const meta: Meta<typeof PaymentSelection> = {
3232
),
3333
],
3434
component: PaymentSelection,
35-
title: "Bridge/PaymentSelection",
35+
title: "Bridge/screens/PaymentSelection",
3636
};
3737

3838
export default meta;

packages/thirdweb/src/stories/Bridge/StepRunner.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const meta: Meta<typeof StepRunner> = {
3232
parameters: {
3333
layout: "centered",
3434
},
35-
title: "Bridge/StepRunner",
35+
title: "Bridge/screens/StepRunner",
3636
};
3737

3838
export default meta;

packages/thirdweb/src/stories/Bridge/SuccessScreen.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const meta: Meta<typeof SuccessScreen> = {
8484
</ModalThemeWrapper>
8585
),
8686
],
87-
title: "Bridge/SuccessScreen",
87+
title: "Bridge/screens/SuccessScreen",
8888
};
8989

9090
export default meta;
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import type { Meta } from "@storybook/react";
2+
import { base } from "../../../chains/chain-definitions/base.js";
3+
import { useActiveAccount } from "../../../react/core/hooks/wallets/useActiveAccount.js";
4+
import { useSendTransaction } from "../../../react/web/hooks/transaction/useSendTransaction.js";
5+
import { ConnectButton } from "../../../react/web/ui/ConnectWallet/ConnectButton.js";
6+
import { Button } from "../../../react/web/ui/components/buttons.js";
7+
import { prepareTransaction } from "../../../transaction/prepare-transaction.js";
8+
import { toWei } from "../../../utils/units.js";
9+
import { storyClient } from "../../utils.js";
10+
11+
const meta: Meta<typeof SendEth> = {
12+
component: SendEth,
13+
title: "Bridge/Transaction/useSendTransaction",
14+
};
15+
export default meta;
16+
17+
export function SendEth() {
18+
const sendTx = useSendTransaction();
19+
const account = useActiveAccount();
20+
21+
if (!account) {
22+
return <ConnectButton client={storyClient} />;
23+
}
24+
return (
25+
<Button
26+
variant="primary"
27+
onClick={() => {
28+
const sendFunds = prepareTransaction({
29+
chain: base,
30+
client: storyClient,
31+
to: "0x83Dd93fA5D8343094f850f90B3fb90088C1bB425",
32+
value: toWei("0.001"),
33+
});
34+
35+
sendTx.mutate(sendFunds);
36+
}}
37+
>
38+
{sendTx.isPending ? "Sending..." : "Send 0.01 ETH"}
39+
</Button>
40+
);
41+
}

packages/thirdweb/src/stories/Bridge/UnsupportedTokenScreen.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const meta: Meta<typeof UnsupportedTokenScreen> = {
1111
tokenAddress: NATIVE_TOKEN_ADDRESS,
1212
},
1313
component: UnsupportedTokenScreen,
14-
title: "Bridge/UnsupportedTokenScreen",
14+
title: "Bridge/screens/UnsupportedTokenScreen",
1515
decorators: [
1616
(Story) => (
1717
<ModalThemeWrapper>

packages/thirdweb/src/stories/Bridge/fixtures.ts

Lines changed: 1 addition & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ const contractInteractionTransaction = claimTo({
639639
// ========== COMMON DUMMY DATA FOR STORYBOOK ========== //
640640

641641
// Common receiver addresses for testing
642-
export const RECEIVER_ADDRESSES = {
642+
const RECEIVER_ADDRESSES = {
643643
physical: "0x5555666677778888999900001111222233334444" as const,
644644
primary: "0x2247d5d238d0f9d37184d8332aE0289d1aD9991b" as const,
645645
secondary: "0xa3841994009B4fEabb01ebcC62062F9E56F701CD" as const,
@@ -680,17 +680,6 @@ const PRODUCT_METADATA = {
680680
},
681681
};
682682

683-
type FundWalletUIOptions = {
684-
destinationToken: TokenWithPrices;
685-
metadata: {
686-
description: string | undefined;
687-
title: string | undefined;
688-
image: string | undefined;
689-
};
690-
initialAmount: string | undefined;
691-
buttonLabel: string | undefined;
692-
};
693-
694683
type DirectPaymentUIOptions = {
695684
metadata: {
696685
description: string | undefined;
@@ -711,63 +700,6 @@ type TransactionUIOptions = {
711700
buttonLabel: string | undefined;
712701
};
713702

714-
// UI Options for FundWallet mode
715-
export const FUND_WALLET_UI_OPTIONS: Record<
716-
"ethDefault" | "ethWithAmount" | "usdcDefault" | "uniLarge" | "customButton",
717-
FundWalletUIOptions
718-
> = {
719-
ethDefault: {
720-
destinationToken: ETH,
721-
metadata: {
722-
description: "Add funds to your wallet",
723-
title: "Fund Wallet",
724-
image: undefined,
725-
},
726-
buttonLabel: undefined,
727-
initialAmount: undefined,
728-
},
729-
ethWithAmount: {
730-
destinationToken: ETH,
731-
initialAmount: "0.001",
732-
buttonLabel: undefined,
733-
metadata: {
734-
description: "Add funds to your wallet",
735-
title: "Fund Wallet",
736-
image: undefined,
737-
},
738-
},
739-
uniLarge: {
740-
destinationToken: UNI,
741-
initialAmount: "150000",
742-
buttonLabel: undefined,
743-
metadata: {
744-
description: "Add UNI tokens to your wallet",
745-
title: "Fund Wallet",
746-
image: undefined,
747-
},
748-
},
749-
usdcDefault: {
750-
destinationToken: USDC,
751-
initialAmount: "5",
752-
buttonLabel: undefined,
753-
metadata: {
754-
description: undefined,
755-
title: undefined,
756-
image: undefined,
757-
},
758-
},
759-
customButton: {
760-
destinationToken: ETH,
761-
initialAmount: "0.01",
762-
metadata: {
763-
description: "Test custom button label for funding",
764-
title: "Custom Fund Wallet",
765-
image: undefined,
766-
},
767-
buttonLabel: "Add Funds Now",
768-
},
769-
};
770-
771703
// UI Options for DirectPayment mode
772704
export const DIRECT_PAYMENT_UI_OPTIONS: Record<
773705
| "digitalArt"

0 commit comments

Comments
 (0)