@neko-os/rc-subscription 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/README.md +142 -0
  2. package/dist/config.js +5 -0
  3. package/dist/containers/SubscriptionHandler.js +75 -0
  4. package/dist/containers/SubscriptionRequired.js +11 -0
  5. package/dist/containers/SubscriptionRequiredCTA.js +37 -0
  6. package/dist/containers/paywall/Paywall.js +130 -0
  7. package/dist/containers/paywall/PaywallFeatures.js +42 -0
  8. package/dist/containers/paywall/PaywallFooter.js +16 -0
  9. package/dist/containers/paywall/PaywallHero.js +33 -0
  10. package/dist/containers/paywall/PaywallPlanCard.js +71 -0
  11. package/dist/containers/paywall/PaywallReturnIcon.js +8 -0
  12. package/dist/containers/paywall/_request/usePaywallActions.js +39 -0
  13. package/dist/index.js +6 -0
  14. package/dist/locales/cs.js +30 -0
  15. package/dist/locales/da.js +30 -0
  16. package/dist/locales/de.js +30 -0
  17. package/dist/locales/el.js +30 -0
  18. package/dist/locales/en.js +30 -0
  19. package/dist/locales/es.js +30 -0
  20. package/dist/locales/fi.js +30 -0
  21. package/dist/locales/fr.js +30 -0
  22. package/dist/locales/hi.js +30 -0
  23. package/dist/locales/hu.js +30 -0
  24. package/dist/locales/id.js +30 -0
  25. package/dist/locales/index.js +63 -0
  26. package/dist/locales/it.js +30 -0
  27. package/dist/locales/ja.js +30 -0
  28. package/dist/locales/ko.js +30 -0
  29. package/dist/locales/nl.js +30 -0
  30. package/dist/locales/no.js +30 -0
  31. package/dist/locales/pl.js +30 -0
  32. package/dist/locales/pt.js +30 -0
  33. package/dist/locales/ro.js +30 -0
  34. package/dist/locales/ru.js +30 -0
  35. package/dist/locales/sv.js +30 -0
  36. package/dist/locales/th.js +30 -0
  37. package/dist/locales/tr.js +30 -0
  38. package/dist/locales/uk.js +30 -0
  39. package/dist/locales/vi.js +30 -0
  40. package/dist/locales/zh.js +30 -0
  41. package/dist/views/active/ActiveSubscriptionView.js +51 -0
  42. package/package.json +53 -0
  43. package/src/config.js +5 -0
  44. package/src/containers/SubscriptionHandler.js +75 -0
  45. package/src/containers/SubscriptionRequired.js +11 -0
  46. package/src/containers/SubscriptionRequiredCTA.js +37 -0
  47. package/src/containers/paywall/Paywall.js +130 -0
  48. package/src/containers/paywall/PaywallFeatures.js +42 -0
  49. package/src/containers/paywall/PaywallFooter.js +16 -0
  50. package/src/containers/paywall/PaywallHero.js +33 -0
  51. package/src/containers/paywall/PaywallPlanCard.js +71 -0
  52. package/src/containers/paywall/PaywallReturnIcon.js +8 -0
  53. package/src/containers/paywall/_request/usePaywallActions.js +39 -0
  54. package/src/index.js +6 -0
  55. package/src/locales/cs.js +30 -0
  56. package/src/locales/da.js +30 -0
  57. package/src/locales/de.js +30 -0
  58. package/src/locales/el.js +30 -0
  59. package/src/locales/en.js +30 -0
  60. package/src/locales/es.js +30 -0
  61. package/src/locales/fi.js +30 -0
  62. package/src/locales/fr.js +30 -0
  63. package/src/locales/hi.js +30 -0
  64. package/src/locales/hu.js +30 -0
  65. package/src/locales/id.js +30 -0
  66. package/src/locales/index.js +63 -0
  67. package/src/locales/it.js +30 -0
  68. package/src/locales/ja.js +30 -0
  69. package/src/locales/ko.js +30 -0
  70. package/src/locales/nl.js +30 -0
  71. package/src/locales/no.js +30 -0
  72. package/src/locales/pl.js +30 -0
  73. package/src/locales/pt.js +30 -0
  74. package/src/locales/ro.js +30 -0
  75. package/src/locales/ru.js +30 -0
  76. package/src/locales/sv.js +30 -0
  77. package/src/locales/th.js +30 -0
  78. package/src/locales/tr.js +30 -0
  79. package/src/locales/uk.js +30 -0
  80. package/src/locales/vi.js +30 -0
  81. package/src/locales/zh.js +30 -0
  82. package/src/views/active/ActiveSubscriptionView.js +51 -0
@@ -0,0 +1,30 @@
1
+ export const subscriptionNO = {
2
+ settings: {
3
+ linkLabel: 'Abonnement',
4
+ },
5
+ paywall: {
6
+ title: 'Bli Premium',
7
+ subtitle: 'Lås opp alle funksjoner',
8
+ cta: 'Fortsett',
9
+ ctaTrial: 'Start gratis prøveperiode',
10
+ restore: 'Gjenopprett kjøp',
11
+ monthly: 'Månedlig',
12
+ yearly: 'Årlig',
13
+ lifetime: 'Livstid',
14
+ perMonth: '{{price}}/mnd',
15
+ save: 'Spar {{percent}}%',
16
+ freeTrial: '{{count}} dager gratis',
17
+ free: 'Gratis',
18
+ pro: 'Pro',
19
+ },
20
+ cta: {
21
+ unlock: 'Lås opp full tilgang',
22
+ },
23
+ active: {
24
+ title: 'Abonnement',
25
+ plan: 'Plan',
26
+ expires: 'Utløper',
27
+ lifetime: 'Livstidstilgang',
28
+ manage: 'Administrer abonnement',
29
+ },
30
+ }
@@ -0,0 +1,30 @@
1
+ export const subscriptionPL = {
2
+ settings: {
3
+ linkLabel: 'Subskrypcja',
4
+ },
5
+ paywall: {
6
+ title: 'Przejdź na Premium',
7
+ subtitle: 'Odblokuj wszystkie funkcje',
8
+ cta: 'Kontynuuj',
9
+ ctaTrial: 'Rozpocznij bezpłatny okres próbny',
10
+ restore: 'Przywróć zakupy',
11
+ monthly: 'Miesięcznie',
12
+ yearly: 'Rocznie',
13
+ lifetime: 'Dożywotnio',
14
+ perMonth: '{{price}}/mies.',
15
+ save: 'Oszczędź {{percent}}%',
16
+ freeTrial: '{{count}} dni za darmo',
17
+ free: 'Bezpłatny',
18
+ pro: 'Pro',
19
+ },
20
+ cta: {
21
+ unlock: 'Odblokuj pełny dostęp',
22
+ },
23
+ active: {
24
+ title: 'Subskrypcja',
25
+ plan: 'Plan',
26
+ expires: 'Wygasa',
27
+ lifetime: 'Dostęp dożywotni',
28
+ manage: 'Zarządzaj subskrypcją',
29
+ },
30
+ }
@@ -0,0 +1,30 @@
1
+ export const subscriptionPT = {
2
+ settings: {
3
+ linkLabel: 'Assinatura',
4
+ },
5
+ paywall: {
6
+ title: 'Seja Premium',
7
+ subtitle: 'Desbloqueie todos os recursos',
8
+ cta: 'Continuar',
9
+ ctaTrial: 'Iniciar teste gratuito',
10
+ restore: 'Restaurar compras',
11
+ monthly: 'Mensal',
12
+ yearly: 'Anual',
13
+ lifetime: 'Vitalício',
14
+ perMonth: '{{price}}/mês',
15
+ save: 'Economize {{percent}}%',
16
+ freeTrial: '{{count}} dias grátis',
17
+ free: 'Grátis',
18
+ pro: 'Pro',
19
+ },
20
+ cta: {
21
+ unlock: 'Desbloquear acesso completo',
22
+ },
23
+ active: {
24
+ title: 'Assinatura',
25
+ plan: 'Plano',
26
+ expires: 'Expira',
27
+ lifetime: 'Acesso vitalício',
28
+ manage: 'Gerenciar assinatura',
29
+ },
30
+ }
@@ -0,0 +1,30 @@
1
+ export const subscriptionRO = {
2
+ settings: {
3
+ linkLabel: 'Abonament',
4
+ },
5
+ paywall: {
6
+ title: 'Treci la Premium',
7
+ subtitle: 'Deblochează toate funcțiile',
8
+ cta: 'Continuă',
9
+ ctaTrial: 'Începe perioada de probă gratuită',
10
+ restore: 'Restaurează achizițiile',
11
+ monthly: 'Lunar',
12
+ yearly: 'Anual',
13
+ lifetime: 'Pe viață',
14
+ perMonth: '{{price}}/lună',
15
+ save: 'Economisești {{percent}}%',
16
+ freeTrial: '{{count}} zile gratuit',
17
+ free: 'Gratuit',
18
+ pro: 'Pro',
19
+ },
20
+ cta: {
21
+ unlock: 'Deblochează accesul complet',
22
+ },
23
+ active: {
24
+ title: 'Abonament',
25
+ plan: 'Plan',
26
+ expires: 'Expiră',
27
+ lifetime: 'Acces pe viață',
28
+ manage: 'Gestionează abonamentul',
29
+ },
30
+ }
@@ -0,0 +1,30 @@
1
+ export const subscriptionRU = {
2
+ settings: {
3
+ linkLabel: 'Подписка',
4
+ },
5
+ paywall: {
6
+ title: 'Стать Premium',
7
+ subtitle: 'Разблокируйте все функции',
8
+ cta: 'Продолжить',
9
+ ctaTrial: 'Начать бесплатный пробный период',
10
+ restore: 'Восстановить покупки',
11
+ monthly: 'Ежемесячно',
12
+ yearly: 'Ежегодно',
13
+ lifetime: 'Навсегда',
14
+ perMonth: '{{price}}/мес.',
15
+ save: 'Скидка {{percent}}%',
16
+ freeTrial: '{{count}} дней бесплатно',
17
+ free: 'Бесплатно',
18
+ pro: 'Pro',
19
+ },
20
+ cta: {
21
+ unlock: 'Разблокировать полный доступ',
22
+ },
23
+ active: {
24
+ title: 'Подписка',
25
+ plan: 'План',
26
+ expires: 'Истекает',
27
+ lifetime: 'Пожизненный доступ',
28
+ manage: 'Управление подпиской',
29
+ },
30
+ }
@@ -0,0 +1,30 @@
1
+ export const subscriptionSV = {
2
+ settings: {
3
+ linkLabel: 'Prenumeration',
4
+ },
5
+ paywall: {
6
+ title: 'Bli Premium',
7
+ subtitle: 'Lås upp alla funktioner',
8
+ cta: 'Fortsätt',
9
+ ctaTrial: 'Starta gratis provperiod',
10
+ restore: 'Återställ köp',
11
+ monthly: 'Månadsvis',
12
+ yearly: 'Årsvis',
13
+ lifetime: 'Livstid',
14
+ perMonth: '{{price}}/mån',
15
+ save: 'Spara {{percent}}%',
16
+ freeTrial: '{{count}} dagar gratis',
17
+ free: 'Gratis',
18
+ pro: 'Pro',
19
+ },
20
+ cta: {
21
+ unlock: 'Lås upp full åtkomst',
22
+ },
23
+ active: {
24
+ title: 'Prenumeration',
25
+ plan: 'Plan',
26
+ expires: 'Löper ut',
27
+ lifetime: 'Livstidsåtkomst',
28
+ manage: 'Hantera prenumeration',
29
+ },
30
+ }
@@ -0,0 +1,30 @@
1
+ export const subscriptionTH = {
2
+ settings: {
3
+ linkLabel: 'การสมัครสมาชิก',
4
+ },
5
+ paywall: {
6
+ title: 'อัปเกรดเป็น Premium',
7
+ subtitle: 'ปลดล็อกฟีเจอร์ทั้งหมด',
8
+ cta: 'ดำเนินการต่อ',
9
+ ctaTrial: 'เริ่มทดลองใช้ฟรี',
10
+ restore: 'กู้คืนการซื้อ',
11
+ monthly: 'รายเดือน',
12
+ yearly: 'รายปี',
13
+ lifetime: 'ตลอดชีพ',
14
+ perMonth: '{{price}}/เดือน',
15
+ save: 'ประหยัด {{percent}}%',
16
+ freeTrial: 'ฟรี {{count}} วัน',
17
+ free: 'ฟรี',
18
+ pro: 'Pro',
19
+ },
20
+ cta: {
21
+ unlock: 'ปลดล็อกการเข้าถึงเต็มรูปแบบ',
22
+ },
23
+ active: {
24
+ title: 'การสมัครสมาชิก',
25
+ plan: 'แผน',
26
+ expires: 'หมดอายุ',
27
+ lifetime: 'เข้าถึงตลอดชีพ',
28
+ manage: 'จัดการการสมัครสมาชิก',
29
+ },
30
+ }
@@ -0,0 +1,30 @@
1
+ export const subscriptionTR = {
2
+ settings: {
3
+ linkLabel: 'Abonelik',
4
+ },
5
+ paywall: {
6
+ title: 'Premium\'a Geç',
7
+ subtitle: 'Tüm özelliklerin kilidini aç',
8
+ cta: 'Devam et',
9
+ ctaTrial: 'Ücretsiz denemeyi başlat',
10
+ restore: 'Satın alımları geri yükle',
11
+ monthly: 'Aylık',
12
+ yearly: 'Yıllık',
13
+ lifetime: 'Ömür boyu',
14
+ perMonth: '{{price}}/ay',
15
+ save: '%{{percent}} tasarruf',
16
+ freeTrial: '{{count}} gün ücretsiz',
17
+ free: 'Ücretsiz',
18
+ pro: 'Pro',
19
+ },
20
+ cta: {
21
+ unlock: 'Tam erişimin kilidini aç',
22
+ },
23
+ active: {
24
+ title: 'Abonelik',
25
+ plan: 'Plan',
26
+ expires: 'Sona erme',
27
+ lifetime: 'Ömür boyu erişim',
28
+ manage: 'Aboneliği yönet',
29
+ },
30
+ }
@@ -0,0 +1,30 @@
1
+ export const subscriptionUK = {
2
+ settings: {
3
+ linkLabel: 'Підписка',
4
+ },
5
+ paywall: {
6
+ title: 'Стати Premium',
7
+ subtitle: 'Розблокуйте всі функції',
8
+ cta: 'Продовжити',
9
+ ctaTrial: 'Почати безкоштовний пробний період',
10
+ restore: 'Відновити покупки',
11
+ monthly: 'Щомісячно',
12
+ yearly: 'Щорічно',
13
+ lifetime: 'Назавжди',
14
+ perMonth: '{{price}}/міс.',
15
+ save: 'Знижка {{percent}}%',
16
+ freeTrial: '{{count}} днів безкоштовно',
17
+ free: 'Безкоштовно',
18
+ pro: 'Pro',
19
+ },
20
+ cta: {
21
+ unlock: 'Розблокувати повний доступ',
22
+ },
23
+ active: {
24
+ title: 'Підписка',
25
+ plan: 'План',
26
+ expires: 'Закінчується',
27
+ lifetime: 'Довічний доступ',
28
+ manage: 'Керувати підпискою',
29
+ },
30
+ }
@@ -0,0 +1,30 @@
1
+ export const subscriptionVI = {
2
+ settings: {
3
+ linkLabel: 'Gói đăng ký',
4
+ },
5
+ paywall: {
6
+ title: 'Nâng cấp Premium',
7
+ subtitle: 'Mở khóa tất cả tính năng',
8
+ cta: 'Tiếp tục',
9
+ ctaTrial: 'Bắt đầu dùng thử miễn phí',
10
+ restore: 'Khôi phục giao dịch',
11
+ monthly: 'Hàng tháng',
12
+ yearly: 'Hàng năm',
13
+ lifetime: 'Trọn đời',
14
+ perMonth: '{{price}}/tháng',
15
+ save: 'Tiết kiệm {{percent}}%',
16
+ freeTrial: 'Miễn phí {{count}} ngày',
17
+ free: 'Miễn phí',
18
+ pro: 'Pro',
19
+ },
20
+ cta: {
21
+ unlock: 'Mở khóa toàn bộ quyền truy cập',
22
+ },
23
+ active: {
24
+ title: 'Gói đăng ký',
25
+ plan: 'Gói',
26
+ expires: 'Hết hạn',
27
+ lifetime: 'Truy cập trọn đời',
28
+ manage: 'Quản lý gói đăng ký',
29
+ },
30
+ }
@@ -0,0 +1,30 @@
1
+ export const subscriptionZH = {
2
+ settings: {
3
+ linkLabel: '订阅',
4
+ },
5
+ paywall: {
6
+ title: '升级高级版',
7
+ subtitle: '解锁所有功能',
8
+ cta: '继续',
9
+ ctaTrial: '开始免费试用',
10
+ restore: '恢复购买',
11
+ monthly: '月付',
12
+ yearly: '年付',
13
+ lifetime: '终身',
14
+ perMonth: '{{price}}/月',
15
+ save: '节省 {{percent}}%',
16
+ freeTrial: '免费 {{count}} 天',
17
+ free: '免费',
18
+ pro: 'Pro',
19
+ },
20
+ cta: {
21
+ unlock: '解锁完整访问权限',
22
+ },
23
+ active: {
24
+ title: '订阅',
25
+ plan: '方案',
26
+ expires: '到期时间',
27
+ lifetime: '终身访问',
28
+ manage: '管理订阅',
29
+ },
30
+ }
@@ -0,0 +1,51 @@
1
+ import { Button, Section, SectionItem, TopBar, View, useTranslation } from '@neko-os/ui'
2
+ import { Linking } from 'react-native'
3
+ import { useNavigation } from '@react-navigation/native'
4
+ import dayjs from 'dayjs'
5
+
6
+ import { RC_ENTITLEMENT_ID } from '../../config'
7
+ import SubscriptionRequired from '../../containers/SubscriptionRequired'
8
+ import { useSubscription } from '../../containers/SubscriptionHandler'
9
+
10
+ function ActiveSubscriptionContent() {
11
+ const { t } = useTranslation('subscription')
12
+ const { customerInfo } = useSubscription()
13
+
14
+ const entitlement = customerInfo?.entitlements?.active?.[RC_ENTITLEMENT_ID]
15
+
16
+ async function handleManage() {
17
+ if (customerInfo?.managementURL) await Linking.openURL(customerInfo.managementURL)
18
+ }
19
+
20
+ return (
21
+ <View flex padding="md" gap="md">
22
+ <Section>
23
+ <SectionItem label={t('active.plan')} value={entitlement?.identifier || '-'} />
24
+ {entitlement?.expirationDate ? (
25
+ <SectionItem label={t('active.expires')} value={dayjs(entitlement.expirationDate).format('LL')} />
26
+ ) : (
27
+ <SectionItem label={t('active.expires')} value={t('active.lifetime')} />
28
+ )}
29
+ </Section>
30
+ {customerInfo?.managementURL && <Button label={t('active.manage')} onPress={handleManage} />}
31
+ </View>
32
+ )
33
+ }
34
+
35
+ export default function ActiveSubscriptionView() {
36
+ const { t } = useTranslation('subscription')
37
+ const { goBack } = useNavigation()
38
+
39
+ return (
40
+ <View flex bg="mainBG">
41
+ <SubscriptionRequired showReturn>
42
+ <TopBar
43
+ title={t('active.title')}
44
+ left={<Button icon="arrow-left-s-line" ratio={1} mainBG onPress={goBack} />}
45
+ />
46
+
47
+ <ActiveSubscriptionContent />
48
+ </SubscriptionRequired>
49
+ </View>
50
+ )
51
+ }