This commit is contained in:
Mo
2022-11-13 09:28:16 -06:00
committed by GitHub
parent e56a960bbf
commit d519aca685
49 changed files with 512 additions and 151 deletions

View File

@@ -2,7 +2,6 @@ import { WebApplication } from '@/Application/Application'
import { FeaturesController } from '@/Controllers/FeaturesController'
import { SubscriptionController } from '@/Controllers/Subscription/SubscriptionController'
import { observer } from 'mobx-react-lite'
import { loadPurchaseFlowUrl } from '../PurchaseFlow/PurchaseFlowFunctions'
type Props = {
application: WebApplication
@@ -14,22 +13,11 @@ const UpgradeNow = ({ application, featuresController, subscriptionContoller }:
const shouldShowCTA = !featuresController.hasFolders
const hasAccount = subscriptionContoller.hasAccount
if (hasAccount && subscriptionContoller.hideSubscriptionMarketing) {
return null
}
return shouldShowCTA ? (
<div className="flex h-full items-center px-2">
<button
className="rounded bg-info py-0.5 px-1.5 text-sm font-bold uppercase text-info-contrast hover:brightness-125 lg:text-xs"
onClick={() => {
if (hasAccount) {
void loadPurchaseFlowUrl(application)
return
}
application.getViewControllerManager().purchaseFlowController.openPurchaseFlow()
}}
onClick={() => application.openPurchaseFlow()}
>
{hasAccount ? 'Unlock features' : 'Sign up to sync'}
</button>