diff --git a/.changeset/plenty-steaks-lay.md b/.changeset/plenty-steaks-lay.md new file mode 100644 index 0000000..9965cfa --- /dev/null +++ b/.changeset/plenty-steaks-lay.md @@ -0,0 +1,5 @@ +--- +"@farcaster/auth-kit": patch +--- + +add optional disableSignOut prop diff --git a/packages/auth-kit/src/components/ProfileButton/ProfileButton.tsx b/packages/auth-kit/src/components/ProfileButton/ProfileButton.tsx index 967a078..1fe30b4 100644 --- a/packages/auth-kit/src/components/ProfileButton/ProfileButton.tsx +++ b/packages/auth-kit/src/components/ProfileButton/ProfileButton.tsx @@ -17,19 +17,26 @@ interface UserDataProps { export function ProfileButton({ userData, signOut, + disableSignOut, }: { userData?: UserDataProps; signOut?: () => void; + disableSignOut: boolean; }) { - const [showSignOut, setShowSignOut] = useState(false); + const [showSignOutButton, setShowSignOutButton] = useState(false); const ref = useRef(null); - useDetectClickOutside(ref, () => setShowSignOut(false)); + useDetectClickOutside(ref, () => setShowSignOutButton(false)); const name = userData?.username ?? `!${userData?.fid}`; const pfpUrl = userData?.pfpUrl ?? "https://warpcast.com/avatar.png"; + const showSignOut = showSignOutButton && !disableSignOut; + return ( -