A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
mobile: redeem gift code
Ammar Ahmedc2e7f7576e31
diff --git a/apps/mobile/app/screens/settings/settings-data.tsx b/apps/mobile/app/screens/settings/settings-data.tsxindex b69172c4c..e302a5bf4 100644--- a/apps/mobile/app/screens/settings/settings-data.tsx+++ b/apps/mobile/app/screens/settings/settings-data.tsx@@ -78,8 +78,7 @@ import { verifyUser, verifyUserWithApplock } from "./functions";import { SettingSection } from "./types";import { getTimeLeft } from "./user-section";import Clipboard from "@react-native-clipboard/clipboard";--type User = any;+import { User } from "@notesnook/core";export const settingsGroups: SettingSection[] = [{@@ -119,6 +118,10 @@ export const settingsGroups: SettingSection[] = ["MMMM D, YYYY");+ if (user.subscription.provider === 4) {+ return strings.subEndsOn(expiryDate);+ }+return user.subscription?.type === 2? strings.signedUpOn(startDate): user.subscription?.type === 1@@ -134,6 +137,39 @@ export const settingsGroups: SettingSection[] = [: strings.neverHesitate();}},+ {+ id: "redeem-gift-code",+ name: strings.redeemGiftCode(),+ description: strings.redeemGiftCodeDesc(),+ hidden: (current) => {+ return !current as boolean;+ },+ useHook: () =>+ useUserStore(+ (state) =>+ state.user?.subscription.type == SUBSCRIPTION_STATUS.TRIAL ||+ state.user?.subscription.type == SUBSCRIPTION_STATUS.BASIC+ ),+ icon: "gift",+ modifer: () => {+ presentDialog({+ title: strings.redeemGiftCode(),+ paragraph: strings.redeemGiftCodeDesc(),+ input: true,+ inputPlaceholder: strings.code(),+ positiveText: strings.redeem(),+ positivePress: async (value) => {+ db.subscriptions.redeemCode(value).catch((e) => {+ ToastManager.show({+ heading: "Error redeeming code",+ message: (e as Error).message,+ type: "error"+ });+ });+ }+ });+ }+ },{id: "account-settings",type: "screen",diff --git a/apps/mobile/app/screens/settings/subscription.js b/apps/mobile/app/screens/settings/subscription.jsindex fda262927..b15eb3042 100644--- a/apps/mobile/app/screens/settings/subscription.js+++ b/apps/mobile/app/screens/settings/subscription.js@@ -126,18 +126,19 @@ export const Subscription = () => {user.subscription?.type !== SUBSCRIPTION_STATUS.PREMIUM_EXPIRED &&user.subscription?.type !== SUBSCRIPTION_STATUS.BASIC ? (<Button- title={subscriptionProviderInfo?.title}+ title={subscriptionProviderInfo?.title()}onPress={() => {presentSheet({- title: subscriptionProviderInfo.title,- paragraph: subscriptionProviderInfo.desc+ title: subscriptionProviderInfo.title(),+ paragraph: subscriptionProviderInfo.desc()});}}style={{alignSelf: "flex-start",- borderRadius: 100+ width: "100%",+ paddingHorizontal: 0}}- fontSize={SIZE.sm}+ fontSize={SIZE.xs}height={30}type="secondaryAccented"/>diff --git a/apps/mobile/native/fonts/MaterialCommunityIcons.ttf b/apps/mobile/native/fonts/MaterialCommunityIcons.ttfindex 57d766216..d16f589c1 100644Binary files a/apps/mobile/native/fonts/MaterialCommunityIcons.ttf and b/apps/mobile/native/fonts/MaterialCommunityIcons.ttf differdiff --git a/apps/mobile/scripts/optimize-fonts.mjs b/apps/mobile/scripts/optimize-fonts.mjsindex 60922dc8d..12c072294 100644--- a/apps/mobile/scripts/optimize-fonts.mjs+++ b/apps/mobile/scripts/optimize-fonts.mjs@@ -81,7 +81,8 @@ const EXTRA_ICON_NAMES = ["notebook-plus","arrow-right-bold-box-outline","arrow-up-bold",- "login"+ "login",+ "gift"];const __filename = fileURLToPath(import.meta.url);diff --git a/packages/intl/locale/en.po b/packages/intl/locale/en.poindex d98d8d0cb..11cfca2e6 100644--- a/packages/intl/locale/en.po+++ b/packages/intl/locale/en.po@@ -4584,6 +4584,10 @@ msgstr "Recovery key text file saved"msgid "Recovery successful!"msgstr "Recovery successful!"+#: src/strings.ts:2408+msgid "Redeem"+msgstr "Redeem"+#: src/strings.ts:2405msgid "Redeem gift code"msgstr "Redeem gift code"diff --git a/packages/intl/locale/pseudo-LOCALE.po b/packages/intl/locale/pseudo-LOCALE.poindex 22740d93b..507b491ff 100644--- a/packages/intl/locale/pseudo-LOCALE.po+++ b/packages/intl/locale/pseudo-LOCALE.po@@ -4564,6 +4564,10 @@ msgstr "<<<<<<< HEAD<<<<<<< HEAD"#: src/strings.ts:1891msgid "Recovery successful!"+msgstr "<<<<<<< HEAD"++#: src/strings.ts:2408+msgid "Redeem"msgstr ""#: src/strings.ts:2405diff --git a/packages/intl/src/strings.ts b/packages/intl/src/strings.tsindex 5501b9524..670a809d6 100644--- a/packages/intl/src/strings.ts+++ b/packages/intl/src/strings.ts@@ -2404,5 +2404,6 @@ Use this if changes from other devices are not appearing on this device. This wiemailCopied: () => t`Email copied`,redeemGiftCode: () => t`Redeem gift code`,redeemGiftCodeDesc: () => t`Enter the gift code to redeem your subscription.`,- redeemingGiftCode: () => t`Redeeming gift code`+ redeemingGiftCode: () => t`Redeeming gift code`,+ redeem: () => t`Redeem`};