|
|
|
@ -1,7 +1,8 @@ |
|
|
|
"use client"; |
|
|
|
|
|
|
|
import { useEffect, useState } from "react"; |
|
|
|
import { useEffect, useRef, useState } from "react"; |
|
|
|
import { MdOutlineSwitchAccount } from "react-icons/md"; |
|
|
|
import { IoClose, IoTrashOutline, IoKeyOutline } from "react-icons/io5"; |
|
|
|
import { getClientCookie, setClientCookie } from "@/lib/cookies"; |
|
|
|
import { setCachedMarriageEntryPath } from "@/lib/entry-route-cache"; |
|
|
|
|
|
|
|
@ -31,10 +32,13 @@ export function TokenSwitcher({ |
|
|
|
className, |
|
|
|
isFloating = true, |
|
|
|
}: TokenSwitcherProps) { |
|
|
|
const [mounted, setMounted] = useState(false); |
|
|
|
const [isOpen, setIsOpen] = useState(false); |
|
|
|
const [currentToken, setCurrentToken] = useState<string>(""); |
|
|
|
const [customTokenInput, setCustomTokenInput] = useState<string>(""); |
|
|
|
const [isCustomInputOpen, setIsCustomInputOpen] = useState(false); |
|
|
|
const [position, setPosition] = useState<{ x: number; y: number } | null>(null); |
|
|
|
const containerRef = useRef<HTMLButtonElement>(null); |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
setMounted(true); |
|
|
|
@ -255,6 +259,7 @@ export function TokenSwitcher({ |
|
|
|
return ( |
|
|
|
<> |
|
|
|
<button |
|
|
|
ref={containerRef} |
|
|
|
type="button" |
|
|
|
onClick={() => setIsOpen(true)} |
|
|
|
aria-label="تغییر توکن کاربر (تست)" |
|
|
|
|