Skip to content

Commit

Permalink
fix: Copy validator address to clipboard in tutorial page
Browse files Browse the repository at this point in the history
Refactor the tutorial page to use the `handleCopyClick` function to copy the validator address to the clipboard. This ensures that the address is copied successfully and displays a success toast message. This improves the user experience and makes it easier for users to copy the validator address.
  • Loading branch information
EdSDR committed Oct 18, 2024
1 parent 13af441 commit adfb821
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,15 @@ import {
} from "@heroicons/react/24/outline";

import { useCommune } from "@commune-ts/providers/use-commune";
import { Button, CopyButton } from "@commune-ts/ui";
import { toast } from "@commune-ts/providers/use-toast";
import { Button } from "@commune-ts/ui";
import { copyToClipboard } from "@commune-ts/utils";

function handleCopyClick(text: string) {
copyToClipboard(text);
toast.success("Copied validator address to clipboard");
}

export const tutorialData = {
"1": {
icon: <WalletIcon className="h-5 w-5" />,
Expand All @@ -35,7 +41,7 @@ export const tutorialData = {
variant="link"
className="px-1 text-base text-green-500"
onClick={() =>
copyToClipboard("5Hgik8Kf7nq5VBtW41psbpXu1kinXpqRs4AHotPe6u1w6QX2")
handleCopyClick("5Hgik8Kf7nq5VBtW41psbpXu1kinXpqRs4AHotPe6u1w6QX2")
}
>
Copy Validator Address
Expand Down

0 comments on commit adfb821

Please sign in to comment.