A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.
feat(app): add Operator Pass terms and dispute account deletion
Hampus57c6a31d36de
diff --git a/fluxer_app/src/features/app/components/dialogs/components/PurchaseDisclaimer.tsx b/fluxer_app/src/features/app/components/dialogs/components/PurchaseDisclaimer.tsxindex 9f113c0fd..472302a84 100644--- a/fluxer_app/src/features/app/components/dialogs/components/PurchaseDisclaimer.tsx+++ b/fluxer_app/src/features/app/components/dialogs/components/PurchaseDisclaimer.tsx@@ -3,79 +3,160 @@import {Routes} from '@app/app/Routes';import styles from '@app/features/app/components/dialogs/components/PurchaseDisclaimer.module.css';import {ExternalLink} from '@app/features/app/components/shared/ExternalLink';-import {PAYMENT_PROVIDER_NAME} from '@app/features/app/config/I18nDisplayConstants';+import {OPERATOR_PASS_NAME, PAYMENT_PROVIDER_NAME} from '@app/features/app/config/I18nDisplayConstants';import RuntimeConfig from '@app/features/app/state/RuntimeConfig';+import {getPremiumProductName} from '@app/features/premium/utils/PremiumUtils';import {Trans} from '@lingui/react/macro';import {clsx} from 'clsx';import {observer} from 'mobx-react-lite';+import type {ReactNode} from 'react';export const PurchaseDisclaimer = observer(- ({isPremium = false, align = 'center'}: {isPremium?: boolean; align?: 'left' | 'center'}) => {+ ({+ isPremium = false,+ operatorPass = false,+ align = 'center',+ }: {+ isPremium?: boolean;+ operatorPass?: boolean;+ align?: 'left' | 'center';+ }) => {const selfHosted = RuntimeConfig.isSelfHosted();- const termsUrl = selfHosted ? RuntimeConfig.termsUrl : Routes.terms();- const privacyUrl = selfHosted ? RuntimeConfig.privacyUrl : Routes.privacy();- const terms = termsUrl ? (- <ExternalLink href={termsUrl} data-flx="app.purchase-disclaimer.external-link">- <Trans>Terms of service</Trans>- </ExternalLink>- ) : null;- const privacy = privacyUrl ? (- <ExternalLink href={privacyUrl} data-flx="app.purchase-disclaimer.external-link--2">- <Trans>Privacy policy</Trans>- </ExternalLink>- ) : null;- const termsOnly = termsUrl ? (- isPremium ? (- <Trans comment="Purchase disclaimer when the instance links only its terms of service. The linked text is the terms of service document.">- By purchasing, you agreed to our{' '}- <ExternalLink href={termsUrl} data-flx="app.purchase-disclaimer.external-link--terms-only">- Terms of service- </ExternalLink>- .- </Trans>- ) : (- <Trans comment="Purchase disclaimer when the instance links only its terms of service. The linked text is the terms of service document.">- By purchasing, you agree to our{' '}- <ExternalLink href={termsUrl} data-flx="app.purchase-disclaimer.external-link--terms-only">- Terms of service- </ExternalLink>- .- </Trans>- )- ) : null;+ const premiumProductName = getPremiumProductName();+ const termsUrl = Routes.terms();+ const privacyUrl = Routes.privacy();+ if (operatorPass) {+ const operatorPassTermsUrl = Routes.operatorPassTerms();+ const operatorPassPrivacyUrl = Routes.operatorPassPrivacy();+ return (+ <p+ className={clsx(styles.disclaimer, align === 'center' ? styles.center : styles.left)}+ data-flx="app.purchase-disclaimer.operator-pass"+ >+ {termsUrl ? (+ <Trans comment="Line directly above the payment button in the Operator Pass checkout dialog. Both linked texts name legal documents: the terms of service and the Operator Pass terms. {OPERATOR_PASS_NAME} is a product name and stays untranslated. Capitalize the linked texts the way your language does in the middle of a sentence.">+ By paying, you agree to the{' '}+ <ExternalLink href={termsUrl} data-flx="app.purchase-disclaimer.operator-pass.terms-link">+ terms of service+ </ExternalLink>{' '}+ and the{' '}+ <ExternalLink+ href={operatorPassTermsUrl}+ data-flx="app.purchase-disclaimer.operator-pass.operator-pass-terms-link"+ >+ {OPERATOR_PASS_NAME} terms+ </ExternalLink>+ .+ </Trans>+ ) : (+ <Trans comment="Line directly above the payment button in the Operator Pass checkout dialog on an instance that links no terms of service. The linked text names the Operator Pass terms document. {OPERATOR_PASS_NAME} is a product name and stays untranslated.">+ By paying, you agree to the{' '}+ <ExternalLink+ href={operatorPassTermsUrl}+ data-flx="app.purchase-disclaimer.operator-pass.operator-pass-terms-link--only"+ >+ {OPERATOR_PASS_NAME} terms+ </ExternalLink>+ .+ </Trans>+ )}{' '}+ {privacyUrl ? (+ <Trans comment="Sentence after the line that starts with By paying in the Operator Pass checkout dialog. Both linked texts name legal documents: the privacy policy and the Operator Pass privacy notice, which covers the name and avatar people send for the Operators' wall. People never agree to either, they only inform. {OPERATOR_PASS_NAME} is a product name and stays untranslated. Capitalize the linked texts the way your language does at their position in the sentence.">+ The{' '}+ <ExternalLink href={privacyUrl} data-flx="app.purchase-disclaimer.operator-pass.privacy-link">+ privacy policy+ </ExternalLink>{' '}+ and the{' '}+ <ExternalLink+ href={operatorPassPrivacyUrl}+ data-flx="app.purchase-disclaimer.operator-pass.operator-pass-privacy-link"+ >+ {OPERATOR_PASS_NAME} privacy notice+ </ExternalLink>{' '}+ explain how we handle your data.+ </Trans>+ ) : (+ <Trans comment="Sentence after the line that starts with By paying in the Operator Pass checkout dialog on an instance that links no privacy policy. The linked text names the Operator Pass privacy notice, which covers the name and avatar people send for the Operators' wall. People never agree to it, it only informs. {OPERATOR_PASS_NAME} is a product name and stays untranslated. Capitalize the linked text the way your language does at its position in the sentence.">+ The{' '}+ <ExternalLink+ href={operatorPassPrivacyUrl}+ data-flx="app.purchase-disclaimer.operator-pass.operator-pass-privacy-link--only"+ >+ {OPERATOR_PASS_NAME} privacy notice+ </ExternalLink>{' '}+ explains how we handle your data.+ </Trans>+ )}+ </p>+ );+ }+ let termsOnly: ReactNode = null;+ if (termsUrl) {+ if (isPremium) {+ termsOnly = (+ <Trans comment="Purchase disclaimer when the instance links only its terms of service. The linked text is the terms of service document.">+ By purchasing, you agreed to our{' '}+ <ExternalLink href={termsUrl} data-flx="app.purchase-disclaimer.external-link--terms-only">+ terms of service+ </ExternalLink>+ .+ </Trans>+ );+ } else {+ termsOnly = (+ <Trans comment="Purchase disclaimer when the instance links only its terms of service. The linked text is the terms of service document.">+ By purchasing, you agree to our{' '}+ <ExternalLink href={termsUrl} data-flx="app.purchase-disclaimer.external-link--terms-only">+ terms of service+ </ExternalLink>+ .+ </Trans>+ );+ }+ }const privacyOnly = privacyUrl ? (- isPremium ? (- <Trans comment="Purchase disclaimer when the instance links only its privacy policy. The linked text is the privacy policy document.">- By purchasing, you agreed to our{' '}- <ExternalLink href={privacyUrl} data-flx="app.purchase-disclaimer.external-link--privacy-only">- Privacy policy- </ExternalLink>- .- </Trans>- ) : (- <Trans comment="Purchase disclaimer when the instance links only its privacy policy. The linked text is the privacy policy document.">- By purchasing, you agree to our{' '}- <ExternalLink href={privacyUrl} data-flx="app.purchase-disclaimer.external-link--privacy-only">- Privacy policy- </ExternalLink>- .- </Trans>- )+ <Trans comment="Purchase disclaimer when the instance links only its privacy policy. The linked text is the privacy policy document. People never agree to the privacy policy, it only informs.">+ Our{' '}+ <ExternalLink href={privacyUrl} data-flx="app.purchase-disclaimer.external-link--privacy-only">+ privacy policy+ </ExternalLink>{' '}+ explains how we handle your data.+ </Trans>) : null;- const agreement =- terms && privacy ? (- isPremium ? (- <Trans>- By purchasing, you agreed to our {terms} and {privacy}.+ let agreement: ReactNode;+ if (termsUrl && privacyUrl) {+ if (isPremium) {+ agreement = (+ <Trans comment="Purchase disclaimer. People agree to the terms of service and only read the privacy policy. The first linked text is the terms of service document and the second is the privacy policy document.">+ By purchasing, you agreed to our{' '}+ <ExternalLink href={termsUrl} data-flx="app.purchase-disclaimer.external-link">+ terms of service+ </ExternalLink>+ . Our{' '}+ <ExternalLink href={privacyUrl} data-flx="app.purchase-disclaimer.external-link--2">+ privacy policy+ </ExternalLink>{' '}+ explains how we handle your data.</Trans>- ) : (- <Trans>- By purchasing, you agree to our {terms} and {privacy}.+ );+ } else {+ agreement = (+ <Trans comment="Purchase disclaimer. People agree to the terms of service and only read the privacy policy. The first linked text is the terms of service document and the second is the privacy policy document.">+ By purchasing, you agree to our{' '}+ <ExternalLink href={termsUrl} data-flx="app.purchase-disclaimer.external-link">+ terms of service+ </ExternalLink>+ . Our{' '}+ <ExternalLink href={privacyUrl} data-flx="app.purchase-disclaimer.external-link--2">+ privacy policy+ </ExternalLink>{' '}+ explains how we handle your data.</Trans>- )- ) : (- (termsOnly ?? privacyOnly)- );+ );+ }+ } else {+ agreement = termsOnly ?? privacyOnly;+ }return (<pclassName={clsx(styles.disclaimer, align === 'center' ? styles.center : styles.left)}@@ -88,11 +169,13 @@ export const PurchaseDisclaimer = observer({PAYMENT_PROVIDER_NAME} handles payment securely.</Trans>) : (- <Trans>- Self-serve refunds available within 3 days of payment, once every 30 days. Refunding a subscription cancels- it. EU/EEA buyers waive the 14-day right of withdrawal at checkout to access content immediately. Use the- in-app refund button instead of a chargeback. Chargebacks can permanently restrict your account. Stripe- handles payment securely. We never see your full card number.+ <Trans comment="Purchase disclaimer in the premium subscription checkout. Consumer law text, translate faithfully. {premiumProductName} is a product name and stays untranslated. {PAYMENT_PROVIDER_NAME} is the payment processor name. Withdraw means using the consumer right of withdrawal to cancel the purchase, never taking money out. A payment dispute is a chargeback filed with a bank or card company. Permanent deletion of the account applies only to disputes we review and find unjustified. Disputes about a wrong or unauthorized charge never lead to it.">+ Self-serve refunds are available within 3 days of payment, once every 30 days. Refunding a subscription+ cancels it. If you are a consumer in the EU or the EEA, you can withdraw for a full refund until your+ withdrawal period ends, even after {premiumProductName} starts. Please ask for a refund before you dispute a+ charge. A payment dispute we find unjustified after a review can lead to the permanent deletion of your+ account, and a dispute about a wrong or unauthorized charge never does. {PAYMENT_PROVIDER_NAME} handles+ payment securely. We never see your full card number.</Trans>)}</p>diff --git a/fluxer_app/src/features/app/config/I18nDisplayConstants.ts b/fluxer_app/src/features/app/config/I18nDisplayConstants.tsindex d0d5987b9..accc4363f 100644--- a/fluxer_app/src/features/app/config/I18nDisplayConstants.ts+++ b/fluxer_app/src/features/app/config/I18nDisplayConstants.ts@@ -6,6 +6,8 @@ import {formatAssetUploadExtensions, formatKnownAnimatedAssetExtensions} from '@import {THE_OTHER_PLATFORM} from '@fluxer/constants/src/ExternalPlatformConstants';export {PRODUCT_NAME};+export const PRODUCT_LABS_COMMUNITY_NAME = `${PRODUCT_NAME} Labs`;+export const OPERATOR_PASS_NAME = 'Operator Pass';export const DESKTOP_ENTRY_NAME = 'Fluxer';export const CANARY_DESKTOP_ENTRY_NAME = 'Fluxer Canary';export const PAYMENT_PROVIDER_NAME = 'Stripe';