diff --git a/apps/web/src/app-effects.js b/apps/web/src/app-effects.js index 796613b59..dab6aae7f 100644 --- a/apps/web/src/app-effects.js +++ b/apps/web/src/app-effects.js @@ -68,6 +68,7 @@ export default function AppEffects({ setShow }) { (async function () { await updateLastSynced(); if (await initUser()) { + showOnboardingDialog("new"); showUpgradeReminderDialogs(); await sync(); } diff --git a/apps/web/src/assets/accent.svg b/apps/web/src/assets/accent.svg index 7bcfc5160..1109c3e9d 100644 --- a/apps/web/src/assets/accent.svg +++ b/apps/web/src/assets/accent.svg @@ -9,7 +9,7 @@ - + @@ -25,7 +25,7 @@ - - + + diff --git a/apps/web/src/assets/backup.svg b/apps/web/src/assets/backup.svg index cb93af885..f8f890eb6 100644 --- a/apps/web/src/assets/backup.svg +++ b/apps/web/src/assets/backup.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/apps/web/src/assets/export.svg b/apps/web/src/assets/export.svg index 0a7d9f53d..c06a0cf96 100644 --- a/apps/web/src/assets/export.svg +++ b/apps/web/src/assets/export.svg @@ -32,13 +32,13 @@ - + - + diff --git a/apps/web/src/assets/fav.svg b/apps/web/src/assets/fav.svg index b43e87ca6..98a0a0305 100644 --- a/apps/web/src/assets/fav.svg +++ b/apps/web/src/assets/fav.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/apps/web/src/assets/monographs.svg b/apps/web/src/assets/monographs.svg index 59ed71bcf..30bcf57d8 100644 --- a/apps/web/src/assets/monographs.svg +++ b/apps/web/src/assets/monographs.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/apps/web/src/assets/note.svg b/apps/web/src/assets/note.svg index 4fcd71136..0d064e328 100644 --- a/apps/web/src/assets/note.svg +++ b/apps/web/src/assets/note.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/apps/web/src/assets/notebook.svg b/apps/web/src/assets/notebook.svg index 987fa0bef..16452cbd5 100644 --- a/apps/web/src/assets/notebook.svg +++ b/apps/web/src/assets/notebook.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/apps/web/src/assets/organize.svg b/apps/web/src/assets/organize.svg index c1f0efe3a..754833cbb 100644 --- a/apps/web/src/assets/organize.svg +++ b/apps/web/src/assets/organize.svg @@ -2,10 +2,10 @@ - + - + @@ -13,11 +13,11 @@ - + - + @@ -28,5 +28,5 @@ - + diff --git a/apps/web/src/assets/richtext.svg b/apps/web/src/assets/richtext.svg index cd46e4e79..583659ba4 100644 --- a/apps/web/src/assets/richtext.svg +++ b/apps/web/src/assets/richtext.svg @@ -5,7 +5,7 @@ - + @@ -14,7 +14,7 @@ - + diff --git a/apps/web/src/assets/search.svg b/apps/web/src/assets/search.svg index 745519cd2..6df0df7a3 100644 --- a/apps/web/src/assets/search.svg +++ b/apps/web/src/assets/search.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/apps/web/src/assets/tag.svg b/apps/web/src/assets/tag.svg index a543b0c5d..cd1809eb2 100644 --- a/apps/web/src/assets/tag.svg +++ b/apps/web/src/assets/tag.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/apps/web/src/assets/trash.svg b/apps/web/src/assets/trash.svg index 2e5a7cfc4..d0b094792 100644 --- a/apps/web/src/assets/trash.svg +++ b/apps/web/src/assets/trash.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/apps/web/src/common/db.js b/apps/web/src/common/db.js index 00909de88..5457face5 100644 --- a/apps/web/src/common/db.js +++ b/apps/web/src/common/db.js @@ -34,6 +34,7 @@ async function initializeDatabase() { AUTH_HOST: "http://192.168.10.29:8264", SSE_HOST: "http://192.168.10.29:7264", ISSUES_HOST: "http://192.168.10.29:2624", + SUBSCRIPTIONS_HOST: "http://192.168.10.29:9264", }); // } diff --git a/apps/web/src/components/dialogs/onboarding-dialog.js b/apps/web/src/components/dialogs/onboarding-dialog.js index 4794356a5..afdcd955c 100644 --- a/apps/web/src/components/dialogs/onboarding-dialog.js +++ b/apps/web/src/components/dialogs/onboarding-dialog.js @@ -4,6 +4,7 @@ import * as Icon from "../icons"; import { ReactComponent as E2E } from "../../assets/e2e.svg"; import { ReactComponent as Note } from "../../assets/note2.svg"; import { ReactComponent as Nomad } from "../../assets/nomad.svg"; +import { ReactComponent as WorkAnywhere } from "../../assets/workanywhere.svg"; import LightUI from "../../assets/light1.png"; import DarkUI from "../../assets/dark1.png"; import GooglePlay from "../../assets/play.png"; @@ -17,6 +18,7 @@ import { db } from "../../common/db"; import { usePersistentState } from "../../utils/hooks"; import accents from "../../theme/accents"; import AccentItem from "../accent-item"; +import { useCallback, useState } from "react"; const newUserSteps = [ { @@ -70,20 +72,39 @@ const proUserSteps = [ }, ]; +const trialUserSteps = [ + { + title: "Congratulations!", + subtitle: "You 14-day free trial has been activated.", + buttonText: "Start taking notes", + image: , + component: AccentSelector, + }, +]; + const onboarding = { new: newUserSteps, pro: proUserSteps, + trial: trialUserSteps, }; -function OnboardingDialog({ onClose, type }) { +function OnboardingDialog({ onClose: _onClose, type }) { const [step, setStep] = usePersistentState(type, 0); + const steps = onboarding[type]; + + const onClose = useCallback(() => { + setStep(steps.length); + _onClose(); + }, [_onClose, setStep, steps.length]); + + if (!steps || !steps[step]) return null; const { title, subtitle, image, component: Component, buttonText, - } = onboarding[type][step]; + } = steps[step]; return ( @@ -99,7 +120,10 @@ function OnboardingDialog({ onClose, type }) { {buttonText && ( @@ -320,6 +344,8 @@ function CrossPlatform() { } function TrialOffer({ onClose }) { + const [error, setError] = useState(); + const [loading, setLoading] = useState(); return ( - - Note: Upgrade now and get 50% discount on all plans. - + {error ? ( + + {error} + + ) : ( + + Note: Upgrade now and get 50% discount on all plans. + + )} +