+
+
+
Get started with Khoj
+
+
+ {checkEmail
+ ? recheckEmail
+ ? `A new link has been sent to ${email}.`
+ : `A one time sign in code has been sent to ${email}.`
+ : "You will receive a sign-in code on the email address you provide below"}
+
+ {!checkEmail && (
+ <>
+
{
+ if (e.key === "Enter") {
+ handleMagicLinkSignIn();
+ }
+ }}
+ onChange={(e) => setEmail(e.target.value)}
+ />
+
+ >
+ )}
+ {checkEmail && (
+
+
= ALLOWED_OTP_ATTEMPTS}
+ onComplete={() =>
+ setTimeout(() => {
+ checkOTPAndRedirect();
+ }, 1000)
+ }
+ >
+
+
+
+
+
+
+
+
+
+ {otpError && (
+
+ {otpError} {ALLOWED_OTP_ATTEMPTS - numFailures} remaining attempts.
+
+ )}
+
+ )}
+
+ {checkEmail && (
+
+
+
+
+
+ )}
+
+ );
+}
+
+function MainSignInContext({
+ handleGoogleScriptLoad,
+ handleGoogleSignIn,
+ isLoading,
+ data,
+ setUseEmailSignIn,
+ isMobileWidth,
+}: {
+ handleGoogleScriptLoad: () => void;
+ handleGoogleSignIn: () => void;
+ isLoading: boolean;
+ data: CredentialsData | undefined;
+ setUseEmailSignIn: (useEmailSignIn: boolean) => void;
+ isMobileWidth: boolean;
+}) {
+ const plugin = useRef(Autoplay({ delay: 4000, stopOnInteraction: true }));
+ const [showArrows, setShowArrows] = useState(false);
+
+ const tips = [
+ {
+ src: "https://assets.khoj.dev/sign_in_demos/research_mode.gif",
+ alt: "Research tip",
+ description: "Simplify Deep Work",
+ },
+ {
+ src: "https://assets.khoj.dev/sign_in_demos/custom_agents.gif",
+ alt: "Personalize tip",
+ description: "Personalize your AI",
+ },
+ {
+ src: "https://assets.khoj.dev/sign_in_demos/docment_questions.gif",
+ alt: "Document tip",
+ description: "Ask Anything",
+ },
+ ];
+
+ return (
+
+ {!isMobileWidth && (
+
{
+ plugin.current.stop();
+ setShowArrows(true);
+ }}
+ onMouseLeave={() => {
+ plugin.current.play();
+ setShowArrows(false);
+ }}
+ >
+
+ {tips.map((tip, index) => (
+
+
+
+
+
+
+ {tip.description}
+
+
+
+
+
+ ))}
+
+ {showArrows && (
+ <>
+
+
+ >
+ )}
+
+ )}
+
+
+ Sign in to unlock your second brain
+
+
+
+
+ {/*
*/}
+
+
+
{
+ setUseEmailSignIn(true);
+ }}
+ >
+
+ Continue with Email
+
+
+
+ By logging in, you agree to our{" "}
+ Terms of Service. See{" "}
+ Privacy Policy.
+
+
);
}
diff --git a/src/interface/web/app/components/navMenu/navMenu.tsx b/src/interface/web/app/components/navMenu/navMenu.tsx
index 01215863..6ad767a1 100644
--- a/src/interface/web/app/components/navMenu/navMenu.tsx
+++ b/src/interface/web/app/components/navMenu/navMenu.tsx
@@ -25,6 +25,8 @@ import {
import { Moon, Sun, UserCircle, Question, GearFine, ArrowRight, Code } from "@phosphor-icons/react";
import { KhojAgentLogo, KhojAutomationLogo, KhojSearchLogo } from "../logo/khojLogo";
import { useIsMobileWidth } from "@/app/common/utils";
+import LoginPrompt from "../loginPrompt/loginPrompt";
+import { Button } from "@/components/ui/button";
function SubscriptionBadge({ is_active }: { is_active: boolean }) {
return (
@@ -51,6 +53,7 @@ export default function NavMenu() {
const [darkMode, setDarkMode] = useState(false);
const [initialLoadDone, setInitialLoadDone] = useState(false);
const isMobileWidth = useIsMobileWidth();
+ const [showLoginPrompt, setShowLoginPrompt] = useState(false);
useEffect(() => {
if (localStorage.getItem("theme") === "dark") {
@@ -87,6 +90,13 @@ export default function NavMenu() {
return (