diff --git a/apps/mobile/app/components/list/reorderable-list.tsx b/apps/mobile/app/components/list/reorderable-list.tsx index baff07bf6..6ff77e5e2 100644 --- a/apps/mobile/app/components/list/reorderable-list.tsx +++ b/apps/mobile/app/components/list/reorderable-list.tsx @@ -132,7 +132,8 @@ function ReorderableList({ ); function getOrderedItems() { - const items: T[] = customizableSidebarFeature?.isAllowed ? data : []; + if (!customizableSidebarFeature?.isAllowed) return data; + const items: T[] = []; itemOrderState.forEach((id) => { const item = data.find((i) => i.id === id); if (!item) return; @@ -183,7 +184,6 @@ function ReorderableList({ dragging: true }); }} - disableVirtualization itemsDraggable={disableDefaultDrag ? dragging : true} lockItemDragsToMainAxis onItemReorder={async ({ fromIndex, fromItem, toIndex, toItem }) => { diff --git a/apps/mobile/app/components/premium/paywall.tsx b/apps/mobile/app/components/premium/paywall.tsx index fd5b17972..f2ceea066 100644 --- a/apps/mobile/app/components/premium/paywall.tsx +++ b/apps/mobile/app/components/premium/paywall.tsx @@ -18,6 +18,7 @@ along with this program. If not, see . */ import { getFeaturesTable } from "@notesnook/common"; +import { EV, EVENTS, Plan, SubscriptionPlan, User } from "@notesnook/core"; import { strings } from "@notesnook/intl"; import { useThemeColors } from "@notesnook/theme"; import React, { useEffect, useState } from "react"; @@ -37,6 +38,15 @@ import { SafeAreaView } from "react-native-safe-area-context"; import Icon from "react-native-vector-icons/MaterialCommunityIcons"; import { WebView } from "react-native-webview"; import ToggleSwitch from "toggle-switch-react-native"; +import { + ANDROID_POLICE_SVG, + APPLE_INSIDER_PNG, + ITS_FOSS_NEWS_PNG, + NESS_LABS_PNG, + PRIVACY_GUIDES_SVG, + TECHLORE_SVG, + XDA_SVG +} from "../../assets/images/assets"; import { useNavigationFocus } from "../../hooks/use-navigation-focus"; import usePricingPlans, { PricingPlan } from "../../hooks/use-pricing-plans"; import Navigation, { NavigationProps } from "../../services/navigation"; @@ -44,28 +54,16 @@ import { getElevationStyle } from "../../utils/elevation"; import { openLinkInBrowser } from "../../utils/functions"; import { AppFontSize } from "../../utils/size"; import { DefaultAppStyles } from "../../utils/styles"; +import { AuthMode } from "../auth/common"; import { Header } from "../header"; import { BuyPlan } from "../sheets/buy-plan"; import { Toast } from "../toast"; import AppIcon from "../ui/AppIcon"; import { Button } from "../ui/button"; import { IconButton } from "../ui/icon-button"; +import { SvgView } from "../ui/svg"; import Heading from "../ui/typography/heading"; import Paragraph from "../ui/typography/paragraph"; -import { db } from "../../common/database"; -import { SvgView } from "../ui/svg"; -import { - ANDROID_POLICE_SVG, - APPLE_INSIDER_PNG, - FREEDOM_PRESS_SVG, - ITS_FOSS_NEWS_PNG, - NESS_LABS_PNG, - PRIVACY_GUIDES_SVG, - TECHLORE_SVG, - XDA_SVG -} from "../../assets/images/assets"; -import { EV, EVENTS, Plan, SubscriptionPlan, User } from "@notesnook/core"; -import { AuthMode } from "../auth/common"; const Steps = { select: 1, @@ -944,7 +942,7 @@ const PricingPlanCard = ({ const price = pricingPlans?.getPrice( product as RNIap.Subscription, - 1, + pricingPlans.hasTrialOffer(plan.id, product?.productId) ? 1 : 0, annualBilling ); diff --git a/apps/mobile/app/components/side-menu/side-menu-home.tsx b/apps/mobile/app/components/side-menu/side-menu-home.tsx index b88aa01a3..f7323a003 100644 --- a/apps/mobile/app/components/side-menu/side-menu-home.tsx +++ b/apps/mobile/app/components/side-menu/side-menu-home.tsx @@ -16,6 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ +import { SubscriptionPlan } from "@notesnook/core"; import { strings } from "@notesnook/intl"; import { useThemeColors } from "@notesnook/theme"; import React from "react"; @@ -27,7 +28,6 @@ import { useMenuStore } from "../../stores/use-menu-store"; import { useSettingStore } from "../../stores/use-setting-store"; import { useUserStore } from "../../stores/use-user-store"; import { SUBSCRIPTION_STATUS } from "../../utils/constants"; -import { MenuItemsList } from "../../utils/menu-items"; import { DefaultAppStyles } from "../../utils/styles"; import ReorderableList from "../list/reorderable-list"; import { MenuItemProperties } from "../sheets/menu-item-properties"; @@ -36,6 +36,7 @@ import { ColorSection } from "./color-section"; import { MenuItem } from "./menu-item"; import { PinnedSection } from "./pinned-section"; import { SideMenuHeader } from "./side-menu-header"; +import { MenuItemsList } from "../../utils/menu-items"; const pro = { title: strings.upgradePlan(), @@ -59,7 +60,7 @@ export function SideMenuHome() { state.hiddenItems["routes"] ]); const subscriptionType = useUserStore( - (state) => state.user?.subscription?.type + (state) => state.user?.subscription?.plan ); const user = useUserStore.getState().user; @@ -139,8 +140,9 @@ export function SideMenuHome() { paddingVertical: DefaultAppStyles.GAP_VERTICAL }} > - {subscriptionType === SUBSCRIPTION_STATUS.TRIAL || - subscriptionType === SUBSCRIPTION_STATUS.BASIC || + {((subscriptionType === SUBSCRIPTION_STATUS.TRIAL || + subscriptionType === SUBSCRIPTION_STATUS.BASIC) && + subscriptionType === SubscriptionPlan.FREE) || !user ? (