From d082cf339e4dbbcd8ddcce5ec71cfd9596c33585 Mon Sep 17 00:00:00 2001 From: Juan Di Toro Date: Fri, 3 Nov 2023 19:13:55 +0100 Subject: [PATCH] feat: attention you need to login --- src/components/Lume.tsx | 8 +++----- src/components/StartPage.tsx | 21 ++++++++++++++++----- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/components/Lume.tsx b/src/components/Lume.tsx index 1d03632..f4fc2f1 100644 --- a/src/components/Lume.tsx +++ b/src/components/Lume.tsx @@ -6,7 +6,7 @@ import { useLumeStatus, } from "@lumeweb/sdk"; -const Lume: React.FC = () => { +const Lume: React.FC = () => { const { isLoggedIn } = useAuth(); const { ready, inited } = useLumeStatus(); @@ -15,20 +15,18 @@ const Lume: React.FC = () => { {!isLoggedIn && ( - { - } )} {isLoggedIn && } ); -} +}; -export default Lume; \ No newline at end of file +export default Lume; diff --git a/src/components/StartPage.tsx b/src/components/StartPage.tsx index a032740..f96969f 100644 --- a/src/components/StartPage.tsx +++ b/src/components/StartPage.tsx @@ -1,4 +1,4 @@ -import { useLumeStatus } from "@lumeweb/sdk"; +import { useAuth, useLumeStatus } from "@lumeweb/sdk"; import React from "react"; type Props = { @@ -14,7 +14,8 @@ const AVAILABLE_PAGES = [ ]; const StartPage = ({ setUrl }: Props) => { - const { ready } = useLumeStatus(); + const { ready, inited } = useLumeStatus(); + const { isLoggedIn } = useAuth(); return (

@@ -27,7 +28,7 @@ const StartPage = ({ setUrl }: Props) => {

{/* TODO: Add the lume loading indicators for the networks. */} {/* */} - {ready ? ( + {inited && ready ? (

@@ -59,7 +60,8 @@ const StartPage = ({ setUrl }: Props) => { ))}

- ) : ( + ) : null} + {inited && ready ? (
{

Be patient

We are starting the engines.

- )} + ): null} + {!isLoggedIn ? ( +
+

Attention

+

Please click login to start using the browser.

+
+ ) : null}

); };