timeout-upgrade-prompt.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. import { useTranslation } from 'react-i18next'
  2. import { useEditorContext } from '../../../shared/context/editor-context'
  3. import Icon from '../../../shared/components/icon'
  4. import StartFreeTrialButton from '../../../shared/components/start-free-trial-button'
  5. import { memo } from 'react'
  6. import PdfLogEntry from './pdf-log-entry'
  7. function TimeoutUpgradePrompt() {
  8. const { t } = useTranslation()
  9. const { hasPremiumCompile, isProjectOwner } = useEditorContext()
  10. if (!window.ExposedSettings.enableSubscriptions || hasPremiumCompile) {
  11. return null
  12. }
  13. return (
  14. <PdfLogEntry
  15. headerTitle={
  16. isProjectOwner
  17. ? t('upgrade_for_longer_compiles')
  18. : t('ask_proj_owner_to_upgrade_for_longer_compiles')
  19. }
  20. formattedContent={
  21. <>
  22. <p>{t('free_accounts_have_timeout_upgrade_to_increase')}</p>
  23. <p>{t('plus_upgraded_accounts_receive')}:</p>
  24. <div>
  25. <ul className="list-unstyled">
  26. <li>
  27. <Icon type="check" />
  28. &nbsp;
  29. {t('unlimited_projects')}
  30. </li>
  31. <li>
  32. <Icon type="check" />
  33. &nbsp;
  34. {t('collabs_per_proj', { collabcount: 'Multiple' })}
  35. </li>
  36. <li>
  37. <Icon type="check" />
  38. &nbsp;
  39. {t('full_doc_history')}
  40. </li>
  41. <li>
  42. <Icon type="check" />
  43. &nbsp;
  44. {t('sync_to_dropbox')}
  45. </li>
  46. <li>
  47. <Icon type="check" />
  48. &nbsp;
  49. {t('sync_to_github')}
  50. </li>
  51. <li>
  52. <Icon type="check" />
  53. &nbsp;
  54. {t('compile_larger_projects')}
  55. </li>
  56. </ul>
  57. </div>
  58. {isProjectOwner && (
  59. <p className="text-center">
  60. <StartFreeTrialButton
  61. source="compile-timeout"
  62. buttonStyle="success"
  63. classes={{ button: 'row-spaced-small' }}
  64. />
  65. </p>
  66. )}
  67. </>
  68. }
  69. entryAriaLabel={
  70. isProjectOwner
  71. ? t('upgrade_for_longer_compiles')
  72. : t('ask_proj_owner_to_upgrade_for_longer_compiles')
  73. }
  74. level="success"
  75. />
  76. )
  77. }
  78. export default memo(TimeoutUpgradePrompt)