add copy to clipboard wallet id
This commit is contained in:
parent
50b9ab7f1c
commit
9b9ce916e3
@ -6,7 +6,7 @@ import Link from "next/link";
|
|||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
|
|
||||||
import { ChevronsUpDown, LogOut } from "lucide-react";
|
import { ChevronsUpDown, Copy, LogOut } from "lucide-react";
|
||||||
|
|
||||||
import { useLogin, usePrivy } from "@privy-io/react-auth";
|
import { useLogin, usePrivy } from "@privy-io/react-auth";
|
||||||
|
|
||||||
@ -137,19 +137,40 @@ export default function Header() {
|
|||||||
</div>
|
</div>
|
||||||
</DropdownMenuLabel>
|
</DropdownMenuLabel>
|
||||||
<DropdownMenuSeparator />
|
<DropdownMenuSeparator />
|
||||||
|
{user.wallet !== undefined && (
|
||||||
|
<DropdownMenuItem
|
||||||
|
asChild
|
||||||
|
className="focus:bg-accent focus:text-primary"
|
||||||
|
>
|
||||||
|
<Button
|
||||||
|
variant={"ghost"}
|
||||||
|
className="flex-start w-full"
|
||||||
|
onClick={() => {
|
||||||
|
navigator.clipboard.writeText(
|
||||||
|
user.wallet!.address
|
||||||
|
);
|
||||||
|
toast.info("Copied to clipboard!");
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Copy />
|
||||||
|
Copy wallet code
|
||||||
|
</Button>
|
||||||
|
</DropdownMenuItem>
|
||||||
|
)}
|
||||||
<DropdownMenuItem
|
<DropdownMenuItem
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
logout();
|
logout();
|
||||||
toast.success("You have been signed out");
|
toast.success("You have been signed out");
|
||||||
}}
|
}}
|
||||||
asChild
|
asChild
|
||||||
|
className="focus:bg-accent focus:text-primary"
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
variant={"ghost"}
|
variant={"ghost"}
|
||||||
className="w-full text-primary "
|
className="flex-start w-full"
|
||||||
>
|
>
|
||||||
<LogOut />
|
<LogOut />
|
||||||
Log out
|
Sign out
|
||||||
</Button>
|
</Button>
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
</DropdownMenuContent>
|
</DropdownMenuContent>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user