MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / LoginModal

Function LoginModal

cli/src/components/login-modal.tsx:28–459  ·  view source on GitHub ↗
({
  onLoginSuccess,
  hasInvalidCredentials = false,
}: LoginModalProps)

Source from the content-addressed store, hash-verified

26}
27
28export const LoginModal = ({
29 onLoginSuccess,
30 hasInvalidCredentials = false,
31}: LoginModalProps) => {
32 const renderer = useRenderer()
33 const theme = useTheme()
34
35 // Use zustand store for all state
36 const {
37 loginUrl,
38 loading,
39 error,
40 fingerprintId,
41 fingerprintHash,
42 expiresAt,
43 isWaitingForEnter,
44 hasOpenedBrowser,
45 sheenPosition,
46 justCopied,
47 setLoginUrl,
48 setLoading,
49 setError,
50 setFingerprintId,
51 setFingerprintHash,
52 setExpiresAt,
53 setIsWaitingForEnter,
54 setHasOpenedBrowser,
55 setSheenPosition,
56 setCopyMessage,
57 setJustCopied,
58 setHasClickedLink,
59 } = useLoginStore()
60
61 // Track hover state for copy button
62 const [isCopyButtonHovered, setIsCopyButtonHovered] = useState(false)
63
64 // Use TanStack Query for login mutation
65 const loginMutation = useLoginMutation()
66
67 // Use custom hook for fetching login URL
68 const fetchLoginUrlMutation = useFetchLoginUrl({
69 setLoginUrl,
70 setFingerprintHash,
71 setExpiresAt,
72 setIsWaitingForEnter,
73 setHasOpenedBrowser,
74 setError,
75 })
76
77 // Copy to clipboard function
78 const copyToClipboard = useCallback(
79 async (text: string) => {
80 if (!text || text.trim().length === 0) return
81
82 setHasClickedLink(true)
83
84 try {
85 await copyTextToClipboard(text, {

Callers

nothing calls this directly

Calls 15

useThemeFunction · 0.90
useLoginMutationFunction · 0.90
useFetchLoginUrlFunction · 0.90
copyTextToClipboardFunction · 0.90
getFingerprintIdFunction · 0.90
useLoginPollingFunction · 0.90
useLoginKeyboardHandlersFunction · 0.90
formatUrlFunction · 0.90
getLogoBlockColorFunction · 0.90
getLogoAccentColorFunction · 0.90
useSheenAnimationFunction · 0.90

Tested by

no test coverage detected