|
|
|
@ -3,6 +3,7 @@ |
|
|
|
import { useEffect, useState } from "react"; |
|
|
|
import { IoClose, IoKeyOutline, IoTrashOutline } from "react-icons/io5"; |
|
|
|
import { MdOutlineSwitchAccount } from "react-icons/md"; |
|
|
|
import { IoClose, IoKeyOutline, IoTrashOutline } from "react-icons/io5"; |
|
|
|
import { getClientCookie, setClientCookie } from "@/lib/cookies"; |
|
|
|
import { setCachedMarriageEntryPath } from "@/lib/entry-route-cache"; |
|
|
|
|
|
|
|
@ -32,6 +33,7 @@ export function TokenSwitcher({ |
|
|
|
const [isCustomInputOpen, setIsCustomInputOpen] = useState(false); |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
setMounted(true); |
|
|
|
if (typeof window !== "undefined") { |
|
|
|
const token = |
|
|
|
(window as any).HABIB_TOKEN ?? |
|
|
|
@ -43,6 +45,10 @@ export function TokenSwitcher({ |
|
|
|
} |
|
|
|
}, []); |
|
|
|
|
|
|
|
if (!mounted) { |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
const isMale = currentToken === MALE_TOKEN; |
|
|
|
const isMale2 = currentToken === MALE_2_TOKEN; |
|
|
|
const isFemale = currentToken === FEMALE_TOKEN; |
|
|
|
@ -179,7 +185,7 @@ export function TokenSwitcher({ |
|
|
|
aria-label="تغییر توکن کاربر (تست)" |
|
|
|
title="تغییر توکن (آقا / خانم)" |
|
|
|
className={[ |
|
|
|
"inline-flex items-center gap-1.5 rounded-[15px] px-3 py-2 text-xs font-bold transition-all active:scale-95 shadow-md border border-slate-200/80 dark:border-slate-700/80 backdrop-blur-md", |
|
|
|
"fixed top-4 left-4 z-[99999] inline-flex items-center gap-1.5 rounded-[15px] px-3 py-2 text-xs font-bold transition-all active:scale-95 shadow-md border border-slate-200/80 dark:border-slate-700/80 backdrop-blur-md", |
|
|
|
variant === "transparent" |
|
|
|
? "bg-black/40 text-white hover:bg-black/50" |
|
|
|
: "bg-white/95 text-slate-800 hover:bg-white dark:bg-slate-900/95 dark:text-slate-100", |
|
|
|
|