import { useEffect } from "react" import { atom, useAtom } from "jotai" import { atomWithStorage } from "jotai/utils" import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from "@/components/ui/alert-dialog" import { useLocation } from "@tanstack/react-router" const hasVisitedAtom = atomWithStorage("hasVisitedLearnAnything", false) const isDialogOpenAtom = atom(true) export function Onboarding() { const { pathname } = useLocation() const [hasVisited, setHasVisited] = useAtom(hasVisitedAtom) const [isOpen, setIsOpen] = useAtom(isDialogOpenAtom) useEffect(() => { if (!hasVisited && pathname !== "/") { setIsOpen(true) } }, [hasVisited, pathname, setIsOpen]) const handleClose = () => { setIsOpen(false) setHasVisited(true) } if (hasVisited) return null return ( Welcome to Learn Anything!

Learn Anything is a learning platform that organizes knowledge in a social way. You can create pages, add links, track learning status of any topic, and more things in the future.

Try do these quick onboarding steps to get a feel for the product:

  • Create your first page
  • Add a link to a resource
  • Update your learning status on a topic

If you have any questions, don't hesitate to reach out. Click on question mark button in the bottom right corner and enter your message.

Close Get Started
) } export default Onboarding