feat: open purchase flow when clicking upgrade cta with no account (#1771)
This commit is contained in:
@@ -12,18 +12,6 @@ const UpgradeNow = ({ application, featuresController }: Props) => {
|
|||||||
const shouldShowCTA = !featuresController.hasFolders
|
const shouldShowCTA = !featuresController.hasFolders
|
||||||
const hasAccount = application.hasAccount()
|
const hasAccount = application.hasAccount()
|
||||||
|
|
||||||
const openPlansPage = () => {
|
|
||||||
if (!window.plansUrl) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (application.isNativeMobileWeb()) {
|
|
||||||
application.mobileDevice().openUrl(window.plansUrl)
|
|
||||||
} else {
|
|
||||||
window.location.assign(window.plansUrl)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return shouldShowCTA ? (
|
return shouldShowCTA ? (
|
||||||
<div className="flex h-full items-center px-2">
|
<div className="flex h-full items-center px-2">
|
||||||
<button
|
<button
|
||||||
@@ -34,7 +22,7 @@ const UpgradeNow = ({ application, featuresController }: Props) => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
openPlansPage()
|
application.getViewControllerManager().purchaseFlowController.openPurchaseFlow()
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Upgrade now
|
Upgrade now
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { FunctionComponent } from 'react'
|
|||||||
import CreateAccount from './Panes/CreateAccount'
|
import CreateAccount from './Panes/CreateAccount'
|
||||||
import SignIn from './Panes/SignIn'
|
import SignIn from './Panes/SignIn'
|
||||||
import { SNLogoFull } from '@standardnotes/icons'
|
import { SNLogoFull } from '@standardnotes/icons'
|
||||||
|
import Icon from '../Icon/Icon'
|
||||||
|
|
||||||
type PaneSelectorProps = {
|
type PaneSelectorProps = {
|
||||||
currentPane: PurchaseFlowPane
|
currentPane: PurchaseFlowPane
|
||||||
@@ -36,6 +37,14 @@ const PurchaseFlowView: FunctionComponent<PurchaseFlowViewProps> = ({ viewContro
|
|||||||
<div className="absolute top-0 left-0 z-purchase-flow flex h-full w-full items-center justify-center overflow-hidden bg-passive-super-light">
|
<div className="absolute top-0 left-0 z-purchase-flow flex h-full w-full items-center justify-center overflow-hidden bg-passive-super-light">
|
||||||
<div className="relative w-fit">
|
<div className="relative w-fit">
|
||||||
<div className="rounded-0 relative mb-4 w-full border border-solid border-border bg-default px-8 py-8 md:rounded md:p-12">
|
<div className="rounded-0 relative mb-4 w-full border border-solid border-border bg-default px-8 py-8 md:rounded md:p-12">
|
||||||
|
<button
|
||||||
|
className="absolute top-4 right-4 rounded-full p-1 hover:bg-info-backdrop"
|
||||||
|
onClick={() => {
|
||||||
|
viewControllerManager.purchaseFlowController.closePurchaseFlow()
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Icon type="close" className="text-neutral" />
|
||||||
|
</button>
|
||||||
<SNLogoFull className="mb-5" />
|
<SNLogoFull className="mb-5" />
|
||||||
<PurchaseFlowPaneSelector
|
<PurchaseFlowPaneSelector
|
||||||
currentPane={currentPane}
|
currentPane={currentPane}
|
||||||
|
|||||||
Reference in New Issue
Block a user