diff --git a/react/Paywall/OnlyOfficePaywall.jsx b/react/Paywall/OnlyOfficePaywall.jsx index 9f610e27c3..05340d01b9 100644 --- a/react/Paywall/OnlyOfficePaywall.jsx +++ b/react/Paywall/OnlyOfficePaywall.jsx @@ -1,97 +1,9 @@ import React from 'react' -import ReactMarkdown from 'react-markdown' -import { isMobileApp, isFlagshipApp } from 'cozy-device-helper' -import { useClient } from 'cozy-client' -import { buildPremiumLink } from 'cozy-client/dist/models/instance' +import Paywall from './Paywall' -import useInstance from '../helpers/useInstance' -import Spinner from '../Spinner' -import { IllustrationDialog } from '../CozyDialogs' -import Icon from '../Icon' -import CozyUpgradeIcon from '../Icons/CozyUpgrade' -import Button from '../Buttons' -import Typography from '../Typography' -import withLocales from '../I18n/withLocales' -import { makeType } from './helpers' -import fr from './locales/fr.json' -import en from './locales/en.json' - -const locales = { - en, - fr -} - -const OnlyOfficePaywall = ({ onClose, isPublic, t } = { isPublic: false }) => { - const client = useClient() - const instance = useInstance(client) - - if (instance.state === 'loading' && instance.state !== 'loaded') - return ( - - - - } - onClose={onClose} - /> - ) - - const isMobileAppVersion = isMobileApp() || isFlagshipApp() - const link = buildPremiumLink(instance) - const type = makeType(instance, isPublic, link) - - const onAction = () => { - return type === 'premium' && !isMobileAppVersion - ? window.open(link, 'self') - : onClose() - } - - return ( - - - - {t(`onlyOfficePaywall.${type}.title`)} - - - } - actions={ -