diff --git a/apps/mobile/app/components/paywall/index.tsx b/apps/mobile/app/components/paywall/index.tsx index 28be8e6b6..d03dbfc17 100644 --- a/apps/mobile/app/components/paywall/index.tsx +++ b/apps/mobile/app/components/paywall/index.tsx @@ -141,6 +141,12 @@ const PayWall = (props: NavigationProps<"PayWall">) => { }; }, []); + const is5YearPlanSelected = ( + isGithubRelease + ? (pricingPlans.selectedProduct as Plan)?.period + : (pricingPlans.selectedProduct as RNIap.Product)?.productId + )?.includes("5"); + return ( { setStep(Steps.select); }} - goNext={() => { + goNext={(product) => { + pricingPlans.selectProduct( + (product as RNIap.Subscription).productId || + (product as Plan).period + ); setStep(Steps.finish); }} /> @@ -647,7 +657,11 @@ After trying all the privacy security oriented note taking apps, for the price a > - {strings.thankYouForSubscribing()} + + {is5YearPlanSelected + ? strings.thankYouForPurchase() + : strings.thankYouForSubscribing()} + @@ -354,8 +357,8 @@ export const Items = ({ paginationStyle={{ position: "relative", marginHorizontal: 2, - marginBottom: 0, - marginTop: 0 + marginBottom: -10, + marginTop: 10 }} contentContainerStyle={{ justifyContent: "flex-start", diff --git a/apps/mobile/app/components/sheets/buy-plan/index.tsx b/apps/mobile/app/components/sheets/buy-plan/index.tsx index fafe4d8ef..c2c3460ab 100644 --- a/apps/mobile/app/components/sheets/buy-plan/index.tsx +++ b/apps/mobile/app/components/sheets/buy-plan/index.tsx @@ -40,7 +40,9 @@ export const BuyPlan = (props: { productId: string; canActivateTrial?: boolean; goBack: () => void; - goNext: () => void; + goNext: ( + product: Plan | RNIap.Subscription | RNIap.Product | undefined + ) => void; }) => { const { colors } = useThemeColors(); const [checkoutUrl, setCheckoutUrl] = useState(); @@ -48,7 +50,7 @@ export const BuyPlan = (props: { planId: props.planId, productId: props.productId, onBuy: () => { - props.goNext(); + props.goNext(pricingPlans.selectedProduct); } }); @@ -78,7 +80,7 @@ export const BuyPlan = (props: { try { const data = JSON.parse(message.nativeEvent.data); if (data.success) { - props.goNext(); + props.goNext(pricingPlans.selectedProduct); } } catch (e) {} }} @@ -139,7 +141,11 @@ export const BuyPlan = (props: { > {strings.dueToday()}{" "} - {pricingPlans.userCanRequestTrial ? ( + {pricingPlans.hasTrialOffer( + props.planId, + (pricingPlans?.selectedProduct as RNIap.Product)?.productId || + (pricingPlans?.selectedProduct as Plan)?.period + ) ? ( - {pricingPlans.userCanRequestTrial + {pricingPlans.hasTrialOffer( + props.planId, + (pricingPlans?.selectedProduct as RNIap.Product)?.productId || + (pricingPlans?.selectedProduct as Plan)?.period + ) ? "FREE" : pricingPlans.getStandardPrice( pricingPlans.selectedProduct as RNIap.Subscription diff --git a/apps/mobile/app/components/ui/sheet/index.js b/apps/mobile/app/components/ui/sheet/index.js index 5c0c35fd7..1f8f89f30 100644 --- a/apps/mobile/app/components/ui/sheet/index.js +++ b/apps/mobile/app/components/ui/sheet/index.js @@ -70,7 +70,6 @@ const SheetWrapper = ({ backgroundColor: colors.primary.background, zIndex: 10, paddingTop: 5, - paddingBottom: 0, borderTopRightRadius: 15, borderTopLeftRadius: 15, alignSelf: "center", @@ -78,9 +77,10 @@ const SheetWrapper = ({ borderBottomLeftRadius: 0, ...getContainerBorder(colors.primary.border, 0.5), borderBottomWidth: 0, - paddingBottom: isGestureNavigationEnabled - ? insets.bottom - : insets.bottom || 48 + paddingBottom: + isGestureNavigationEnabled && Platform.OS === "android" + ? insets.bottom + : 0 }; }, [ colors.primary.background, @@ -165,8 +165,8 @@ const SheetWrapper = ({ diff --git a/apps/mobile/app/components/walkthroughs/index.tsx b/apps/mobile/app/components/walkthroughs/index.tsx index 22760aaa5..545c4027b 100644 --- a/apps/mobile/app/components/walkthroughs/index.tsx +++ b/apps/mobile/app/components/walkthroughs/index.tsx @@ -17,20 +17,20 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +import { strings } from "@notesnook/intl"; +import { useThemeColors } from "@notesnook/theme"; import React, { useState } from "react"; import { LayoutAnimation, View } from "react-native"; import { MMKV } from "../../common/database/mmkv"; import { eSendEvent, presentSheet } from "../../services/event-manager"; -import { useThemeColors } from "@notesnook/theme"; import { eCloseSheet } from "../../utils/events"; import { AppFontSize } from "../../utils/size"; +import { DefaultAppStyles } from "../../utils/styles"; import { sleep } from "../../utils/time"; import { Button } from "../ui/button"; import Heading from "../ui/typography/heading"; import Paragraph from "../ui/typography/paragraph"; import walkthroughs, { TStep } from "./walkthroughs"; -import { strings } from "@notesnook/intl"; -import { DefaultAppStyles } from "../../utils/styles"; export const Walkthrough = ({ steps, canSkip = true @@ -65,7 +65,7 @@ export const Walkthrough = ({ textAlign: "center" }} > - Notesnook Free plan activated + {step.title} ) : null} {step.text ? ( @@ -151,7 +151,7 @@ Walkthrough.init = async () => { }; Walkthrough.present = async ( - id: "notebooks" | "trialstarted" | "emailconfirmed" | "prouser", + id: "emailconfirmed" | "prouser", canSkip = true, nopersist?: boolean ) => { @@ -162,7 +162,7 @@ Walkthrough.present = async ( if (walkthroughState[id]) return; Walkthrough.update(id); } - const walkthrough = walkthroughs[id]; + const walkthrough = walkthroughs[id](); if (!walkthrough) return; presentSheet({ component: , diff --git a/apps/mobile/app/components/walkthroughs/walkthroughs.tsx b/apps/mobile/app/components/walkthroughs/walkthroughs.tsx index 82c48c75e..f42ba58e8 100644 --- a/apps/mobile/app/components/walkthroughs/walkthroughs.tsx +++ b/apps/mobile/app/components/walkthroughs/walkthroughs.tsx @@ -60,282 +60,7 @@ export type TStep = { }; }; -const NotebookWelcome = () => { - const { colors } = useThemeColors(); - const data = useRotator([ - { - title: strings.workAndOffice(), - description: strings.workAndOfficeDesc(), - count: 2 - }, - { - title: strings.schoolWork(), - description: strings.schoolWorkDesc(), - count: 5 - }, - { - title: strings.recipes(), - description: strings.recipesDesc(), - count: 10 - } - ]); - - return ( - - - - {data?.title} - - {data?.description} - - - {strings.dataTypesCamelCase.notebook()} - {data?.count}{" "} - {strings.dataTypesPlural.note()} - - - - ); -}; - -const notebooks: { id: string; steps: TStep[] } = { - id: "notebooks", - steps: [ - { - title: strings.notebooks(), - text: strings.boostProductivityNotebook(), - walkthroughItem: () => , - button: { - type: "next", - title: strings.next() - } - }, - { - title: strings.notebookNotes(), - text: strings.notebookNotesDesc(), - walkthroughItem: (colors: any) => ( - - - - {strings.workAndOffice()} - - {strings.workAndOfficeDesc()} - - - {strings.notes(2)} - - - - - {" "} - {strings.tasks()} - - - - - {" "} - {strings.taskAValue()} - - - - - {" "} - {strings.taskBValue()} - - - - - {" "} - {strings.meetings()} - - - - ), - button: { - type: "next", - title: strings.next() - } - }, - { - title: strings.easyAccess(), - text: strings.easyAccessDesc(), - walkthroughItem: () => ( - - {/* {}} - /> - - {}} - /> */} - - ), - button: { - type: "done", - title: strings.addFirstNotebook(), - action: () => { - eSendEvent(eOpenAddNotebookDialog); - } - } - } - ] -}; - -const trialstarted: { id: string; steps: TStep[] } = { - id: "trialstarted", - steps: [ - { - title: strings.trialStarted(), - text: strings.trialStartedDesc(), - walkthroughItem: (colors) => ( - - ), - button: { - type: "next", - title: strings.next() - } - }, - { - title: strings.joinTheCause(), - text: strings.meetPrivacyMinded(), - walkthroughItem: (colors) => ( - - ), - button: { - type: "done", - title: strings.continue() - }, - actionButton: { - text: strings.joinDiscord(), - action: () => { - Linking.openURL("https://discord.gg/zQBK97EE22").catch(() => { - /* empty */ - }); - } - } - } - ] -}; - -const emailconfirmed: { id: string; steps: TStep[] } = { +const emailconfirmed: () => { id: string; steps: TStep[] } = () => ({ id: "emailconfirmed", steps: [ { @@ -350,86 +75,29 @@ const emailconfirmed: { id: string; steps: TStep[] } = { } } ] -}; +}); -const Support = () => { - return ( - - {strings.prioritySupport()} - - {strings.weAreAlwaysListening()} - - - -