From ad3f8a33d155a24dfce5129f8269881a1697fc33 Mon Sep 17 00:00:00 2001 From: sabaimran Date: Thu, 12 Dec 2024 14:57:52 -0800 Subject: [PATCH] Add a static login footer that prompts login, disable input box without auth --- .../chatInputArea/chatInputArea.tsx | 6 ++-- .../app/components/loginPrompt/loginPopup.tsx | 31 +++++++++++++++++++ .../components/loginPrompt/loginPrompt.tsx | 13 ++++---- src/interface/web/app/page.tsx | 7 +++++ 4 files changed, 49 insertions(+), 8 deletions(-) create mode 100644 src/interface/web/app/components/loginPrompt/loginPopup.tsx diff --git a/src/interface/web/app/components/chatInputArea/chatInputArea.tsx b/src/interface/web/app/components/chatInputArea/chatInputArea.tsx index 627e8517..173f6edc 100644 --- a/src/interface/web/app/components/chatInputArea/chatInputArea.tsx +++ b/src/interface/web/app/components/chatInputArea/chatInputArea.tsx @@ -629,7 +629,7 @@ export const ChatInputArea = forwardRef((pr @@ -699,6 +699,7 @@ export const ChatInputArea = forwardRef((pr + + ); +} diff --git a/src/interface/web/app/components/loginPrompt/loginPrompt.tsx b/src/interface/web/app/components/loginPrompt/loginPrompt.tsx index 8e10dc63..2e639626 100644 --- a/src/interface/web/app/components/loginPrompt/loginPrompt.tsx +++ b/src/interface/web/app/components/loginPrompt/loginPrompt.tsx @@ -320,7 +320,7 @@ function MainSignInContext({ ]; return ( -
+
{!isMobileWidth && ( {tips.map((tip, index) => ( -
+
{tip.alt} @@ -351,7 +351,7 @@ function MainSignInContext({ )}
- Sign In for free to start using Khoj: Your AI-powered second brain + Sign in to unlock your second brain
@@ -404,7 +404,7 @@ function MainSignInContext({
By logging in, you agree to our{" "} - Terms of Service. + Terms of Service. See{" "} + Privacy Policy.
); diff --git a/src/interface/web/app/page.tsx b/src/interface/web/app/page.tsx index d503e6a1..bf7f30d1 100644 --- a/src/interface/web/app/page.tsx +++ b/src/interface/web/app/page.tsx @@ -34,6 +34,7 @@ import { useRouter, useSearchParams } from "next/navigation"; import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area"; import { AgentCard } from "@/app/components/agentCard/agentCard"; import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"; +import LoginPopup from "./components/loginPrompt/loginPopup"; interface ChatBodyDataProps { chatOptionsData: ChatOptions | null; @@ -221,6 +222,12 @@ function ChatBodyData(props: ChatBodyDataProps) { loginRedirectMessage={"Login to your second brain"} /> )} + {!props.isLoggedIn && ( + + )}