mobile: update sheet paywall

This commit is contained in:
Ammar Ahmed
2025-09-30 08:56:37 +05:00
parent 4262641567
commit 203fe5bee0
5 changed files with 41 additions and 15 deletions

View File

@@ -22,6 +22,7 @@ import AppIcon from "../../ui/AppIcon";
import { Button } from "../../ui/button";
import Heading from "../../ui/typography/heading";
import Paragraph from "../../ui/typography/paragraph";
import { SubscriptionProvider } from "@notesnook/core";
const isGithubRelease = Config.GITHUB_RELEASE === "true";
const INDEX_TO_PLAN = {
1: "essential",
@@ -52,6 +53,11 @@ export default function PaywallSheet<Tid extends FeatureId>(props: {
}
}, []);
const isSubscribedOnWeb =
pricingPlans.user?.subscription.provider === SubscriptionProvider.PADDLE ||
pricingPlans.user?.subscription.provider ===
SubscriptionProvider.STREETWRITERS;
return !pricingPlans.currentPlan ? null : (
<View
style={{
@@ -178,6 +184,12 @@ export default function PaywallSheet<Tid extends FeatureId>(props: {
width: "100%"
}}
onPress={() => {
if (isSubscribedOnWeb) {
ToastManager.show({
message: strings.changePlanOnWeb()
});
return;
}
eSendEvent(eCloseSheet);
if (!useUserStore.getState().user) {
Navigation.navigate("Auth", {
@@ -199,18 +211,22 @@ export default function PaywallSheet<Tid extends FeatureId>(props: {
/>
</View>
<Button
type="plain"
title={strings.exploreAllPlans()}
icon="arrow-right"
iconPosition="right"
onPress={() => {
eSendEvent(eCloseSheet);
Navigation.navigate("PayWall", {
context: useUserStore.getState().user ? "logged-in" : "logged-out"
});
}}
/>
{isSubscribedOnWeb ? null : (
<Button
type="plain"
title={strings.exploreAllPlans()}
icon="arrow-right"
iconPosition="right"
onPress={() => {
eSendEvent(eCloseSheet);
Navigation.navigate("PayWall", {
context: useUserStore.getState().user
? "logged-in"
: "logged-out"
});
}}
/>
)}
</>
</View>
);

View File

@@ -1,12 +1,12 @@
{
"name": "@notesnook/mobile",
"version": "3.2.10",
"version": "3.2.12",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@notesnook/mobile",
"version": "3.2.10",
"version": "3.2.12",
"hasInstallScript": true,
"license": "GPL-3.0-or-later",
"workspaces": [

View File

@@ -7180,6 +7180,10 @@ msgstr "You can also link a note to multiple Notebooks. Tap and hold any noteboo
msgid "You can change the theme at any time from Settings or the side menu."
msgstr "You can change the theme at any time from Settings or the side menu."
#: src/strings.ts:2590
msgid "You can change your subscription plan from the web app"
msgstr "You can change your subscription plan from the web app"
#: src/strings.ts:2419
msgid "You can create shortcuts of frequently accessed notebooks in the side menu"
msgstr "You can create shortcuts of frequently accessed notebooks in the side menu"

View File

@@ -7131,6 +7131,10 @@ msgstr ""
msgid "You can change the theme at any time from Settings or the side menu."
msgstr ""
#: src/strings.ts:2590
msgid "You can change your subscription plan from the web app"
msgstr ""
#: src/strings.ts:2419
msgid "You can create shortcuts of frequently accessed notebooks in the side menu"
msgstr ""

View File

@@ -2585,5 +2585,7 @@ Use this if changes from other devices are not appearing on this device. This wi
contactSupportToChangePlan: () =>
t`You have made a one time purchase. To change your plan please contact support.`,
alreadySubscribed: () => t`You are already subscribed to this plan.`,
specialOffer: () => t`Special Offer`
specialOffer: () => t`Special Offer`,
changePlanOnWeb: () =>
t`You can change your subscription plan from the web app`
};