Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Slot stories #1306

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions packages/keychain/src/components/slot/fund.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import type { Meta, StoryObj } from "@storybook/react";

import { Fund } from "./fund";
import { constants, num, RpcProvider } from "starknet";

const meta: Meta<typeof Fund> = {
component: Fund,
decorators: [(Story) => <Story />],
parameters: {
connection: {
controller: {
chainId: () => constants.StarknetChainId.SN_SEPOLIA as string,
callContract: () =>
Promise.resolve([num.toHex("2000000000000000000"), "0x0"]),
rpc: new RpcProvider({ nodeUrl: "https://api.cartridge/x/sepolia" }),
username: () => "test-account",
address:
"0x0000000000000000000000000000000000000000000000000000000000000000",
},
},
},
};

export default meta;
type Story = StoryObj<typeof meta>;

export const Default: Story = {};
9 changes: 2 additions & 7 deletions packages/keychain/src/components/success.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
import { Container } from "@/components/layout";
import { CheckIcon } from "@cartridge/ui-next";
import { useSearchParams } from "react-router-dom";

export function Success() {
const [searchParams] = useSearchParams();
const title = searchParams.get("title");
const description = searchParams.get("description");

return (
<Container
variant="expanded"
hideAccount
Icon={CheckIcon}
title={title ? (title as string) : "Success!"}
description={description ? (description as string) : ""}
title="Success!"
description=""
/>
);
}
2 changes: 1 addition & 1 deletion scripts/update-storybook-snapshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ docker run \
-v /app/node_modules \
--ipc=host \
-ti \
ghcr.io/cartridge-gg/controller/storybook-env:sha-91a2d36 \
ghcr.io/cartridge-gg/controller/storybook-env:sha-6d7b370 \
bash -c "pnpm i && pnpm --filter $PACKAGE test-storybook -u --url http://host.docker.internal:$PORT"
Loading