Skip to content

Commit ffd0783

Browse files
committed
Migrate to Lens v3
1 parent ede7d1f commit ffd0783

File tree

1 file changed

+11
-28
lines changed

1 file changed

+11
-28
lines changed

apps/web/src/components/Shared/Auth/Signup/Success.tsx

+11-28
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
1-
import { STATIC_IMAGES_URL } from "@hey/data/constants";
1+
import { APP_NAME, STATIC_IMAGES_URL } from "@hey/data/constants";
22
import { Errors } from "@hey/data/errors";
33
import { useSwitchAccountMutation } from "@hey/indexer";
4-
import { Button, H4, Spinner } from "@hey/ui";
4+
import { H4 } from "@hey/ui";
55
import { useRouter } from "next/router";
66
import type { FC } from "react";
7-
import { useState } from "react";
7+
import { useEffect } from "react";
88
import toast from "react-hot-toast";
99
import { signIn } from "src/store/persisted/useAuthStore";
1010
import { useSignupStore } from ".";
1111

1212
const Success: FC = () => {
1313
const { reload } = useRouter();
1414
const { accountAddress, onboardingToken } = useSignupStore();
15-
const [isLoading, setIsLoading] = useState(false);
16-
1715
const [switchAccount] = useSwitchAccountMutation();
1816

19-
const handleSign = async () => {
17+
const handleAuth = async () => {
2018
try {
21-
setIsLoading(true);
22-
2319
const auth = await switchAccount({
2420
context: { headers: { "X-Access-Token": onboardingToken } },
2521
variables: { request: { account: accountAddress } }
@@ -37,6 +33,10 @@ const Success: FC = () => {
3733
} catch {}
3834
};
3935

36+
useEffect(() => {
37+
handleAuth();
38+
}, []);
39+
4040
return (
4141
<div className="m-8 flex flex-col items-center justify-center">
4242
<H4>Waaa-hey! You got your profile!</H4>
@@ -49,26 +49,9 @@ const Success: FC = () => {
4949
className="mx-auto mt-8 size-14"
5050
src={`${STATIC_IMAGES_URL}/emojis/dizzy.png`}
5151
/>
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>
7255
</div>
7356
);
7457
};

0 commit comments

Comments
 (0)