Skip to content

Commit 47ece77

Browse files
devvaannshabose
authored andcommitted
feat: show upsell dialog when free user selects edit mode
1 parent bf159ac commit 47ece77

File tree

2 files changed

+2
-33
lines changed

2 files changed

+2
-33
lines changed

src/extensionsIntegrated/Phoenix-live-preview/main.js

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ define(function (require, exports, module) {
7272
panelHTML = require("text!./panel.html"),
7373
Dialogs = require("widgets/Dialogs"),
7474
DefaultDialogs = require("widgets/DefaultDialogs"),
75+
ProDialogs = require("services/pro-dialogs"),
7576
utils = require('./utils');
7677

7778
const StateManager = PreferencesManager.stateManager;
@@ -273,35 +274,6 @@ define(function (require, exports, module) {
273274
}
274275
}
275276

276-
function _showProFeatureDialog() {
277-
const dialog = Dialogs.showModalDialog(
278-
DefaultDialogs.DIALOG_ID_INFO,
279-
Strings.LIVE_PREVIEW_PRO_FEATURE_TITLE,
280-
Strings.LIVE_PREVIEW_PRO_FEATURE_MESSAGE,
281-
[
282-
{
283-
className: Dialogs.DIALOG_BTN_CLASS_NORMAL,
284-
id: Dialogs.DIALOG_BTN_CANCEL,
285-
text: Strings.CANCEL
286-
},
287-
{
288-
className: Dialogs.DIALOG_BTN_CLASS_PRIMARY,
289-
id: "subscribe",
290-
text: Strings.LIVE_PREVIEW_PRO_SUBSCRIBE
291-
}
292-
]
293-
);
294-
295-
dialog.done(function (buttonId) {
296-
if (buttonId === "subscribe") {
297-
// TODO: write the implementation here...@abose
298-
console.log("the subscribe button got clicked");
299-
}
300-
});
301-
302-
return dialog;
303-
}
304-
305277
// this function is to check if the live highlight feature is enabled or not
306278
function _isLiveHighlightEnabled() {
307279
return CommandManager.get(Commands.FILE_LIVE_HIGHLIGHT).getChecked();
@@ -438,7 +410,7 @@ define(function (require, exports, module) {
438410
LiveDevelopment.setMode("highlight");
439411
} else if (index === 2) {
440412
if (!LiveDevelopment.setMode("edit")) {
441-
_showProFeatureDialog();
413+
ProDialogs.showProUpsellDialog(ProDialogs.UPSELL_TYPE_LIVE_EDIT);
442414
}
443415
} else if (item === Strings.LIVE_PREVIEW_EDIT_HIGHLIGHT_ON) {
444416
// Don't allow edit highlight toggle if edit features are not active

src/nls/root/strings.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,6 @@ define({
216216
"LIVE_PREVIEW_EDIT_HIGHLIGHT_ON": "Edit Highlights on Hover",
217217
"LIVE_PREVIEW_MODE_PREFERENCE": "{0} shows only the webpage, {1} connects the webpage to your code - click on elements to jump to their code and vice versa, {2} provides highlighting along with advanced element manipulation",
218218
"LIVE_PREVIEW_CONFIGURE_MODES": "Configure Live Preview Modes",
219-
"LIVE_PREVIEW_PRO_FEATURE_TITLE": "Pro Feature",
220-
"LIVE_PREVIEW_PRO_FEATURE_MESSAGE": "This is a Pro feature. Subscribe to Phoenix Pro to keep using this feature.",
221-
"LIVE_PREVIEW_PRO_SUBSCRIBE": "Subscribe",
222219

223220
"LIVE_DEV_DETACHED_REPLACED_WITH_DEVTOOLS": "Live Preview was canceled because the browser's developer tools were opened",
224221
"LIVE_DEV_DETACHED_TARGET_CLOSED": "Live Preview was canceled because the page was closed in the browser",

0 commit comments

Comments
 (0)