1
- import { STATIC_IMAGES_URL } from "@hey/data/constants" ;
1
+ import { APP_NAME , STATIC_IMAGES_URL } from "@hey/data/constants" ;
2
2
import { Errors } from "@hey/data/errors" ;
3
3
import { useSwitchAccountMutation } from "@hey/indexer" ;
4
- import { Button , H4 , Spinner } from "@hey/ui" ;
4
+ import { H4 } from "@hey/ui" ;
5
5
import { useRouter } from "next/router" ;
6
6
import type { FC } from "react" ;
7
- import { useState } from "react" ;
7
+ import { useEffect } from "react" ;
8
8
import toast from "react-hot-toast" ;
9
9
import { signIn } from "src/store/persisted/useAuthStore" ;
10
10
import { useSignupStore } from "." ;
11
11
12
12
const Success : FC = ( ) => {
13
13
const { reload } = useRouter ( ) ;
14
14
const { accountAddress, onboardingToken } = useSignupStore ( ) ;
15
- const [ isLoading , setIsLoading ] = useState ( false ) ;
16
-
17
15
const [ switchAccount ] = useSwitchAccountMutation ( ) ;
18
16
19
- const handleSign = async ( ) => {
17
+ const handleAuth = async ( ) => {
20
18
try {
21
- setIsLoading ( true ) ;
22
-
23
19
const auth = await switchAccount ( {
24
20
context : { headers : { "X-Access-Token" : onboardingToken } } ,
25
21
variables : { request : { account : accountAddress } }
@@ -37,6 +33,10 @@ const Success: FC = () => {
37
33
} catch { }
38
34
} ;
39
35
36
+ useEffect ( ( ) => {
37
+ handleAuth ( ) ;
38
+ } , [ ] ) ;
39
+
40
40
return (
41
41
< div className = "m-8 flex flex-col items-center justify-center" >
42
42
< H4 > Waaa-hey! You got your profile!</ H4 >
@@ -49,26 +49,9 @@ const Success: FC = () => {
49
49
className = "mx-auto mt-8 size-14"
50
50
src = { `${ STATIC_IMAGES_URL } /emojis/dizzy.png` }
51
51
/>
52
- < Button
53
- className = "mt-5"
54
- disabled = { isLoading }
55
- icon = {
56
- isLoading ? (
57
- < Spinner className = "mr-0.5" size = "xs" />
58
- ) : (
59
- < img
60
- alt = "Lens Logo"
61
- className = "h-3"
62
- height = { 12 }
63
- src = "/lens.svg"
64
- width = { 19 }
65
- />
66
- )
67
- }
68
- onClick = { handleSign }
69
- >
70
- Sign in with Lens
71
- </ Button >
52
+ < i className = "ld-text-gray-500 mt-8" >
53
+ We are taking you to { APP_NAME } ...
54
+ </ i >
72
55
</ div >
73
56
) ;
74
57
} ;
0 commit comments