import React, { useEffect, useState } from 'react'; import { buildStyles, CircularProgressbar } from 'react-circular-progressbar'; import { FiLoader } from 'react-icons/fi'; import { Link } from 'react-router-dom'; import { FaCheckCircle, FaChevronRight, FaPlay, FaRegCircle, } from 'react-icons/fa'; import { useAppStateContext } from '../context/user.data.context'; import RecomazeLogo from '../components/svg/RecomazeLogo'; import Button from '../components/widgets/Button'; import { getLocalStorageValue, setLocalStorageValue } from '../utils'; import { recomaze_ai_personalization_env } from '../env'; const Onboarding = (): JSX.Element => { const { user, fetchUser } = useAppStateContext(); const [selectedTab, setSelectedtab] = useState(0); const [isError, setIsError] = useState(null); const [isSuccess, setIsSuccess] = useState(null); const [showSuccessPage, setShowSuccessPage] = useState(false); useEffect(() => { const rating = getLocalStorageValue('rating-popup'); if (!rating) setLocalStorageValue('rating-popup', 'init'); if (!user) fetchUser(); }, [user]); useEffect(() => { if (isError || isSuccess) { const timer: NodeJS.Timeout = setTimeout(() => { setIsError(null); setIsSuccess(null); }, 4000); return () => clearTimeout(timer); } }, [isError, isSuccess]); return (

Get started with Recomaze AI

Recomaze helps you convert more by showing the right product suggestions and answers automatically.

theme
{/* Common Header */}

{showSuccessPage ? 'Onboarding Process has been completed' : 'Complete these basic important steps'}

Basic yet important steps to start using Recomaze and raise your conversion rate

{showSuccessPage ? (
) : null}
{showSuccessPage ? (
Onboarding Complete
) : (
{user?.step && user?.step >= 2 ? 2 : user?.step} of 2 steps completed
)}
{/* Steps */} {!showSuccessPage ? (
{OnboardingSteps({ domainName: recomaze_ai_personalization_env?.domain || '', })?.map((onboarding, key) => { return (
setSelectedtab(tab => { if (tab === key) return -1; return key; }) } key={key} className={`space-y-2 cursor-pointer p-2 rounded-md ${ selectedTab === key ? 'bg-[#f7f7f7]' : '' }`} >
{!user ? ( ) : (user?.step || 0) >= onboarding.step ? ( ) : ( )}

{onboarding.title}

{selectedTab === key ? (

{onboarding.sub_title}

{onboarding.cta_label ? (

{onboarding.cta_label}

) : null}
{ if ( onboarding.step === 3 && user?.step && user?.step >= 2 ) { setShowSuccessPage(true); } }} className="" > {onboarding.action}
{onboarding.video_link ? (
{onboarding.video_link}
) : null}
) : null}
); })}
) : null}
); }; export default Onboarding; const OnboardingSteps = ({ domainName }: { domainName: string }) => [ { title: 'Customize Recomaze on YourStore', step: 2, sub_title: 'Match the look of your brand in 2 minutes. Add your logo, colors, and CTA styles.', video_link: (
customization
), cta_label: 'Stores that customize see 12% higher AOV.', action: (
), }, { title: 'Preview Recomaze in Action', sub_title: 'See it live like your shoppers do', video_link: null, step: 3, action: ( View My Store with Recomaze ), }, ];