From 6c6ba1442532477d5d2149ff5283a6baafa8c90f Mon Sep 17 00:00:00 2001 From: evie-8 Date: Wed, 27 Nov 2024 09:34:49 +0300 Subject: [PATCH 1/2] modifying documentation for ASR-portal --- docusaurus.config.ts | 2 +- src/components/logout.tsx | 1 - src/theme/Navbar/Content/index.tsx | 2 +- src/theme/Root.tsx | 6 +++--- src/theme/firebase.ts | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 29fdb9c..712c394 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -59,7 +59,7 @@ const config: Config = { "docusaurus-plugin-dotenv", { path: "./.env", - systemvars: true + systemvars: true } ]], diff --git a/src/components/logout.tsx b/src/components/logout.tsx index bac8e71..92d7e7c 100644 --- a/src/components/logout.tsx +++ b/src/components/logout.tsx @@ -1,6 +1,5 @@ import React from "react"; import { Power } from "lucide-react"; -import { signOut } from "firebase/auth"; import { logout } from "../theme/firebase"; const LogoutButton = () => { diff --git a/src/theme/Navbar/Content/index.tsx b/src/theme/Navbar/Content/index.tsx index 7421817..abf3b69 100644 --- a/src/theme/Navbar/Content/index.tsx +++ b/src/theme/Navbar/Content/index.tsx @@ -10,7 +10,7 @@ export default function ContentWrapper(props: Props): JSX.Element { return ( <> - + {process.env.ENVIRONMENT === "production" && } ); } diff --git a/src/theme/Root.tsx b/src/theme/Root.tsx index e308d77..8aecd0c 100644 --- a/src/theme/Root.tsx +++ b/src/theme/Root.tsx @@ -7,7 +7,7 @@ import { auth, signInWithGoogle } from "./firebase"; export default function Root({ children }) { const [userAuth, setUserAuth] = useState(false); // To store user authentication status const [authLoading, setAuthLoading] = useState(true); // To handle loading state - + const env = process.env.ENVIRONMENT; // UseEffect to subscribe to authentication state changes useEffect(() => { const unsubscribe = auth.onAuthStateChanged((user) => { @@ -46,14 +46,14 @@ export default function Root({ children }) { <> {authLoading ? ( // Show loading state - ) : userAuth ? ( + ) : (userAuth && env == "production") || env === "development" ? ( <>{children} // Show the children components if user is authenticated ) : (
Sunbird AI logo