diff --git a/src/views/Home/Home copy.tsx b/src/views/Home/Home copy.tsx new file mode 100644 index 0000000..b62628b --- /dev/null +++ b/src/views/Home/Home copy.tsx @@ -0,0 +1,66 @@ +import { useSession, signIn, signOut } from "next-auth/react" +import { Button, Box } from "@chakra-ui/react"; +import { useGetUserInfo } from "@/views/Home/hooks/hooks"; +import NewUserForm from "./components/NewUserForm/NewUserForm"; +import withDappProvider from "@/hoc/withDappProvider"; +import ExistingUser from "./components/ExistingUser/ExistingUser"; + + +const Home = () => { + + const { data: session } = useSession() + console.log("⚠️ ~ file: Home.tsx:12 ~ Home ~ session::::", session) + + const email = session?.user?.email || ""; + const platform = "google"; + + const {userInfo, isLoadingUserInfo, errorUserInfo} = useGetUserInfo(email, platform); + console.log("⚠️ ~ file: Home.tsx:18 ~ Home ~ userInfo::::", userInfo) + + let userExists = false; + if (!isLoadingUserInfo && session && userInfo?.address != "") { + userExists = true; + } + + if (session) { + return ( + + Signed in as {session?.user?.email}
+ ID: {session?.user?.sub}
+ + {userExists ? + + : + + } +
+ ) + } + return ( + + Not signed in
+ +
+ ) +}; + +export default Home; + diff --git a/src/views/Home/Home.tsx b/src/views/Home/Home.tsx index b62628b..22daee5 100644 --- a/src/views/Home/Home.tsx +++ b/src/views/Home/Home.tsx @@ -7,58 +7,10 @@ import ExistingUser from "./components/ExistingUser/ExistingUser"; const Home = () => { - - const { data: session } = useSession() - console.log("⚠️ ~ file: Home.tsx:12 ~ Home ~ session::::", session) - - const email = session?.user?.email || ""; - const platform = "google"; - - const {userInfo, isLoadingUserInfo, errorUserInfo} = useGetUserInfo(email, platform); - console.log("⚠️ ~ file: Home.tsx:18 ~ Home ~ userInfo::::", userInfo) - - let userExists = false; - if (!isLoadingUserInfo && session && userInfo?.address != "") { - userExists = true; - } - - if (session) { - return ( - - Signed in as {session?.user?.email}
- ID: {session?.user?.sub}
- - {userExists ? - - : - - } -
- ) - } return ( - - Not signed in
- -
+ <> + Work + ) };