diff --git a/frontend/public/demos/youtube.mp4 b/frontend/public/demos/youtube.mp4
new file mode 100644
index 0000000..61c24e9
Binary files /dev/null and b/frontend/public/demos/youtube.mp4 differ
diff --git a/frontend/src/components/hosted/AppContainer.tsx b/frontend/src/components/hosted/AppContainer.tsx
index f2e8997..5cf0b69 100644
--- a/frontend/src/components/hosted/AppContainer.tsx
+++ b/frontend/src/components/hosted/AppContainer.tsx
@@ -1,18 +1,16 @@
-import { SignUp, useUser } from "@clerk/clerk-react";
+import { useUser } from "@clerk/clerk-react";
import posthog from "posthog-js";
import App from "../../App";
-import { useEffect, useRef, useState } from "react";
-import { AlertDialog } from "@radix-ui/react-alert-dialog";
-import { AlertDialogContent } from "../ui/alert-dialog";
+import { useEffect, useRef } from "react";
import FullPageSpinner from "../custom-ui/FullPageSpinner";
import { useAuthenticatedFetch } from "./useAuthenticatedFetch";
import { useStore } from "../../store/store";
import AvatarDropdown from "./AvatarDropdown";
import { UserResponse } from "./types";
import { POSTHOG_HOST, POSTHOG_KEY, SAAS_BACKEND_URL } from "../../config";
+import LandingPage from "./LandingPage";
function AppContainer() {
- const [showPopup, setShowPopup] = useState(false);
const { isSignedIn, isLoaded } = useUser();
const setSubscriberTier = useStore((state) => state.setSubscriberTier);
@@ -21,14 +19,7 @@ function AppContainer() {
const authenticatedFetch = useAuthenticatedFetch();
const isInitRequestInProgress = useRef(false);
- // If Clerk is loaded and the user is not signed in, show the sign up popup
- useEffect(() => {
- if (isLoaded && !isSignedIn) {
- setShowPopup(true);
- }
- }, [isSignedIn, isLoaded]);
-
- // Get the current user
+ // Get information from our backend about the user (subscription status)
useEffect(() => {
const init = async () => {
// Make sure there's only one request in progress
@@ -36,12 +27,17 @@ function AppContainer() {
if (isInitRequestInProgress.current) return;
isInitRequestInProgress.current = true;
- // TODO: Handle when the user is not signed in
const user: UserResponse = await authenticatedFetch(
SAAS_BACKEND_URL + "/users/create",
"POST"
);
+ // If the user is not signed in, authenticatedFetch will return undefined
+ if (!user) {
+ isInitRequestInProgress.current = false;
+ return;
+ }
+
if (!user.subscriber_tier) {
setSubscriberTier("free");
} else {
@@ -66,6 +62,10 @@ function AppContainer() {
// If Clerk is still loading, show a spinner
if (!isLoaded) return ;
+ // If the user is not signed in, show the landing page
+ if (isLoaded && !isSignedIn) return ;
+
+ // If the user is signed in, show the app
return (
<>
}
/>
-
-
-
-
-
>
);
}
diff --git a/frontend/src/components/hosted/LandingPage.tsx b/frontend/src/components/hosted/LandingPage.tsx
new file mode 100644
index 0000000..2139856
--- /dev/null
+++ b/frontend/src/components/hosted/LandingPage.tsx
@@ -0,0 +1,141 @@
+import { FaGithub } from "react-icons/fa";
+import Footer from "./LandingPage/Footer";
+import { Button } from "../ui/button";
+import { SignUp } from "@clerk/clerk-react";
+import { useState } from "react";
+import { Dialog, DialogContent } from "../ui/dialog";
+
+const LOGOS = ["microsoft", "amazon", "mit", "stanford", "bytedance", "baidu"];
+
+function LandingPage() {
+ const [isAuthPopupOpen, setIsAuthPopupOpen] = useState(false);
+
+ const signIn = () => {
+ setIsAuthPopupOpen(true);
+ };
+
+ return (
+