From 24da82313e6ff50a35fba4e677bc23aee0cc9b7e Mon Sep 17 00:00:00 2001 From: Ammar Ahmed Date: Tue, 1 Jul 2025 12:13:03 +0500 Subject: [PATCH] mobile: pricing changes --- apps/mobile/app/components/auth/auth-modal.js | 95 +- apps/mobile/app/components/auth/header.tsx | 80 ++ apps/mobile/app/components/auth/login.js | 2 +- .../app/components/auth/signup-context.ts | 27 + apps/mobile/app/components/auth/signup.js | 477 +++++----- .../auth/{use-login.js => use-login.ts} | 34 +- apps/mobile/app/components/intro/index.tsx | 17 +- apps/mobile/app/components/loading/index.tsx | 88 ++ .../app/components/premium/component.js | 290 ------- .../app/components/premium/component.tsx | 768 ++++++++++++++++ .../app/components/premium/features-list.tsx | 60 ++ apps/mobile/app/components/premium/index.js | 5 +- .../app/components/premium/pricing-plans.tsx | 726 +++++----------- apps/mobile/app/components/premium/pro-tag.js | 2 +- .../app/components/sheets/buy-plan/index.tsx | 371 ++++++++ apps/mobile/app/hooks/use-pricing-plans.ts | 817 ++++++++++++++++++ apps/mobile/app/hooks/use-pricing.ts | 4 +- apps/mobile/app/services/premium.js | 30 +- .../mobile/app/stores/use-navigation-store.ts | 7 +- apps/mobile/app/utils/constants.ts | 24 +- apps/mobile/package-lock.json | 5 + apps/mobile/scripts/optimize-fonts.mjs | 4 +- 22 files changed, 2794 insertions(+), 1139 deletions(-) create mode 100644 apps/mobile/app/components/auth/header.tsx create mode 100644 apps/mobile/app/components/auth/signup-context.ts rename apps/mobile/app/components/auth/{use-login.js => use-login.ts} (85%) create mode 100644 apps/mobile/app/components/loading/index.tsx delete mode 100644 apps/mobile/app/components/premium/component.js create mode 100644 apps/mobile/app/components/premium/component.tsx create mode 100644 apps/mobile/app/components/premium/features-list.tsx create mode 100644 apps/mobile/app/components/sheets/buy-plan/index.tsx create mode 100644 apps/mobile/app/hooks/use-pricing-plans.ts diff --git a/apps/mobile/app/components/auth/auth-modal.js b/apps/mobile/app/components/auth/auth-modal.js index 3f81926aa..d60f9cf40 100644 --- a/apps/mobile/app/components/auth/auth-modal.js +++ b/apps/mobile/app/components/auth/auth-modal.js @@ -19,9 +19,6 @@ along with this program. If not, see . import { useThemeColors } from "@notesnook/theme"; import React, { useEffect, useRef, useState } from "react"; -import { Platform, View } from "react-native"; -import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view"; -import useGlobalSafeAreaInsets from "../../hooks/use-global-safe-area-insets"; import { eSubscribeEvent, eUnSubscribeEvent @@ -31,9 +28,7 @@ import { eCloseLoginDialog, eOpenLoginDialog } from "../../utils/events"; import { sleep } from "../../utils/time"; import BaseDialog from "../dialog/base-dialog"; import { Toast } from "../toast"; -import { Button } from "../ui/button"; -import { IconButton } from "../ui/icon-button"; -import { hideAuth, initialAuthMode } from "./common"; +import { initialAuthMode } from "./common"; import { Login } from "./login"; import { Signup } from "./signup"; import { strings } from "@notesnook/intl"; @@ -51,7 +46,6 @@ const AuthModal = () => { const [visible, setVisible] = useState(false); const [currentAuthMode, setCurrentAuthMode] = useState(AuthMode.login); const actionSheetRef = useRef(); - const insets = useGlobalSafeAreaInsets(); useEffect(() => { eSubscribeEvent(eOpenLoginDialog, open); @@ -99,81 +93,18 @@ const AuthModal = () => { centered={false} enableSheetKeyboardHandler > - - {currentAuthMode !== AuthMode.login ? ( - setCurrentAuthMode(mode)} - trial={AuthMode.trialSignup === currentAuthMode} - welcome={initialAuthMode.current === AuthMode.welcomeSignup} - /> - ) : ( - setCurrentAuthMode(mode)} - /> - )} - - - - - {initialAuthMode.current === AuthMode.welcomeSignup ? null : ( - { - hideAuth(); - }} - color={colors.primary.paragraph} - /> - )} - - {initialAuthMode.current !== AuthMode.welcomeSignup ? null : ( -