From 2d07a0c1c7e548af23fcce38e884b8df62caec82 Mon Sep 17 00:00:00 2001 From: duogenesis <136373989+duogenesis@users.noreply.github.com> Date: Wed, 18 Dec 2024 20:01:10 +1100 Subject: [PATCH] Nag for donations upon deletion/deactivation (#509) --- components/option-screen.tsx | 19 +++---- data/option-groups.tsx | 67 ++++++++++++++++++++-- package-lock.json | 104 ++++++++++++++++++----------------- package.json | 2 +- 4 files changed, 126 insertions(+), 66 deletions(-) diff --git a/components/option-screen.tsx b/components/option-screen.tsx index 1ee22123..55c986e8 100644 --- a/components/option-screen.tsx +++ b/components/option-screen.tsx @@ -44,6 +44,7 @@ import { OptionGroupTextShort, OptionGroupThemePicker, OptionGroupVerificationChecker, + descriptionStyle, isOptionGroupButtons, isOptionGroupCheckChips, isOptionGroupDate, @@ -58,8 +59,8 @@ import { isOptionGroupTextShort, isOptionGroupThemePicker, isOptionGroupVerificationChecker, - noneFontSize, maxDailySelfies, + noneFontSize, } from '../data/option-groups'; import { PrimaryImage, @@ -1316,7 +1317,7 @@ const OptionScreen = ({navigation, route}) => { const { title, - description, + description: Description, input, scrollView, buttonLabel, @@ -1455,17 +1456,15 @@ const OptionScreen = ({navigation, route}) => { > {title} - - {description} - + {Description} + } + {typeof Description !== 'string' && } = { title: string, Icon?: any, - description: string, + description: string | FC, input: T, scrollView?: boolean, buttonLabel?: string, @@ -494,6 +505,53 @@ const FinishOnboardingDescription = () => ( ); +const DeletionDescription = () => ( + + Are you sure you want to delete your account? {} + + This will + permanently delete your account data and + immediately log you out. + {} + If you’re sure, type “delete” to confirm. + {Platform.OS === 'web' && + + {'\n\n'} + Please consider donating before leaving by pressing {} + Linking.openURL('https://ko-fi.com/duolicious')} + style={{ fontWeight: '700' }} + > + here{'\xa0'}💕 + + + } + +); + +const DeactivationDescription = () => ( + + Are you sure you want to deactivate your account? {} + + This will hide you from other users and log you out. + {} + The next time you sign in, your account will be reactivated. Press + “continue” to deactivate your account. + {Platform.OS === 'web' && + + {'\n\n'} + Please consider donating before leaving by pressing {} + Linking.openURL('https://ko-fi.com/duolicious')} + style={{ fontWeight: '700' }} + > + here{'\xa0'}💕 + + + } + +); + const genderOptionGroup: OptionGroup = { title: 'Gender', Icon: () => ( @@ -946,7 +1004,7 @@ const notificationSettingsOptionGroups: OptionGroup[] = [ const deletionOptionGroups: OptionGroup[] = [ { title: 'Delete My Account', - description: `Are you sure you want to delete your account? This will immediately log you out and permanently delete your account data. If you’re sure, type “delete” to confirm.`, + description: DeletionDescription, input: { textShort: { submit: async (input: string) => { @@ -975,7 +1033,7 @@ const deletionOptionGroups: OptionGroup[] = [ const deactivationOptionGroups: OptionGroup[] = [ { title: 'Deactivate My Account', - description: 'Are you sure you want to deactivate your account? This will hide you from other users and log you out. The next time you sign in, your account will be reactivated. Press “continue” to deactivate your account.', + description: DeactivationDescription, input: { none: { submit: async () => { @@ -1936,6 +1994,7 @@ export { createAccountOptionGroups, deactivationOptionGroups, deletionOptionGroups, + descriptionStyle, generalSettingsOptionGroups, getCurrentValue, isOptionGroupButtons, @@ -1952,8 +2011,8 @@ export { isOptionGroupTextShort, isOptionGroupThemePicker, isOptionGroupVerificationChecker, - noneFontSize, maxDailySelfies, + noneFontSize, notificationSettingsOptionGroups, privacySettingsOptionGroups, searchInteractionsOptionGroups, diff --git a/package-lock.json b/package-lock.json index 1056ed84..02300ab4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,7 @@ "@xmldom/xmldom": "^0.8.10", "@xmpp/client": "^0.13.1", "date-fns": "^2.30.0", - "expo": "~52.0.7", + "expo": "~52.0.19", "expo-av": "~15.0.1", "expo-checkbox": "~4.0.0", "expo-clipboard": "~7.0.0", @@ -2186,9 +2186,9 @@ } }, "node_modules/@expo/cli": { - "version": "0.22.5", - "resolved": "https://registry.npmjs.org/@expo/cli/-/cli-0.22.5.tgz", - "integrity": "sha512-A2wYKtcBbEEyRUAyUeMDd356UROo1xaMl7ZaZC5tQOdIhvWKelRd4f3QCaI56D9B4EMWLg9pVuPVbAMz8zJ4+A==", + "version": "0.22.6", + "resolved": "https://registry.npmjs.org/@expo/cli/-/cli-0.22.6.tgz", + "integrity": "sha512-eDjCnc3uHl2+SJ6aZ5seK0FkMp0W12oAdSI4A/yV8ecYtXzG8X87sfKAISEWt44B4DqJ0a1LEqCD6Vtvc783Mg==", "dependencies": { "@0no-co/graphql.web": "^1.0.8", "@babel/runtime": "^7.20.0", @@ -2199,7 +2199,7 @@ "@expo/env": "~0.4.0", "@expo/image-utils": "^0.6.0", "@expo/json-file": "^9.0.0", - "@expo/metro-config": "~0.19.0", + "@expo/metro-config": "~0.19.8", "@expo/osascript": "^2.0.31", "@expo/package-manager": "^1.5.0", "@expo/plist": "^0.2.0", @@ -2774,9 +2774,9 @@ } }, "node_modules/@expo/fingerprint": { - "version": "0.11.3", - "resolved": "https://registry.npmjs.org/@expo/fingerprint/-/fingerprint-0.11.3.tgz", - "integrity": "sha512-9lgXmcIePvZ7Wef63XtvuN3HfCUevF4E4tQPdEbH9/dUWwpOvvwQ3KT4OJ9jdh8JJ3nTdO9eDQ/8k8xr1aQ5Kg==", + "version": "0.11.4", + "resolved": "https://registry.npmjs.org/@expo/fingerprint/-/fingerprint-0.11.4.tgz", + "integrity": "sha512-FfcvHjrWjOJ17wiMfr1iQ1YDyjlj8qfxG+GDce0khrjNSkzRjVdCOIFsMvfVSBPnOPX5NuZlgMRvMkcPUtGClA==", "dependencies": { "@expo/spawn-async": "^1.7.2", "arg": "^5.0.2", @@ -3025,9 +3025,9 @@ } }, "node_modules/@expo/metro-config": { - "version": "0.19.7", - "resolved": "https://registry.npmjs.org/@expo/metro-config/-/metro-config-0.19.7.tgz", - "integrity": "sha512-6Ti05d6AyvXstMpaRGh2EsdGSJzmOh9ju3gMmcjxckn/cimNL39qRQSrnqYc0R/DEZiRFL7N9mVE/0uG668ojw==", + "version": "0.19.8", + "resolved": "https://registry.npmjs.org/@expo/metro-config/-/metro-config-0.19.8.tgz", + "integrity": "sha512-dVAOetouQYuOTEJ2zR0OTLNPOH6zPkeEt5fY53TK0Wxi1QmtsmH6vEWg05U4zkSJ6f1aXmQ0Za77R8QxuukESA==", "dependencies": { "@babel/core": "^7.20.0", "@babel/generator": "^7.20.5", @@ -3282,7 +3282,8 @@ "node_modules/@expo/package-manager/node_modules/sudo-prompt": { "version": "9.1.1", "resolved": "https://registry.npmjs.org/sudo-prompt/-/sudo-prompt-9.1.1.tgz", - "integrity": "sha512-es33J1g2HjMpyAhz8lOR+ICmXXAqTuKbuXuUWLhOLew20oN9oUCgCJx615U/v7aioZg7IX5lIh9x34vwneu4pA==" + "integrity": "sha512-es33J1g2HjMpyAhz8lOR+ICmXXAqTuKbuXuUWLhOLew20oN9oUCgCJx615U/v7aioZg7IX5lIh9x34vwneu4pA==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info." }, "node_modules/@expo/package-manager/node_modules/supports-color": { "version": "7.2.0", @@ -7782,25 +7783,25 @@ } }, "node_modules/expo": { - "version": "52.0.18", - "resolved": "https://registry.npmjs.org/expo/-/expo-52.0.18.tgz", - "integrity": "sha512-z+qdUbH0d5JRknE3VrY0s5k+3j5JpsLx4vXRwV4To8Xm5uf3d642FQ2HbuPWFAAhtSKFQsxQAh3iuAUGAWDBhg==", + "version": "52.0.19", + "resolved": "https://registry.npmjs.org/expo/-/expo-52.0.19.tgz", + "integrity": "sha512-wOb/wbiQa0xqQRhgVBuOhLRus05TSw6fgThVMrPQgdLo24EPuT/ZAiRVcVRdjrEbwOqCDumgQCB7636B9J+jKg==", "dependencies": { "@babel/runtime": "^7.20.0", - "@expo/cli": "0.22.5", + "@expo/cli": "0.22.6", "@expo/config": "~10.0.6", "@expo/config-plugins": "~9.0.12", - "@expo/fingerprint": "0.11.3", - "@expo/metro-config": "0.19.7", + "@expo/fingerprint": "0.11.4", + "@expo/metro-config": "0.19.8", "@expo/vector-icons": "^14.0.0", "babel-preset-expo": "~12.0.4", "expo-asset": "~11.0.1", "expo-constants": "~17.0.3", - "expo-file-system": "~18.0.5", + "expo-file-system": "~18.0.6", "expo-font": "~13.0.1", "expo-keep-awake": "~14.0.1", "expo-modules-autolinking": "2.0.4", - "expo-modules-core": "2.1.1", + "expo-modules-core": "2.1.2", "fbemitter": "^3.0.0", "web-streams-polyfill": "^3.3.2", "whatwg-url-without-unicode": "8.0.0-3" @@ -7928,9 +7929,9 @@ } }, "node_modules/expo-file-system": { - "version": "18.0.5", - "resolved": "https://registry.npmjs.org/expo-file-system/-/expo-file-system-18.0.5.tgz", - "integrity": "sha512-vm7gA+PB7j99hfvBBFMRiti8OeazFK3AZWtDmCi6WQCXDxngXkAJViXhkHyF3xwDKljzlP8+4BIGrKCzbfoObg==", + "version": "18.0.6", + "resolved": "https://registry.npmjs.org/expo-file-system/-/expo-file-system-18.0.6.tgz", + "integrity": "sha512-gGEwIJCXV3/wpIJ/wRyhmieLOSAY7HeFFjb+wEfHs04aE63JYR+rXXV4b7rBpEh1ZgNV9U91zfet/iQG7J8HBQ==", "dependencies": { "web-streams-polyfill": "^3.3.2" }, @@ -8132,9 +8133,9 @@ } }, "node_modules/expo-modules-core": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/expo-modules-core/-/expo-modules-core-2.1.1.tgz", - "integrity": "sha512-yQzYCLR2mre4BNMXuqkeJ0oSNgmGEMI6BcmIzeNZbC2NFEjiaDpKvlV9bclYCtyVhUEVNbJcEPYMr6c1Y4eR4w==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/expo-modules-core/-/expo-modules-core-2.1.2.tgz", + "integrity": "sha512-0OhMU5S8zf9c/CRh1MwiXfOInI9wzz6yiIh5RuR/9J7N6xHRum68hInsPbaSc1UQpo08ZZLM4MPsbpoNRUoqIg==", "dependencies": { "invariant": "^2.2.4" } @@ -13884,7 +13885,8 @@ "node_modules/sudo-prompt": { "version": "8.2.5", "resolved": "https://registry.npmjs.org/sudo-prompt/-/sudo-prompt-8.2.5.tgz", - "integrity": "sha512-rlBo3HU/1zAJUrkY6jNxDOC9eVYliG6nS4JA8u8KAshITd07tafMc/Br7xQwCSseXwJ2iCcHCE8SNWX3q8Z+kw==" + "integrity": "sha512-rlBo3HU/1zAJUrkY6jNxDOC9eVYliG6nS4JA8u8KAshITd07tafMc/Br7xQwCSseXwJ2iCcHCE8SNWX3q8Z+kw==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info." }, "node_modules/supports-color": { "version": "5.5.0", @@ -16398,9 +16400,9 @@ } }, "@expo/cli": { - "version": "0.22.5", - "resolved": "https://registry.npmjs.org/@expo/cli/-/cli-0.22.5.tgz", - "integrity": "sha512-A2wYKtcBbEEyRUAyUeMDd356UROo1xaMl7ZaZC5tQOdIhvWKelRd4f3QCaI56D9B4EMWLg9pVuPVbAMz8zJ4+A==", + "version": "0.22.6", + "resolved": "https://registry.npmjs.org/@expo/cli/-/cli-0.22.6.tgz", + "integrity": "sha512-eDjCnc3uHl2+SJ6aZ5seK0FkMp0W12oAdSI4A/yV8ecYtXzG8X87sfKAISEWt44B4DqJ0a1LEqCD6Vtvc783Mg==", "requires": { "@0no-co/graphql.web": "^1.0.8", "@babel/runtime": "^7.20.0", @@ -16411,7 +16413,7 @@ "@expo/env": "~0.4.0", "@expo/image-utils": "^0.6.0", "@expo/json-file": "^9.0.0", - "@expo/metro-config": "~0.19.0", + "@expo/metro-config": "~0.19.8", "@expo/osascript": "^2.0.31", "@expo/package-manager": "^1.5.0", "@expo/plist": "^0.2.0", @@ -16860,9 +16862,9 @@ } }, "@expo/fingerprint": { - "version": "0.11.3", - "resolved": "https://registry.npmjs.org/@expo/fingerprint/-/fingerprint-0.11.3.tgz", - "integrity": "sha512-9lgXmcIePvZ7Wef63XtvuN3HfCUevF4E4tQPdEbH9/dUWwpOvvwQ3KT4OJ9jdh8JJ3nTdO9eDQ/8k8xr1aQ5Kg==", + "version": "0.11.4", + "resolved": "https://registry.npmjs.org/@expo/fingerprint/-/fingerprint-0.11.4.tgz", + "integrity": "sha512-FfcvHjrWjOJ17wiMfr1iQ1YDyjlj8qfxG+GDce0khrjNSkzRjVdCOIFsMvfVSBPnOPX5NuZlgMRvMkcPUtGClA==", "requires": { "@expo/spawn-async": "^1.7.2", "arg": "^5.0.2", @@ -17051,9 +17053,9 @@ } }, "@expo/metro-config": { - "version": "0.19.7", - "resolved": "https://registry.npmjs.org/@expo/metro-config/-/metro-config-0.19.7.tgz", - "integrity": "sha512-6Ti05d6AyvXstMpaRGh2EsdGSJzmOh9ju3gMmcjxckn/cimNL39qRQSrnqYc0R/DEZiRFL7N9mVE/0uG668ojw==", + "version": "0.19.8", + "resolved": "https://registry.npmjs.org/@expo/metro-config/-/metro-config-0.19.8.tgz", + "integrity": "sha512-dVAOetouQYuOTEJ2zR0OTLNPOH6zPkeEt5fY53TK0Wxi1QmtsmH6vEWg05U4zkSJ6f1aXmQ0Za77R8QxuukESA==", "requires": { "@babel/core": "^7.20.0", "@babel/generator": "^7.20.5", @@ -20696,25 +20698,25 @@ } }, "expo": { - "version": "52.0.18", - "resolved": "https://registry.npmjs.org/expo/-/expo-52.0.18.tgz", - "integrity": "sha512-z+qdUbH0d5JRknE3VrY0s5k+3j5JpsLx4vXRwV4To8Xm5uf3d642FQ2HbuPWFAAhtSKFQsxQAh3iuAUGAWDBhg==", + "version": "52.0.19", + "resolved": "https://registry.npmjs.org/expo/-/expo-52.0.19.tgz", + "integrity": "sha512-wOb/wbiQa0xqQRhgVBuOhLRus05TSw6fgThVMrPQgdLo24EPuT/ZAiRVcVRdjrEbwOqCDumgQCB7636B9J+jKg==", "requires": { "@babel/runtime": "^7.20.0", - "@expo/cli": "0.22.5", + "@expo/cli": "0.22.6", "@expo/config": "~10.0.6", "@expo/config-plugins": "~9.0.12", - "@expo/fingerprint": "0.11.3", - "@expo/metro-config": "0.19.7", + "@expo/fingerprint": "0.11.4", + "@expo/metro-config": "0.19.8", "@expo/vector-icons": "^14.0.0", "babel-preset-expo": "~12.0.4", "expo-asset": "~11.0.1", "expo-constants": "~17.0.3", - "expo-file-system": "~18.0.5", + "expo-file-system": "~18.0.6", "expo-font": "~13.0.1", "expo-keep-awake": "~14.0.1", "expo-modules-autolinking": "2.0.4", - "expo-modules-core": "2.1.1", + "expo-modules-core": "2.1.2", "fbemitter": "^3.0.0", "web-streams-polyfill": "^3.3.2", "whatwg-url-without-unicode": "8.0.0-3" @@ -20781,9 +20783,9 @@ } }, "expo-file-system": { - "version": "18.0.5", - "resolved": "https://registry.npmjs.org/expo-file-system/-/expo-file-system-18.0.5.tgz", - "integrity": "sha512-vm7gA+PB7j99hfvBBFMRiti8OeazFK3AZWtDmCi6WQCXDxngXkAJViXhkHyF3xwDKljzlP8+4BIGrKCzbfoObg==", + "version": "18.0.6", + "resolved": "https://registry.npmjs.org/expo-file-system/-/expo-file-system-18.0.6.tgz", + "integrity": "sha512-gGEwIJCXV3/wpIJ/wRyhmieLOSAY7HeFFjb+wEfHs04aE63JYR+rXXV4b7rBpEh1ZgNV9U91zfet/iQG7J8HBQ==", "requires": { "web-streams-polyfill": "^3.3.2" } @@ -20922,9 +20924,9 @@ } }, "expo-modules-core": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/expo-modules-core/-/expo-modules-core-2.1.1.tgz", - "integrity": "sha512-yQzYCLR2mre4BNMXuqkeJ0oSNgmGEMI6BcmIzeNZbC2NFEjiaDpKvlV9bclYCtyVhUEVNbJcEPYMr6c1Y4eR4w==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/expo-modules-core/-/expo-modules-core-2.1.2.tgz", + "integrity": "sha512-0OhMU5S8zf9c/CRh1MwiXfOInI9wzz6yiIh5RuR/9J7N6xHRum68hInsPbaSc1UQpo08ZZLM4MPsbpoNRUoqIg==", "requires": { "invariant": "^2.2.4" } diff --git a/package.json b/package.json index 37441ab6..c97f0027 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "@xmldom/xmldom": "^0.8.10", "@xmpp/client": "^0.13.1", "date-fns": "^2.30.0", - "expo": "~52.0.7", + "expo": "~52.0.19", "expo-av": "~15.0.1", "expo-checkbox": "~4.0.0", "expo-clipboard": "~7.0.0",