diff --git a/packages/keychain/.gitignore b/packages/keychain/.gitignore index e9cf4bd77..d0ecd75ad 100644 --- a/packages/keychain/.gitignore +++ b/packages/keychain/.gitignore @@ -24,3 +24,5 @@ dist-ssr *.sw? stats.html .vercel + +storybook-static/ diff --git a/packages/keychain/.storybook/preview.tsx b/packages/keychain/.storybook/preview.tsx index 10cdff63a..671ed5ffb 100644 --- a/packages/keychain/.storybook/preview.tsx +++ b/packages/keychain/.storybook/preview.tsx @@ -5,6 +5,7 @@ import { StoryParameters } from "./mock"; import { Provider } from "./provider"; import "../src/index.css"; +import { SonnerToaster } from "@cartridge/ui-next"; const preview: Preview = { parameters: { @@ -41,6 +42,7 @@ const preview: Preview = { (Story, { parameters }) => ( + ), ], diff --git a/packages/keychain/src/components/CopyAddress.tsx b/packages/keychain/src/components/CopyAddress.tsx deleted file mode 100644 index 48a25db51..000000000 --- a/packages/keychain/src/components/CopyAddress.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import { HStack, Text } from "@chakra-ui/react"; -import { formatAddress } from "@cartridge/utils"; -import { useToast } from "@/hooks/toast"; -import { addAddressPadding } from "starknet"; - -export function CopyAddress({ address }: { address: string }) { - const { toast } = useToast(); - - return ( - { - navigator.clipboard.writeText(addAddressPadding(address)); - toast("Copied"); - }} - > - {formatAddress(address)} - - ); -} diff --git a/packages/keychain/src/components/Funding/DepositEth.tsx b/packages/keychain/src/components/Funding/DepositEth.tsx index fd1bbb57c..81e1ccc41 100644 --- a/packages/keychain/src/components/Funding/DepositEth.tsx +++ b/packages/keychain/src/components/Funding/DepositEth.tsx @@ -24,12 +24,12 @@ import { CopyIcon, EthereumIcon, StarknetColorIcon, + CopyAddress, } from "@cartridge/ui-next"; import { useConnection } from "@/hooks/connection"; import { useToast } from "@/hooks/toast"; import { ETH_CONTRACT_ADDRESS } from "@/utils/token"; import { ErrorAlert } from "../ErrorAlert"; -import { CopyAddress } from "@/components/CopyAddress"; import { parseEther } from "viem"; import { AmountSelection, DEFAULT_AMOUNT } from "./AmountSelection"; import { Balance } from "./Balance"; diff --git a/packages/keychain/src/components/Funding/PurchaseCredits.tsx b/packages/keychain/src/components/Funding/PurchaseCredits.tsx index 17ee7ebf3..ead4606e8 100644 --- a/packages/keychain/src/components/Funding/PurchaseCredits.tsx +++ b/packages/keychain/src/components/Funding/PurchaseCredits.tsx @@ -1,9 +1,8 @@ import { Container, Content, Footer } from "@/components/layout"; import { Button, Divider } from "@chakra-ui/react"; import { useCallback, useMemo, useState } from "react"; -import { CheckIcon, CoinsIcon } from "@cartridge/ui-next"; +import { CheckIcon, CoinsIcon, CopyAddress } from "@cartridge/ui-next"; import { useConnection } from "@/hooks/connection"; -import { CopyAddress } from "../CopyAddress"; import { AmountSelection, DEFAULT_AMOUNT } from "./AmountSelection"; import { ErrorAlert } from "@/components/ErrorAlert"; import { Elements } from "@stripe/react-stripe-js"; diff --git a/packages/keychain/src/components/Funding/StripeCheckout.tsx b/packages/keychain/src/components/Funding/StripeCheckout.tsx index aae3265aa..2487f4ad4 100644 --- a/packages/keychain/src/components/Funding/StripeCheckout.tsx +++ b/packages/keychain/src/components/Funding/StripeCheckout.tsx @@ -8,8 +8,7 @@ import { StripePaymentElementOptions } from "@stripe/stripe-js"; import { Button } from "@chakra-ui/react"; import { Container, Content, Footer } from "@/components/layout"; import { useController } from "@/hooks/controller"; -import { CoinsIcon } from "@cartridge/ui-next"; -import { CopyAddress } from "@/components/CopyAddress"; +import { CoinsIcon, CopyAddress } from "@cartridge/ui-next"; import { ErrorAlert } from "@/components/ErrorAlert"; type StripeCheckoutProps = { diff --git a/packages/keychain/src/components/Funding/index.tsx b/packages/keychain/src/components/Funding/index.tsx index b8fd35785..6bd21b638 100644 --- a/packages/keychain/src/components/Funding/index.tsx +++ b/packages/keychain/src/components/Funding/index.tsx @@ -2,8 +2,12 @@ import { Container, Content, Footer } from "@/components/layout"; import { Button } from "@chakra-ui/react"; import { useState } from "react"; import { useConnection } from "@/hooks/connection"; -import { CopyAddress } from "../CopyAddress"; -import { ArrowIcon, CoinsIcon, EthereumIcon } from "@cartridge/ui-next"; +import { + ArrowIcon, + CoinsIcon, + EthereumIcon, + CopyAddress, +} from "@cartridge/ui-next"; import { DepositEth } from "./DepositEth"; import { PurchaseCredits } from "./PurchaseCredits"; import { Balance } from "./Balance"; diff --git a/packages/keychain/src/components/Policies.tsx b/packages/keychain/src/components/Policies.tsx index adcf728d7..c6e8160ee 100644 --- a/packages/keychain/src/components/Policies.tsx +++ b/packages/keychain/src/components/Policies.tsx @@ -9,9 +9,8 @@ import { AccordionPanel, Box, } from "@chakra-ui/react"; -import { FnIcon, WedgeIcon } from "@cartridge/ui-next"; +import { FnIcon, WedgeIcon, CopyAddress } from "@cartridge/ui-next"; import { SessionPolicies } from "@cartridge/presets"; -import { CopyAddress } from "./CopyAddress"; export function Policies({ title, diff --git a/packages/ui-next/src/components/primitives/checkbox.tsx b/packages/ui-next/src/components/primitives/checkbox.tsx index 76fd9e63e..f937deddb 100644 --- a/packages/ui-next/src/components/primitives/checkbox.tsx +++ b/packages/ui-next/src/components/primitives/checkbox.tsx @@ -26,8 +26,8 @@ const Checkbox = React.forwardRef< checked === "indeterminate" ? "minus-line" : checked - ? "line" - : "unchecked-line" + ? "line" + : "unchecked-line" } />