Skip to content

Commit

Permalink
Switch ui-next toast
Browse files Browse the repository at this point in the history
  • Loading branch information
JunichiSugiura committed Dec 23, 2024
1 parent 20a1e2f commit 23a5f52
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 23 deletions.
1 change: 1 addition & 0 deletions packages/keychain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"react-dom": "^18.2.0",
"react-query": "^3.39.2",
"react-router-dom": "^6.27.0",
"sonner": "^1.4.41",
"use-sound": "^4.0.1",
"usehooks-ts": "^2.9.1",
"viem": "^1.20.2",
Expand Down
7 changes: 3 additions & 4 deletions packages/keychain/src/components/Funding/DepositEth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ import {
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 { parseEther } from "viem";
import { AmountSelection, DEFAULT_AMOUNT } from "./AmountSelection";
import { Balance } from "./Balance";
import { TokenPair, usePriceQuery } from "@cartridge/utils/api/cartridge";
import { toast } from "sonner";

type DepositEthProps = {
onComplete?: (deployHash?: string) => void;
Expand All @@ -52,7 +52,6 @@ function DepositEthInner({ onComplete, onBack }: DepositEthProps) {
const { connectAsync, connectors, isPending: isConnecting } = useConnect();
const { controller, chainId } = useConnection();
const { account: extAccount } = useAccount();
const { toast } = useToast();

const [dollarAmount, setDollarAmount] = useState<number>(DEFAULT_AMOUNT);
const [state, setState] = useState<"connect" | "fund">("connect");
Expand Down Expand Up @@ -143,8 +142,8 @@ function DepositEthInner({ onComplete, onBack }: DepositEthProps) {
if (!controller?.address) return;

navigator.clipboard.writeText(controller.address);
toast("Copied");
}, [controller?.address, toast]);
toast.success("Address copied");
}, [controller?.address]);

return (
<Container
Expand Down
19 changes: 0 additions & 19 deletions packages/keychain/src/hooks/toast.tsx

This file was deleted.

3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 23a5f52

Please sign in to comment.