2022-08-31 06:33:37 +05:00
|
|
|
/*
|
|
|
|
|
This file is part of the Notesnook project (https://notesnook.com/)
|
|
|
|
|
|
2023-01-16 13:44:52 +05:00
|
|
|
Copyright (C) 2023 Streetwriters (Private) Limited
|
2022-08-31 06:33:37 +05:00
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
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 <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
2022-08-30 16:13:11 +05:00
|
|
|
|
2025-08-21 10:34:00 +05:00
|
|
|
import { formatBytes } from "@notesnook/common";
|
2025-10-04 12:54:01 +05:00
|
|
|
import { SubscriptionPlan, SubscriptionProvider } from "@notesnook/core";
|
2025-08-01 11:19:22 +05:00
|
|
|
import { strings } from "@notesnook/intl";
|
2024-02-29 23:26:58 +05:00
|
|
|
import { useThemeColors } from "@notesnook/theme";
|
|
|
|
|
import { useNetInfo } from "@react-native-community/netinfo";
|
2022-08-26 16:19:39 +05:00
|
|
|
import dayjs from "dayjs";
|
2022-08-29 16:19:17 +05:00
|
|
|
import React from "react";
|
2025-10-05 00:58:02 +05:00
|
|
|
import { Image, Platform, TouchableOpacity, View } from "react-native";
|
2024-02-29 23:26:58 +05:00
|
|
|
import ImagePicker from "react-native-image-crop-picker";
|
2022-08-26 16:19:39 +05:00
|
|
|
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
|
2024-02-29 23:26:58 +05:00
|
|
|
import { db } from "../../common/database";
|
|
|
|
|
import { presentDialog } from "../../components/dialog/functions";
|
2026-05-08 10:37:58 +05:00
|
|
|
import {
|
|
|
|
|
createFormRef,
|
|
|
|
|
validators
|
|
|
|
|
} from "../../components/ui/input/form-input";
|
2025-08-18 13:13:00 +05:00
|
|
|
import { PlanLimits } from "../../components/sheets/plan-limits";
|
2024-02-29 23:26:58 +05:00
|
|
|
import AppIcon from "../../components/ui/AppIcon";
|
2025-08-01 11:19:22 +05:00
|
|
|
import { Button } from "../../components/ui/button";
|
2022-08-26 16:19:39 +05:00
|
|
|
import { TimeSince } from "../../components/ui/time-since";
|
|
|
|
|
import Paragraph from "../../components/ui/typography/paragraph";
|
2025-09-24 10:23:00 +05:00
|
|
|
import { presentSheet, ToastManager } from "../../services/event-manager";
|
2025-08-01 11:19:22 +05:00
|
|
|
import Navigation from "../../services/navigation";
|
2025-10-04 12:54:01 +05:00
|
|
|
import PremiumService from "../../services/premium";
|
2024-02-29 23:26:58 +05:00
|
|
|
import { useThemeStore } from "../../stores/use-theme-store";
|
2024-02-05 12:14:45 +05:00
|
|
|
import { SyncStatus, useUserStore } from "../../stores/use-user-store";
|
2025-09-04 11:33:20 +05:00
|
|
|
import { planToDisplayName } from "../../utils/constants";
|
2025-02-13 10:41:15 +05:00
|
|
|
import { AppFontSize } from "../../utils/size";
|
2025-02-26 10:18:41 +05:00
|
|
|
import { DefaultAppStyles } from "../../utils/styles";
|
2025-08-21 10:34:00 +05:00
|
|
|
import { SectionItem } from "./section-item";
|
2025-10-06 10:58:39 +05:00
|
|
|
import SettingsService from "../../services/settings";
|
2024-02-05 12:14:45 +05:00
|
|
|
|
2022-08-26 16:19:39 +05:00
|
|
|
export const getTimeLeft = (t2) => {
|
|
|
|
|
let daysRemaining = dayjs(t2).diff(dayjs(), "days");
|
2021-11-24 09:57:23 +05:00
|
|
|
return {
|
2022-08-26 16:19:39 +05:00
|
|
|
time: dayjs(t2).diff(dayjs(), daysRemaining === 0 ? "hours" : "days"),
|
2021-11-24 09:57:23 +05:00
|
|
|
isHour: daysRemaining === 0
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2024-03-26 08:57:04 +05:00
|
|
|
const ProfilePicPlaceholder = (props) => {
|
2024-02-05 12:14:45 +05:00
|
|
|
const { colors } = useThemeColors();
|
|
|
|
|
return (
|
2024-02-29 23:26:58 +05:00
|
|
|
<TouchableOpacity
|
2024-02-05 12:14:45 +05:00
|
|
|
style={{
|
|
|
|
|
alignItems: "center"
|
|
|
|
|
}}
|
2024-02-29 23:26:58 +05:00
|
|
|
activeOpacity={0.9}
|
2024-03-26 08:57:04 +05:00
|
|
|
onPress={props?.onChangePicture}
|
2024-02-05 12:14:45 +05:00
|
|
|
>
|
|
|
|
|
<View
|
|
|
|
|
style={{
|
|
|
|
|
backgroundColor: colors.primary.shade,
|
|
|
|
|
borderRadius: 100,
|
2025-08-01 11:19:22 +05:00
|
|
|
width: 80,
|
|
|
|
|
height: 80,
|
2024-02-05 12:14:45 +05:00
|
|
|
alignItems: "center",
|
|
|
|
|
justifyContent: "center"
|
|
|
|
|
}}
|
|
|
|
|
>
|
2025-08-21 10:34:00 +05:00
|
|
|
<Icon size={35} color={colors.primary.accent} name="account-outline" />
|
2024-02-05 12:14:45 +05:00
|
|
|
</View>
|
2024-02-29 23:26:58 +05:00
|
|
|
</TouchableOpacity>
|
2024-02-05 12:14:45 +05:00
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
2024-03-26 08:57:04 +05:00
|
|
|
const onChangePicture = () => {
|
2025-02-26 16:03:59 +05:00
|
|
|
useUserStore.setState({
|
|
|
|
|
disableAppLockRequests: true
|
|
|
|
|
});
|
2024-03-26 08:57:04 +05:00
|
|
|
const theme =
|
|
|
|
|
useThemeStore.getState().colorScheme === "dark"
|
|
|
|
|
? useThemeStore.getState().darkTheme
|
|
|
|
|
: useThemeStore.getState().lightTheme;
|
|
|
|
|
|
|
|
|
|
ImagePicker.openPicker({
|
|
|
|
|
compressImageMaxWidth: 256,
|
|
|
|
|
compressImageMaxHeight: 256,
|
|
|
|
|
compressImageQuality: 0.8,
|
|
|
|
|
avoidEmptySpaceAroundImage: true,
|
|
|
|
|
cropping: true,
|
|
|
|
|
cropperCircleOverlay: true,
|
|
|
|
|
mediaType: "photo",
|
|
|
|
|
forceJpg: true,
|
|
|
|
|
includeBase64: true,
|
|
|
|
|
writeTempFile: false,
|
|
|
|
|
cropperToolbarColor: theme.scopes.base.primary.background,
|
2024-08-13 15:13:46 +05:00
|
|
|
cropperToolbarTitle: strings.editProfilePicture(),
|
2024-03-26 08:57:04 +05:00
|
|
|
cropperActiveWidgetColor: theme.scopes.base.primary.accent,
|
|
|
|
|
cropperToolbarWidgetColor: theme.scopes.base.primary.icon
|
2025-02-26 16:03:59 +05:00
|
|
|
})
|
|
|
|
|
.then(async (image) => {
|
|
|
|
|
if (!image.data) return;
|
|
|
|
|
await db.settings.setProfile({
|
|
|
|
|
profilePicture: "data:image/jpeg;base64," + image.data
|
|
|
|
|
});
|
|
|
|
|
useUserStore.setState({
|
|
|
|
|
profile: db.settings.getProfile()
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
useUserStore.setState({
|
|
|
|
|
disableAppLockRequests: false
|
|
|
|
|
});
|
|
|
|
|
}, 1000);
|
2024-03-26 08:57:04 +05:00
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
2022-04-07 04:20:13 +05:00
|
|
|
const SettingsUserSection = ({ item }) => {
|
2023-08-01 12:07:21 +05:00
|
|
|
const { colors } = useThemeColors();
|
2025-08-21 10:34:00 +05:00
|
|
|
const [user] = useUserStore((state) => [state.user]);
|
2022-08-26 16:19:39 +05:00
|
|
|
const lastSynced = useUserStore((state) => state.lastSynced);
|
2024-02-05 12:14:45 +05:00
|
|
|
const lastSyncStatus = useUserStore((state) => state.lastSyncStatus);
|
|
|
|
|
const { isInternetReachable } = useNetInfo();
|
|
|
|
|
const isOffline = !isInternetReachable;
|
2024-02-29 23:26:58 +05:00
|
|
|
const userProfile = useUserStore((state) => state.profile);
|
2025-09-03 12:38:47 +05:00
|
|
|
const used = user?.storageUsed || 0;
|
|
|
|
|
const total = user?.totalStorage || 0;
|
2025-09-04 11:33:20 +05:00
|
|
|
|
2025-10-04 12:54:01 +05:00
|
|
|
const isCurrentPlatform =
|
2025-10-05 01:11:09 +05:00
|
|
|
(user?.subscription?.provider === SubscriptionProvider.APPLE &&
|
2025-10-04 12:54:01 +05:00
|
|
|
Platform.OS === "ios") ||
|
2025-10-05 01:11:09 +05:00
|
|
|
(user?.subscription?.provider === SubscriptionProvider.GOOGLE &&
|
2025-10-04 12:54:01 +05:00
|
|
|
Platform.OS === "android");
|
|
|
|
|
|
2021-11-24 09:57:23 +05:00
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
{user ? (
|
|
|
|
|
<>
|
|
|
|
|
<View
|
|
|
|
|
style={{
|
2025-02-26 10:18:41 +05:00
|
|
|
paddingHorizontal: DefaultAppStyles.GAP,
|
2025-09-10 12:28:44 +05:00
|
|
|
paddingTop: 25
|
2022-01-22 12:57:05 +05:00
|
|
|
}}
|
|
|
|
|
>
|
2021-11-24 09:57:23 +05:00
|
|
|
<View
|
|
|
|
|
style={{
|
2024-02-05 12:14:45 +05:00
|
|
|
flexDirection: "row",
|
|
|
|
|
width: "100%"
|
2022-01-22 12:57:05 +05:00
|
|
|
}}
|
|
|
|
|
>
|
2021-11-24 09:57:23 +05:00
|
|
|
<View
|
|
|
|
|
style={{
|
2025-08-01 11:19:22 +05:00
|
|
|
flexDirection: "row",
|
|
|
|
|
width: "100%",
|
|
|
|
|
gap: DefaultAppStyles.GAP,
|
|
|
|
|
alignItems: "center"
|
2022-01-22 12:57:05 +05:00
|
|
|
}}
|
|
|
|
|
>
|
2021-11-24 09:57:23 +05:00
|
|
|
<View
|
|
|
|
|
style={{
|
2024-02-05 12:14:45 +05:00
|
|
|
borderRadius: 100,
|
2025-08-01 11:19:22 +05:00
|
|
|
alignSelf: "flex-start"
|
2024-02-05 12:14:45 +05:00
|
|
|
}}
|
|
|
|
|
>
|
2024-02-29 23:26:58 +05:00
|
|
|
{userProfile?.profilePicture ? (
|
2024-03-26 08:57:04 +05:00
|
|
|
<TouchableOpacity
|
|
|
|
|
onPress={onChangePicture}
|
|
|
|
|
activeOpacity={1}
|
|
|
|
|
>
|
|
|
|
|
<Image
|
|
|
|
|
source={{
|
|
|
|
|
uri: userProfile?.profilePicture
|
|
|
|
|
}}
|
|
|
|
|
style={{
|
2025-08-01 11:19:22 +05:00
|
|
|
width: 80,
|
|
|
|
|
height: 80,
|
|
|
|
|
borderRadius: 80
|
2024-03-26 08:57:04 +05:00
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</TouchableOpacity>
|
2024-02-29 23:26:58 +05:00
|
|
|
) : (
|
2024-03-26 08:57:04 +05:00
|
|
|
<ProfilePicPlaceholder onChangePicture={onChangePicture} />
|
2024-02-29 23:26:58 +05:00
|
|
|
)}
|
2024-02-05 12:14:45 +05:00
|
|
|
</View>
|
|
|
|
|
|
2025-08-01 11:19:22 +05:00
|
|
|
<View>
|
2024-02-29 23:26:58 +05:00
|
|
|
<Paragraph
|
|
|
|
|
onPress={() => {
|
|
|
|
|
presentDialog({
|
2024-08-13 15:13:46 +05:00
|
|
|
title: strings.setFullName(),
|
|
|
|
|
paragraph: strings.setFullNameDesc(),
|
|
|
|
|
positiveText: strings.save(),
|
2026-05-08 10:37:58 +05:00
|
|
|
form: {
|
|
|
|
|
formRef: createFormRef({
|
|
|
|
|
fullName: userProfile?.fullName || ""
|
|
|
|
|
}),
|
|
|
|
|
items: [
|
|
|
|
|
{
|
|
|
|
|
name: "fullName",
|
|
|
|
|
placeholder: strings.enterFullName(),
|
|
|
|
|
defaultValue: userProfile?.fullName,
|
|
|
|
|
validators: [
|
|
|
|
|
validators.required(strings.nameIsRequired())
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
onFormSubmit: async (form) => {
|
|
|
|
|
try {
|
|
|
|
|
await db.settings.setProfile({
|
|
|
|
|
fullName: form.getValue("fullName")
|
|
|
|
|
});
|
2024-02-29 23:26:58 +05:00
|
|
|
useUserStore.setState({
|
2024-03-22 08:34:25 +05:00
|
|
|
profile: db.settings.getProfile()
|
2024-02-29 23:26:58 +05:00
|
|
|
});
|
2026-05-08 10:37:58 +05:00
|
|
|
return true;
|
|
|
|
|
} catch (e) {
|
|
|
|
|
form.setError("fullName", e.message);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-02-29 23:26:58 +05:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}}
|
|
|
|
|
color={colors.primary.heading}
|
2025-08-01 11:19:22 +05:00
|
|
|
size={AppFontSize.md}
|
2024-02-29 23:26:58 +05:00
|
|
|
>
|
|
|
|
|
{userProfile?.fullName
|
|
|
|
|
? userProfile.fullName + " "
|
2024-07-27 10:19:43 +05:00
|
|
|
: strings.setYourName() + " "}
|
2025-08-01 11:19:22 +05:00
|
|
|
<AppIcon name="pencil" size={AppFontSize.md} />
|
2024-02-05 12:14:45 +05:00
|
|
|
</Paragraph>
|
|
|
|
|
|
2025-02-13 10:41:15 +05:00
|
|
|
<Paragraph
|
|
|
|
|
color={colors.primary.heading}
|
|
|
|
|
size={AppFontSize.xs}
|
|
|
|
|
>
|
2024-02-05 12:14:45 +05:00
|
|
|
{user?.email}
|
|
|
|
|
</Paragraph>
|
|
|
|
|
|
|
|
|
|
<Paragraph
|
2021-11-24 09:57:23 +05:00
|
|
|
style={{
|
2025-08-01 11:19:22 +05:00
|
|
|
flexWrap: "wrap"
|
2022-01-22 12:57:05 +05:00
|
|
|
}}
|
2025-02-13 10:41:15 +05:00
|
|
|
size={AppFontSize.xs}
|
2024-02-05 12:14:45 +05:00
|
|
|
color={colors.secondary.heading}
|
2022-01-22 12:57:05 +05:00
|
|
|
>
|
2024-02-05 12:14:45 +05:00
|
|
|
{!user ? (
|
2024-07-27 10:19:43 +05:00
|
|
|
strings.notLoggedIn()
|
2024-02-05 12:14:45 +05:00
|
|
|
) : lastSynced && lastSynced !== "Never" ? (
|
|
|
|
|
<>
|
|
|
|
|
{lastSyncStatus === SyncStatus.Failed
|
2024-07-27 10:19:43 +05:00
|
|
|
? strings.syncFailed()
|
|
|
|
|
: strings.synced()}{" "}
|
2022-04-07 04:20:13 +05:00
|
|
|
<TimeSince
|
2024-02-05 12:14:45 +05:00
|
|
|
style={{
|
2025-02-13 10:41:15 +05:00
|
|
|
fontSize: AppFontSize.xs,
|
2024-02-05 12:14:45 +05:00
|
|
|
color: colors.secondary.paragraph
|
|
|
|
|
}}
|
2022-04-07 04:20:13 +05:00
|
|
|
time={lastSynced}
|
2025-08-01 11:19:22 +05:00
|
|
|
/>{" "}
|
|
|
|
|
ago
|
2024-07-27 10:19:43 +05:00
|
|
|
{isOffline ? ` (${strings.offline()})` : ""}
|
2024-02-05 12:14:45 +05:00
|
|
|
</>
|
|
|
|
|
) : (
|
2024-07-27 10:19:43 +05:00
|
|
|
strings.never()
|
2025-08-01 11:19:22 +05:00
|
|
|
)}
|
|
|
|
|
</Paragraph>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
|
|
<View
|
|
|
|
|
style={{
|
|
|
|
|
paddingVertical: DefaultAppStyles.GAP_SMALL,
|
|
|
|
|
gap: DefaultAppStyles.GAP_VERTICAL,
|
2025-09-10 12:28:44 +05:00
|
|
|
borderRadius: 10
|
2025-08-01 11:19:22 +05:00
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<View
|
|
|
|
|
style={{
|
|
|
|
|
gap: DefaultAppStyles.GAP_SMALL,
|
|
|
|
|
paddingHorizontal: DefaultAppStyles.GAP_SMALL
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<View
|
|
|
|
|
style={{
|
|
|
|
|
flexDirection: "row",
|
|
|
|
|
width: "100%",
|
|
|
|
|
justifyContent: "space-between"
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Paragraph size={AppFontSize.xxs}>
|
|
|
|
|
{strings.storage()}
|
|
|
|
|
</Paragraph>
|
|
|
|
|
<Paragraph size={AppFontSize.xxs}>
|
2025-09-03 10:54:01 +05:00
|
|
|
{formatBytes(used)}/
|
2025-09-04 11:33:20 +05:00
|
|
|
{total === -1
|
2025-09-03 10:54:01 +05:00
|
|
|
? "Unlimited"
|
|
|
|
|
: formatBytes(total) + " " + strings.used()}
|
2025-08-01 11:19:22 +05:00
|
|
|
</Paragraph>
|
|
|
|
|
</View>
|
|
|
|
|
<View
|
|
|
|
|
style={{
|
|
|
|
|
backgroundColor: colors.secondary.background,
|
|
|
|
|
width: "100%",
|
|
|
|
|
height: 5,
|
|
|
|
|
borderRadius: 10
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<View
|
|
|
|
|
style={{
|
2025-08-21 10:34:00 +05:00
|
|
|
backgroundColor: colors.primary.accent,
|
2025-08-01 11:19:22 +05:00
|
|
|
height: 5,
|
|
|
|
|
width: `${(used / total) * 100}%`,
|
|
|
|
|
borderRadius: 10
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
|
|
<View
|
|
|
|
|
style={{
|
|
|
|
|
flexDirection: "row",
|
|
|
|
|
justifyContent: "space-between",
|
|
|
|
|
alignItems: "center",
|
|
|
|
|
width: "100%",
|
|
|
|
|
paddingHorizontal: DefaultAppStyles.GAP_SMALL,
|
|
|
|
|
borderRadius: 10
|
|
|
|
|
}}
|
|
|
|
|
>
|
2025-08-18 13:13:00 +05:00
|
|
|
<TouchableOpacity
|
|
|
|
|
activeOpacity={1}
|
|
|
|
|
onPress={() => {
|
|
|
|
|
presentSheet({
|
|
|
|
|
component: <PlanLimits />
|
|
|
|
|
});
|
|
|
|
|
}}
|
|
|
|
|
>
|
2025-08-01 11:19:22 +05:00
|
|
|
<Paragraph size={AppFontSize.sm}>
|
2025-10-05 01:11:09 +05:00
|
|
|
{planToDisplayName(user.subscription?.plan)}
|
2025-08-01 11:19:22 +05:00
|
|
|
</Paragraph>
|
|
|
|
|
<Paragraph
|
|
|
|
|
color={colors.secondary.paragraph}
|
|
|
|
|
size={AppFontSize.xxxs}
|
|
|
|
|
>
|
|
|
|
|
{strings.viewAllLimits()}{" "}
|
|
|
|
|
<AppIcon name="information" size={AppFontSize.xxxs} />
|
2024-02-05 12:14:45 +05:00
|
|
|
</Paragraph>
|
2025-08-18 13:13:00 +05:00
|
|
|
</TouchableOpacity>
|
2025-08-01 11:19:22 +05:00
|
|
|
|
2025-10-06 10:58:39 +05:00
|
|
|
{((user.subscription?.provider ===
|
|
|
|
|
SubscriptionProvider.PADDLE ||
|
2025-10-05 01:11:09 +05:00
|
|
|
user.subscription?.provider ===
|
2025-10-04 12:54:01 +05:00
|
|
|
SubscriptionProvider.STREETWRITERS ||
|
|
|
|
|
!isCurrentPlatform) &&
|
2025-10-06 10:58:39 +05:00
|
|
|
PremiumService.get()) ||
|
|
|
|
|
SettingsService.getProperty("serverUrls") ? null : (
|
2025-09-24 10:23:00 +05:00
|
|
|
<Button
|
|
|
|
|
title={
|
2025-10-05 01:11:09 +05:00
|
|
|
user.subscription?.plan !== SubscriptionPlan.FREE
|
2025-09-24 10:23:00 +05:00
|
|
|
? strings.changePlan()
|
|
|
|
|
: strings.upgradePlan()
|
|
|
|
|
}
|
|
|
|
|
onPress={() => {
|
2025-10-03 08:41:06 +05:00
|
|
|
if (
|
|
|
|
|
user?.subscription?.plan === SubscriptionPlan.LEGACY_PRO
|
|
|
|
|
) {
|
|
|
|
|
ToastManager.show({
|
|
|
|
|
message: strings.cannotChangePlan(),
|
|
|
|
|
context: "local"
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-25 08:41:06 +05:00
|
|
|
if (
|
2025-10-05 01:11:09 +05:00
|
|
|
user.subscription?.plan !== SubscriptionPlan.FREE &&
|
|
|
|
|
user.subscription?.productId &&
|
|
|
|
|
user.subscription?.productId.includes("5year")
|
2025-09-25 08:41:06 +05:00
|
|
|
) {
|
|
|
|
|
ToastManager.show({
|
|
|
|
|
message:
|
|
|
|
|
"You have made a one time purchase. To change your plan please contact support.",
|
|
|
|
|
type: "info"
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
2025-09-24 10:23:00 +05:00
|
|
|
|
|
|
|
|
Navigation.navigate("PayWall", {
|
|
|
|
|
context: "logged-in",
|
|
|
|
|
canGoBack: true
|
|
|
|
|
});
|
|
|
|
|
}}
|
|
|
|
|
type="accent"
|
|
|
|
|
fontSize={AppFontSize.xs}
|
|
|
|
|
style={{
|
|
|
|
|
paddingHorizontal: DefaultAppStyles.GAP_SMALL,
|
|
|
|
|
height: "auto",
|
|
|
|
|
paddingVertical: DefaultAppStyles.GAP_SMALL
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
)}
|
2021-11-24 09:57:23 +05:00
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
|
2025-08-21 10:34:00 +05:00
|
|
|
{item.sections.map((item) => (
|
2022-04-07 04:20:13 +05:00
|
|
|
<SectionItem key={item.name} item={item} />
|
2025-08-21 10:34:00 +05:00
|
|
|
))}
|
2021-11-24 09:57:23 +05:00
|
|
|
</>
|
|
|
|
|
) : null}
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default SettingsUserSection;
|