chore: show Super demo modal if user doesn't have subscription when switching editor to Super
This commit is contained in:
@@ -154,6 +154,11 @@ const ChangeEditorMenu: FunctionComponent<ChangeEditorMenuProps> = ({
|
||||
const handleMenuSelection = useCallback(
|
||||
async (menuItem: EditorMenuItem) => {
|
||||
if (!menuItem.isEntitled) {
|
||||
if (menuItem.uiFeature.featureIdentifier === NativeFeatureIdentifier.TYPES.SuperEditor) {
|
||||
premiumModal.showSuperDemo()
|
||||
return
|
||||
}
|
||||
|
||||
premiumModal.activate(menuItem.uiFeature.displayName)
|
||||
return
|
||||
}
|
||||
@@ -249,7 +254,7 @@ const ChangeEditorMenu: FunctionComponent<ChangeEditorMenuProps> = ({
|
||||
<>
|
||||
<Menu className="pb-1 pt-0.5" a11yLabel="Change note type menu">
|
||||
<MenuSection>
|
||||
<div className="flex items-center justify-between pr-4 py-3 md:pt-0 md:pb-1">
|
||||
<div className="flex items-center justify-between py-3 pr-4 md:pb-1 md:pt-0">
|
||||
<div className="px-3">
|
||||
<h2 className="text-base font-bold">Choose a note type</h2>
|
||||
{unableToFindEditor && (
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
NoteMutator,
|
||||
NoteType,
|
||||
SNNote,
|
||||
NativeFeatureIdentifier,
|
||||
} from '@standardnotes/snjs'
|
||||
import { useCallback, useMemo, useState } from 'react'
|
||||
import Icon from '../Icon/Icon'
|
||||
@@ -60,6 +61,11 @@ const ChangeEditorMultipleMenu = ({ application, notes, setDisableClickOutside }
|
||||
const handleMenuSelection = useCallback(
|
||||
async (itemToBeSelected: EditorMenuItem) => {
|
||||
if (!itemToBeSelected.isEntitled) {
|
||||
if (itemToBeSelected.uiFeature.featureIdentifier === NativeFeatureIdentifier.TYPES.SuperEditor) {
|
||||
premiumModal.showSuperDemo()
|
||||
return
|
||||
}
|
||||
|
||||
premiumModal.activate(itemToBeSelected.uiFeature.displayName)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user