Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

(improvement) Pricing & Billing rework (#363)

Andrii Romasiun62fb06910878
diff --git a/app/pages/Billing/index.tsx b/app/pages/Billing/index.tsx
index 01d0cd1d8..70974907f 100644
--- a/app/pages/Billing/index.tsx
+++ b/app/pages/Billing/index.tsx
@@ -4,7 +4,6 @@ import React, {
} from 'react'
import { useTranslation, Trans } from 'react-i18next'
import { useSelector, useDispatch } from 'react-redux'
-import { Link } from '@remix-run/react'
import dayjs from 'dayjs'
import utc from 'dayjs/plugin/utc'
import duration from 'dayjs/plugin/duration'
@@ -17,10 +16,12 @@ import {
import { loadScript } from 'utils/generic'
import Loader from 'ui/Loader'
import { useAppDispatch, StateType } from 'redux/store'
-import routes from 'routesPath'
import sagaActions from 'redux/sagas/actions'
import { withAuthentication, auth } from 'hoc/protected'
import Modal from 'ui/Modal'
+import Button from 'ui/Button'
+import MultiProgress from 'ui/MultiProgress'
+import Tooltip from 'ui/Tooltip'
import { IUser } from 'redux/models/IUser'
import UIActions from 'redux/reducers/ui'
import Pricing from '../MainPage/Pricing'
@@ -30,15 +31,17 @@ dayjs.extend(duration)
interface IBilling {
ssrAuthenticated: boolean,
+ ssrTheme: 'dark' | 'light',
}
-const Billing: React.FC<IBilling> = ({ ssrAuthenticated }): JSX.Element => {
+const Billing: React.FC<IBilling> = ({ ssrAuthenticated, ssrTheme }): JSX.Element => {
const [isCancelSubModalOpened, setIsCancelSubModalOpened] = useState<boolean>(false)
const { metainfo, usageinfo } = useSelector((state: StateType) => state.ui.misc)
const { user, loading }: {
user: IUser, loading: boolean,
} = useSelector((state: StateType) => state.auth)
- const { theme } = useSelector((state: StateType) => state.ui.theme)
+ const { theme: reduxTheme } = useSelector((state: StateType) => state.ui.theme)
+ const theme = isBrowser ? reduxTheme : ssrTheme
const paddleLoaded = useSelector((state: StateType) => state.ui.misc.paddleLoaded)
const reduxAuthenticated = useSelector((state: StateType) => state.auth.authenticated)
const dispatch = useDispatch()
@@ -55,6 +58,7 @@ const Billing: React.FC<IBilling> = ({ ssrAuthenticated }): JSX.Element => {
const {
nextBillDate, planCode, subUpdateURL, trialEndDate, timeFormat, cancellationEffectiveDate, subCancelURL, maxEventsCount,
} = user
+ const isSubscriber = user.planCode !== 'none' && user.planCode !== 'trial' && user.planCode !== 'free'
const isTrial: boolean = planCode === 'trial'
const isNoSub: boolean = planCode === 'none'
@@ -181,36 +185,37 @@ const Billing: React.FC<IBilling> = ({ ssrAuthenticated }): JSX.Element => {
return (
<div className='bg-gray-50 dark:bg-slate-900 min-h-page'>
+ {/* NEW */}
<div className='w-11/12 md:w-4/5 mx-auto pb-16 pt-12 px-4 sm:px-6 lg:px-8 whitespace-pre-line'>
<div className='flex justify-between flex-wrap gap-y-2 mb-4'>
<h1 className='text-4xl font-extrabold text-gray-900 dark:text-gray-50 tracking-tight mr-2'>
{t('billing.title')}
</h1>
- <div>
- {subUpdateURL && (
- <span onClick={onUpdatePaymentDetails} className='inline-flex select-none cursor-pointer mr-2 items-center border border-transparent leading-4 font-medium rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 shadow-sm text-white bg-indigo-600 hover:bg-indigo-700 px-4 py-2 text-sm'>
- {t('billing.update')}
- </span>
- )}
- {subCancelURL && (
- <span onClick={() => setIsCancelSubModalOpened(true)} className='inline-flex select-none cursor-pointer items-center border border-transparent leading-4 font-medium rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 shadow-sm text-white bg-red-500 dark:bg-red-600 hover:bg-red-600 dark:hover:bg-red-700 px-4 py-2 text-sm'>
- {t('billing.cancelSub')}
- </span>
- )}
- </div>
</div>
- <p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>
- {t('billing.desc')}
- <br />
- <Link to={`${routes.billing}#usage`} className='text-indigo-600 dark:text-indigo-400 hover:text-indigo-500 dark:hover:text-indigo-500'>
- {t('billing.gotoUsage')}
- </Link>
+ <h2 id='billing' className='text-2xl font-medium text-gray-900 dark:text-gray-50 tracking-tight mb-2'>
+ {t('billing.subscription')}
+ </h2>
+ <p className='mt-1 text-base text-gray-900 dark:text-gray-50 tracking-tight'>
+ {isSubscriber
+ ? t('billing.selectPlan')
+ : t('billing.changePlan')}
+ </p>
+ <p className='text-base text-gray-900 dark:text-gray-50 tracking-tight'>
+ {t('billing.membersNotification')}
</p>
- <hr className='mt-3 mb-2 border-gray-200 dark:border-gray-600' />
+ {isSubscriber && nextBillDate && (
+ <p className='mt-1 text-base text-gray-900 dark:text-gray-50 tracking-tight'>
+ {t('billing.nextBillDateIs', {
+ date: language === 'en'
+ ? dayjs(nextBillDate).locale(language).format('MMMM D, YYYY')
+ : dayjs(nextBillDate).locale(language).format('D MMMM, YYYY')
+ })}
+ </p>
+ )}
{cancellationEffectiveDate && (
- <div className='flex items-center text-lg text-gray-900 dark:text-gray-50 tracking-tight'>
+ <div className='flex items-center text-lg text-gray-900 dark:text-gray-50 tracking-tight mt-3'>
<InformationCircleIcon className='h-10 w-10 mr-2 text-blue-600' aria-hidden='true' />
- <span className='font-bold max-w-prose'>
+ <span className='font-medium max-w-prose'>
{t('billing.cancelledSubMessage', {
date: language === 'en'
? dayjs(cancellationEffectiveDate).locale(language).format('MMMM D, YYYY')
@@ -219,30 +224,17 @@ const Billing: React.FC<IBilling> = ({ ssrAuthenticated }): JSX.Element => {
</span>
</div>
)}
- {nextBillDate && (
- <div className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>
- <span className='font-bold'>
- {t('billing.nextBillDate')}
- </span>
- &nbsp;
- <span>
- {language === 'en'
- ? dayjs(nextBillDate).locale(language).format('MMMM D, YYYY')
- : dayjs(nextBillDate).locale(language).format('D MMMM, YYYY')}
- </span>
- </div>
- )}
{isTrial && trialMessage && (
- <div className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>
- <span className='font-bold'>
+ <div className='text-lg text-gray-900 dark:text-gray-50 tracking-tight mt-3'>
+ <span className='font-medium'>
{trialMessage}
</span>
</div>
)}
{isNoSub && (
- <div className='flex items-center text-lg text-gray-900 dark:text-gray-50 tracking-tight'>
+ <div className='flex items-center text-lg text-gray-900 dark:text-gray-50 tracking-tight mt-3'>
<ExclamationTriangleIcon className='h-10 w-10 mr-2 text-red-600' aria-hidden='true' />
- <span className='font-bold max-w-prose'>
+ <span className='font-medium max-w-prose'>
{t('billing.noSubWarning')}
</span>
</div>
@@ -251,52 +243,95 @@ const Billing: React.FC<IBilling> = ({ ssrAuthenticated }): JSX.Element => {
<Loader />
) : (
<>
- <Pricing authenticated={authenticated} t={t} language={language} />
- <p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight mt-10'>
- <Trans
- // @ts-ignore
- t={t}
- i18nKey='billing.contact'
- values={{ email: CONTACT_EMAIL }}
- // @ts-ignore
- components={{
- mail: <a title={`Email us at ${CONTACT_EMAIL}`} href={`mailto:${CONTACT_EMAIL}`} className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400' />,
- amount: 5,
- }}
- />
- </p>
- <h2 id='usage' className='mt-5 text-3xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mr-2'>
+ <div className='flex xl:space-x-5 mt-5 flex-col xl:flex-row'>
+ <Pricing authenticated={authenticated} t={t} language={language} isBillingPage />
+ <div className='space-y-2'>
+ {subUpdateURL && (
+ <Button className='mr-2' onClick={onUpdatePaymentDetails} type='button' primary large>
+ {t('billing.update')}
+ </Button>
+ )}
+ {subCancelURL && (
+ <Button onClick={() => setIsCancelSubModalOpened(true)} type='button' semiDanger large>
+ {t('billing.cancelSub')}
+ </Button>
+ )}
+ </div>
+ </div>
+ <h2 id='usage' className='mt-5 text-2xl font-medium text-gray-900 dark:text-gray-50 tracking-tight'>
{t('billing.planUsage')}
</h2>
- <p className='mt-1 text-lg text-gray-900 dark:text-gray-50 tracking-tight'>
- {t('billing.usageOverview', {
- tracked: usageinfo.total || 0,
- trackedPerc: totalUsage || 0,
- maxEvents: maxEventsCount || 0,
- })}
+ <p className='mt-1 text-base text-gray-900 dark:text-gray-50 tracking-tight'>
+ {t('billing.planUsageDesc')}
</p>
<div className='mt-2 text-lg text-gray-900 dark:text-gray-50 tracking-tight'>
- {t('billing.breakdown')}
- <ul className='list-disc list-inside'>
- <li>
- {t('billing.pageviews', {
- quantity: usageinfo.traffic || 0,
- percentage: usageinfo.trafficPerc || 0,
- })}
- </li>
- <li>
- {t('billing.customEvents', {
- quantity: usageinfo.customEvents || 0,
- percentage: usageinfo.customEventsPerc || 0,
- })}
- </li>
- <li>
- {t('billing.captcha', {
- quantity: usageinfo.captcha || 0,
- percentage: usageinfo.captchaPerc || 0,
- })}
- </li>
- </ul>
+ <p className='text-base font-medium text-gray-900 dark:text-gray-50 tracking-tight mb-1'>
+ {t('billing.xofy', {
+ x: usageinfo.total || 0,
+ y: maxEventsCount || 0,
+ })}
+ </p>
+
+ <Tooltip
+ text={(
+ <div>
+ <p>
+ {t('billing.usageOverview', {
+ tracked: usageinfo.total || 0,
+ trackedPerc: totalUsage || 0,
+ maxEvents: maxEventsCount || 0,
+ })}
+ </p>
+ <ul className='list-disc list-inside mt-2'>
+ <li className='marker:text-blue-600 dark:marker:text-blue-800'>
+ {t('billing.pageviews', {
+ quantity: usageinfo.traffic || 0,
+ percentage: usageinfo.trafficPerc || 0,
+ })}
+ </li>
+ <li className='marker:text-fuchsia-600 dark:marker:text-fuchsia-800'>
+ {t('billing.customEvents', {
+ quantity: usageinfo.customEvents || 0,
+ percentage: usageinfo.customEventsPerc || 0,
+ })}
+ </li>
+ <li className='marker:text-lime-600 dark:marker:text-lime-800'>
+ {t('billing.captcha', {
+ quantity: usageinfo.captcha || 0,
+ percentage: usageinfo.captchaPerc || 0,
+ })}
+ </li>
+ </ul>
+ </div>
+ )}
+ tooltipNode={(
+ <MultiProgress
+ theme={theme}
+ className='max-w-[25rem] w-[85vw]'
+ progress={[
+ {
+ value: usageinfo.traffic === 0 ? 0 : maxEventsCount / usageinfo.traffic,
+ lightColour: '#2563eb',
+ darkColour: '#1d4ed8',
+ },
+ {
+ value: usageinfo.customEvents === 0 ? 0 : maxEventsCount / usageinfo.customEvents,
+ lightColour: '#c026d3',
+ darkColour: '#a21caf',
+ },
+ {
+ value: usageinfo.captcha === 0 ? 0 : maxEventsCount / usageinfo.captcha,
+ lightColour: '#65a30d',
+ darkColour: '#4d7c0f',
+ }
+ ]}
+ />
+ )}
+ className='max-w-max !w-max !h-auto'
+ />
+ <p className='mt-1 text-base text-gray-900 dark:text-gray-50 tracking-tight'>
+ {t('billing.resetDate')}
+ </p>
</div>
</>
)}
diff --git a/app/pages/MainPage/Pricing.tsx b/app/pages/MainPage/Pricing.tsx
index d08dd0a38..fd6abcc2e 100644
--- a/app/pages/MainPage/Pricing.tsx
+++ b/app/pages/MainPage/Pricing.tsx
@@ -7,15 +7,15 @@ import { CheckIcon } from '@heroicons/react/24/solid'
import dayjs from 'dayjs'
import _map from 'lodash/map'
import _isNil from 'lodash/isNil'
-import _findIndex from 'lodash/findIndex'
-import _isEmpty from 'lodash/isEmpty'
+import _includes from 'lodash/includes'
import { Trans } from 'react-i18next'
+import { RadioGroup } from '@headlessui/react'
import cx from 'clsx'
import Modal from 'ui/Modal'
-import Spin from 'ui/icons/Spin'
+import Button from 'ui/Button'
import {
- CONTACT_EMAIL, paddleLanguageMapping, PLAN_LIMITS, CURRENCIES, BillingFrequency, REFERRAL_DISCOUNT_CODE,
+ CONTACT_EMAIL, paddleLanguageMapping, PLAN_LIMITS, CURRENCIES, BillingFrequency, REFERRAL_DISCOUNT_CODE, STANDARD_PLANS,
} from 'redux/constants'
import { errorsActions } from 'redux/reducers/errors'
import { alertsActions } from 'redux/reducers/alerts'
@@ -25,244 +25,21 @@ import {
authMe, previewSubscriptionUpdate, changeSubscriptionPlan,
} from 'api'
import routes from 'routesPath'
-import { IUser } from 'redux/models/IUser'
import { AppDispatch, StateType } from 'redux/store'
import Loader from 'ui/Loader'
-type CurrencyCode = 'USD' | 'EUR' | 'GBP'
-
-const getNonStandardTiers = (t: (key: string, options?: {
- [key: string]: any
-}) => string, currencyCode: CurrencyCode) => ({
- free: {
- name: t('pricing.free'),
- planCode: 'free',
- priceMonthly: PLAN_LIMITS.free.price[currencyCode].monthly,
- priceYearly: PLAN_LIMITS.free.price[currencyCode].yearly,
- legacy: PLAN_LIMITS.free.legacy,
- includedFeatures: [
- t('pricing.tiers.upToXVMo', { amount: PLAN_LIMITS.free.monthlyUsageLimit.toLocaleString('en-US') }),
- t('pricing.tiers.upToXWebsites', { amount: PLAN_LIMITS.free.maxProjects }),
- // t('pricing.tiers.xMoDataRetention', { amount: 3 }),
- t('pricing.tiers.xAlertsSingular', { amount: PLAN_LIMITS.free.maxAlerts }),
- t('pricing.tiers.userFlowAnalysis'),
- t('pricing.tiers.dataExports'),
- t('pricing.tiers.dataOwnership'),
- t('main.competitiveFeatures.perf'),
- t('pricing.tiers.dashboards'),
- t('pricing.tiers.reports'),
- ],
- },
- trial: {
- name: t('pricing.tiers.trial'),
- planCode: 'trial',
- priceMonthly: PLAN_LIMITS.trial.price[currencyCode].monthly,
- priceYearly: PLAN_LIMITS.trial.price[currencyCode].yearly,
- legacy: PLAN_LIMITS.trial.legacy,
- includedFeatures: [
- t('pricing.tiers.evXPlanIncl', { plan: t('pricing.tiers.freelancer') }),
- ],
- },
-})
-
-const getTiers = (t: (key: string, options?: {
- [key: string]: any
-}) => string, currencyCode: CurrencyCode) => [
- {
- name: t('pricing.tiers.hobby'),
- planCode: 'hobby',
- priceMonthly: PLAN_LIMITS.hobby.price[currencyCode].monthly,
- priceYearly: PLAN_LIMITS.hobby.price[currencyCode].yearly,
- includedFeatures: [
- t('pricing.tiers.upToXVMo', { amount: PLAN_LIMITS.hobby.monthlyUsageLimit.toLocaleString('en-US') }),
- t('pricing.tiers.upToXWebsites', { amount: PLAN_LIMITS.hobby.maxProjects }),
- // t('pricing.tiers.xMoDataRetention', { amount: 3 }),
- t('pricing.tiers.xAlertsPlural', { amount: PLAN_LIMITS.hobby.maxAlerts }),
- t('pricing.tiers.userFlowAnalysis'),
- t('pricing.tiers.dataExports'),
- t('pricing.tiers.dataOwnership'),
- t('main.competitiveFeatures.perf'),
- t('pricing.tiers.dashboards'),
- t('pricing.tiers.reports'),
- ],
- pid: '813694', // Plan ID
- ypid: '813695', // Plan ID - Yearly billing
- },
- {
- name: t('pricing.tiers.freelancer'),
- planCode: 'freelancer',
- priceMonthly: PLAN_LIMITS.freelancer.price[currencyCode].monthly,
- priceYearly: PLAN_LIMITS.freelancer.price[currencyCode].yearly,
- includedFeatures: [
- t('pricing.tiers.evXPlanIncl', { plan: t('pricing.tiers.hobby') }),
- t('pricing.tiers.xVMo', { amount: PLAN_LIMITS.freelancer.monthlyUsageLimit.toLocaleString('en-US') }),
- t('pricing.tiers.upToXWebsites', { amount: PLAN_LIMITS.freelancer.maxProjects }),
- t('pricing.tiers.xAlertsPlural', { amount: PLAN_LIMITS.freelancer.maxAlerts }),
- // t('pricing.tiers.xMoDataRetention', { amount: 12 }),
- // t('pricing.tiers.smallBusiSupport'),
- ],
- pid: 752316, // Plan ID
- ypid: 776469, // Plan ID - Yearly billing
- },
- {
- name: t('pricing.tiers.startup'),
- planCode: 'startup',
- priceMonthly: PLAN_LIMITS.startup.price[currencyCode].monthly,
- priceYearly: PLAN_LIMITS.startup.price[currencyCode].yearly,
- includedFeatures: [
- t('pricing.tiers.evXPlanIncl', { plan: t('pricing.tiers.freelancer') }),
- t('pricing.tiers.xVMo', { amount: PLAN_LIMITS.startup.monthlyUsageLimit.toLocaleString('en-US') }),
- t('pricing.tiers.xAlertsPlural', { amount: PLAN_LIMITS.startup.maxAlerts }),
- // t('pricing.tiers.xMoDataRetention', { amount: 12 }),
- ],
- pid: 752317,
- ypid: 776470,
- mostPopular: true,
- },
- {
- name: t('pricing.tiers.enterprise'),
- planCode: 'enterprise',
- priceMonthly: PLAN_LIMITS.enterprise.price[currencyCode].monthly,
- priceYearly: PLAN_LIMITS.enterprise.price[currencyCode].yearly,
- includedFeatures: [
- t('pricing.tiers.evXPlanIncl', { plan: t('pricing.tiers.startup') }),
- t('pricing.tiers.xVMo', { amount: PLAN_LIMITS.enterprise.monthlyUsageLimit.toLocaleString('en-US') }),
- t('pricing.tiers.upToXWebsites', { amount: PLAN_LIMITS.enterprise.maxProjects }),
- t('pricing.tiers.xAlertsPlural', { amount: PLAN_LIMITS.enterprise.maxAlerts }),
- // t('pricing.tiers.xMoDataRetention', { amount: 24 }),
- ],
- pid: 752318,
- ypid: 776471,
- },
-]
-
-interface IPricingItem {
- tier: any
- user: IUser
- t: (key: string, options?: {
- [key: string]: any
- }) => string
- authenticated: boolean
- billingFrequency: string
- onPlanChange: (planCode: {
- planCode: string,
- name: string,
- pid: string,
- ypid: string,
- }) => void
- downgradeHandler: (item: any) => void
- downgrade: boolean
- planCodeLoading: boolean | string | null
- planCodeID: string | number
- userPlancodeID: string | number
- currencyCode: CurrencyCode
-}
-
-const PricingItem = ({
- tier, user, t, authenticated, billingFrequency, onPlanChange, downgradeHandler, downgrade,
- planCodeLoading, planCodeID, userPlancodeID, currencyCode,
-}: IPricingItem) => {
- let action
-
- const currency = CURRENCIES[currencyCode]
-
- if (planCodeID > userPlancodeID) {
- action = t('pricing.upgrade')
- } else if (downgrade) {
- action = t('pricing.downgrade')
- } else if (user.billingFrequency === billingFrequency || user.planCode === 'free' || user.planCode === 'trial') {
- action = t('pricing.yourPlan')
- } else if (billingFrequency === BillingFrequency.monthly) {
- action = t('pricing.switchToMonthly')
- } else {
- action = t('pricing.switchToYearly')
- }
-
- return (
- <div
- key={tier.name}
- className={cx('relative border rounded-2xl shadow-sm divide-y bg-[#F5F5F5] dark:bg-slate-800/20 dark:border dark:border-slate-800 divide-gray-200 dark:divide-slate-700', {
- 'border-indigo-400': user.planCode === tier.planCode,
- 'border-gray-200 dark:border-gray-500': user.planCode !== tier.planCode,
- })}
- >
- {user.planCode === tier.planCode && (
- <div className='absolute inset-x-0 top-0 transform translate-y-px'>
- <div className='flex justify-center transform -translate-y-1/2'>
- <span className='inline-flex rounded-full bg-indigo-600 px-4 py-1 text-sm font-semibold tracking-wider uppercase text-white'>
- {t('pricing.currentPlan')}
- </span>
- </div>
- </div>
- )}
- <div className='p-6 border-none'>
- <h2 className='text-lg leading-6 font-semibold text-[#4D4D4D] dark:text-gray-50 text-center'>{tier.name}</h2>
- {tier.mostPopular && !authenticated && (
- <p className='absolute top-0 py-1.5 px-4 bg-indigo-600 dark:bg-indigo-700 rounded-full text-xs font-semibold uppercase tracking-wide text-white transform -translate-y-1/2'>
- {t('pricing.mostPopular')}
- </p>
- )}
- {tier.legacy && (
- <p className='absolute top-0 left-2 py-1 px-2 bg-yellow-500 rounded-full text-xs font-semibold uppercase tracking-wide text-white transform translate-y-4'>
- {t('pricing.legacy')}
- </p>
- )}
- <ClientOnly fallback={<Loader />}>
- {() => (
- <p className='mt-4 text-center'>
- <span className='text-4xl font-bold text-[#4D4D4D] dark:text-gray-50'>
- {currency.symbol}
- {billingFrequency === BillingFrequency.monthly ? tier.priceMonthly : tier.priceYearly}
- </span>
- &nbsp;
- <span className='text-base font-medium text-gray-500 dark:text-gray-400'>
- /
- {t(billingFrequency === BillingFrequency.monthly ? 'pricing.perMonth' : 'pricing.perYear')}
- </span>
- </p>
- )}
- </ClientOnly>
- {authenticated ? (
- <span
- onClick={() => downgrade ? downgradeHandler(tier) : onPlanChange(tier)}
- className={cx('inline-flex items-center justify-center mt-8 w-full rounded-md py-2 text-sm font-semibold text-white text-center select-none', {
- 'bg-indigo-600 hover:bg-indigo-700 dark:bg-indigo-700 hover:dark:bg-indigo-800 cursor-pointer': planCodeLoading === null && (tier.planCode !== user.planCode || (user.billingFrequency !== billingFrequency && user.planCode !== 'free')),
- 'bg-indigo-400 cursor-default': planCodeLoading !== null || (tier.planCode === user.planCode && (user.billingFrequency === billingFrequency || user.planCode === 'free' || user.planCode === 'trial')),
- })}
- >
- {planCodeLoading === tier.planCode && (
- <Spin />
- )}
- {action}
- </span>
- ) : (
- <Link
- className='mt-8 block w-full bg-indigo-600 dark:bg-indigo-700 hover:dark:bg-indigo-800 rounded-md py-2 text-sm font-semibold text-white text-center hover:bg-indigo-700'
- to={routes.signup}
- aria-label={t('titles.signup')}
- >
- {t('common.getStarted')}
- </Link>
- )}
- </div>
- <div className='px-6 border-none'>
- <hr className='w-full mx-auto border border-gray-300 dark:border-slate-800' />
- </div>
- <div className='pt-6 pb-8 px-6 border-none'>
- <h3 className='text-xs font-medium text-gray-900 dark:text-gray-50 tracking-wide uppercase'>
- {t('pricing.whatIncl')}
- </h3>
- <ul className='mt-6 space-y-4'>
- {_map(tier.includedFeatures, (feature) => (
- <li key={feature} className='flex space-x-3'>
- <CheckIcon className='flex-shrink-0 h-5 w-5 text-green-500' aria-hidden='true' />
- <span className='text-sm text-gray-500 dark:text-gray-200'>{feature}</span>
- </li>
- ))}
- </ul>
- </div>
- </div>
- )
+const getPaidFeatures = (t: any, tier: any) => {
+ return [
+ t('pricing.tiers.upToXVMo', { amount: tier.monthlyUsageLimit.toLocaleString('en-US') }),
+ t('pricing.tiers.upToXWebsites', { amount: 50 }),
+ t('pricing.tiers.xAlertsPlural', { amount: 50 }),
+ t('pricing.tiers.userFlowAnalysis'),
+ t('pricing.tiers.dataExports'),
+ t('pricing.tiers.dataOwnership'),
+ t('main.competitiveFeatures.perf'),
+ t('pricing.tiers.dashboards'),
+ t('pricing.tiers.reports'),
+ ]
}
interface IPricing {
@@ -271,9 +48,10 @@ interface IPricing {
}) => string,
language: string,
authenticated: boolean,
+ isBillingPage?: boolean,
}
-const Pricing = ({ t, language, authenticated }: IPricing) => {
+const Pricing = ({ t, language, authenticated, isBillingPage }: IPricing) => {
const dispatch: AppDispatch = useDispatch()
const { user } = useSelector((state: StateType) => state.auth)
const { theme } = useSelector((state: StateType) => state.ui.theme)
@@ -294,13 +72,25 @@ const Pricing = ({ t, language, authenticated }: IPricing) => {
} | null>(null)
const [showDowngradeModal, setShowDowngradeModal] = useState<boolean>(false)
const [billingFrequency, setBillingFrequency] = useState(user?.billingFrequency || BillingFrequency.monthly)
- const tiers = getTiers(t, currencyCode)
- const nonStandardTiers: {
- [key: string]: {
- [key: string]: any,
- },
- } = getNonStandardTiers(t, currencyCode)
- const isNonStandardTier = authenticated && !_isEmpty(nonStandardTiers[user.planCode])
+
+ const PLAN_CODES_ARRAY = authenticated
+ ? _includes(STANDARD_PLANS, user.planCode)
+ ? STANDARD_PLANS
+ : [user.planCode, ...STANDARD_PLANS]
+ : STANDARD_PLANS
+
+ // @ts-ignore
+ const [selectedTier, setSelectedTier] = useState<any>(authenticated ? PLAN_LIMITS[user.planCode] : PLAN_LIMITS.hobby)
+ const planFeatures = getPaidFeatures(t, selectedTier)
+ const currency = CURRENCIES[currencyCode]
+
+ const onSelectPlanChange = (e: React.ChangeEvent<HTMLInputElement>) => {
+ const index = Number(e.target.value)
+ const planCode = PLAN_CODES_ARRAY[index]
+
+ // @ts-ignore
+ setSelectedTier(PLAN_LIMITS[planCode])
+ }
useEffect(() => {
const lastEventHandler = async (data: {
@@ -449,87 +239,194 @@ const Pricing = ({ t, language, authenticated }: IPricing) => {
}
}
- const userPlancodeID = _findIndex(tiers, (el) => el.planCode === user.planCode)
+ // @ts-ignore
+ const userPlancodeID = PLAN_LIMITS[user.planCode]?.index
+ const planCodeID = selectedTier.index
+ const downgrade = planCodeID < userPlancodeID
+
+ let action: string
+
+ if (planCodeID > userPlancodeID) {
+ action = t('pricing.upgrade')
+ } else if (downgrade) {
+ action = t('pricing.downgrade')
+ } else if (user.billingFrequency === billingFrequency || user.planCode === 'free' || user.planCode === 'trial' || user.planCode === 'none') {
+ action = t('pricing.yourPlan')
+ } else if (billingFrequency === BillingFrequency.monthly) {
+ action = t('pricing.switchToMonthly')
+ } else {
+ action = t('pricing.switchToYearly')
+ }
return (
<>
<div id='pricing' className={cx({ 'bg-white dark:bg-slate-900/75': !authenticated })}>
- <div className={cx('w-11/12 max-w-7xl mx-auto whitespace-pre-line', { 'px-4 sm:px-6 lg:px-8 py-24': !authenticated })}>
+ <div
+ className={cx('max-w-max whitespace-pre-line', {
+ 'px-4 sm:px-6 lg:px-8 py-24': !authenticated,
+ 'mx-auto': !isBillingPage,
+ })}
+ >
<div className='sm:flex sm:flex-col sm:align-center'>
{!authenticated && (
<>
<h1 className='text-3xl font-extrabold text-gray-900 dark:text-gray-50 sm:text-center'>
{t('pricing.title')}
</h1>
- <p className='mt-5 text-xl text-gray-500 dark:text-gray-200 sm:text-center'>
+ <p className='mt-5 text-xl text-gray-500 dark:text-gray-200 sm:text-center mb-5'>
{t('pricing.adv')}
</p>
</>
)}
- <div className='relative self-center mt-6 bg-gray-100 dark:bg-slate-800 rounded-lg p-0.5 flex sm:mt-8 xs:flex-row flex-col'>
- <button
- type='button'
- onClick={() => setBillingFrequency(BillingFrequency.monthly)}
- className={cx('relative xs:w-1/2 rounded-md shadow-sm py-2 text-sm font-medium whitespace-nowrap sm:w-auto sm:px-8', {
- 'bg-white border-gray-200 text-gray-900 dark:bg-slate-900 dark:border-gray-800 dark:text-gray-50': billingFrequency === BillingFrequency.monthly,
- 'text-gray-700 dark:text-gray-100': billingFrequency === BillingFrequency.yearly,
- })}
- >
- {t('pricing.monthlyBilling')}
- </button>
- <button
- type='button'
- onClick={() => setBillingFrequency(BillingFrequency.yearly)}
- className={cx('ml-0.5 relative xs:w-1/2 border border-transparent rounded-md py-2 text-sm font-medium whitespace-nowrap sm:w-auto sm:px-8', {
- 'text-gray-700 dark:text-gray-100': billingFrequency === BillingFrequency.monthly,
- 'bg-white border-gray-200 text-gray-900 dark:bg-slate-900 dark:border-gray-800 dark:text-gray-50': billingFrequency === BillingFrequency.yearly,
- })}
- >
- {t('pricing.yearlyBilling')}
- </button>
+ <div className='flex justify-between'>
+ <div>
+ <h3 className='text-lg font-medium text-gray-900 dark:text-gray-50 tracking-tight'>
+ {selectedTier.monthlyUsageLimit.toLocaleString('en-US')}
+ </h3>
+ <p className='text-gray-700 dark:text-gray-200'>
+ {t('pricing.eventPerMonth')}
+ </p>
+ </div>
+ <div className='flex justify-center'>
+ <RadioGroup
+ value={billingFrequency}
+ onChange={setBillingFrequency}
+ className='grid grid-cols-2 gap-x-1 rounded-md p-1 text-center text-xs font-semibold leading-5 ring-1 ring-inset ring-gray-200 dark:ring-slate-700'
+ >
+ <RadioGroup.Label className='sr-only'>
+ {t('pricing.frequency')}
+ </RadioGroup.Label>
+ <RadioGroup.Option
+ key={BillingFrequency.monthly}
+ value={BillingFrequency.monthly}
+ className={({ checked }) =>
+ cx(
+ checked ? 'bg-slate-900 dark:bg-indigo-700 text-gray-50' : 'text-gray-500 dark:text-gray-200',
+ 'cursor-pointer rounded-md px-2.5 flex justify-center items-center'
+ )
+ }
+ >
+ <span>
+ {t('pricing.monthlyBilling')}
+ </span>
+ </RadioGroup.Option>
+ <RadioGroup.Option
+ key={BillingFrequency.yearly}
+ value={BillingFrequency.yearly}
+ className={({ checked }) =>
+ cx(
+ checked ? 'bg-slate-900 dark:bg-indigo-700 text-gray-50' : 'text-gray-500 dark:text-gray-200',
+ 'cursor-pointer rounded-md px-2.5 flex justify-center items-center'
+ )
+ }
+ >
+ <span>
+ {t('pricing.yearlyBilling')}
+ </span>
+ </RadioGroup.Option>
+ </RadioGroup>
+ </div>
</div>
</div>
- <div className='mt-6 space-y-4 sm:mt-10 sm:space-y-0 sm:grid sm:grid-cols-2 sm:gap-6 lg:max-w-4xl lg:mx-auto xl:max-w-none xl:mx-0 xl:grid-cols-4'>
- {isNonStandardTier && (
- <PricingItem
- key={user.planCode}
- tier={nonStandardTiers[user.planCode]}
- user={user}
- t={t}
- billingFrequency={billingFrequency}
- onPlanChange={onPlanChange}
- downgrade={false}
- downgradeHandler={downgradeHandler}
- planCodeLoading={planCodeLoading}
- authenticated={authenticated}
- planCodeID={user.planCode}
- userPlancodeID={user.planCode}
- currencyCode={currencyCode}
- />
+ <input
+ type='range'
+ min='0'
+ max={PLAN_CODES_ARRAY.length - 1}
+ value={PLAN_CODES_ARRAY.indexOf(selectedTier.planCode)}
+ className='arrows-handle mt-5 w-full appearance-none bg-gray-200 dark:bg-slate-600 h-2 rounded-full'
+ onChange={onSelectPlanChange}
+ />
+ <div className='mt-5 relative border rounded-2xl shadow-sm divide-y ring-1 ring-gray-200 dark:ring-slate-700'>
+ {user.planCode === selectedTier.planCode && (
+ <div className='absolute left-5 top-0 transform translate-y-px'>
+ <div className='flex justify-center transform -translate-y-1/2'>
+ <span className='inline-flex rounded-full bg-indigo-600 px-4 py-1 text-sm font-semibold tracking-wider uppercase text-white'>
+ {t('pricing.currentPlan')}
+ </span>
+ </div>
+ </div>
)}
- {_map(tiers, (tier) => {
- const planCodeID = _findIndex(tiers, (el) => el.planCode === tier.planCode)
- const downgrade = planCodeID < userPlancodeID
-
- return (
- <PricingItem
- key={tier.planCode}
- tier={tier}
- user={user}
- t={t}
- billingFrequency={billingFrequency}
- onPlanChange={onPlanChange}
- downgrade={downgrade}
- downgradeHandler={downgradeHandler}
- planCodeLoading={planCodeLoading}
- authenticated={authenticated}
- planCodeID={planCodeID}
- userPlancodeID={userPlancodeID}
- currencyCode={currencyCode}
- />
- )
- })}
+ {selectedTier.legacy && (
+ <div className='absolute right-5 top-0 transform translate-y-px'>
+ <div className='flex justify-center transform -translate-y-1/2'>
+ <span className='inline-flex rounded-full bg-amber-400 px-2 py-1 text-sm font-semibold tracking-wider uppercase text-white'>
+ {t('pricing.legacy')}
+ </span>
+ </div>
+ </div>
+ )}
+ <div className='p-6 border-none'>
+ <ClientOnly fallback={<Loader />}>
+ {() => (
+ <div className='flex justify-between'>
+ <p>
+ <span className='text-4xl font-bold text-[#4D4D4D] dark:text-gray-50'>
+ {currency.symbol}
+ {billingFrequency === BillingFrequency.monthly ? selectedTier.price[currencyCode]?.monthly : selectedTier.price[currencyCode]?.yearly}
+ </span>
+ &nbsp;
+ <span className='text-base font-medium text-gray-500 dark:text-gray-400'>
+ /
+ {t(billingFrequency === BillingFrequency.monthly ? 'pricing.perMonth' : 'pricing.perYear')}
+ </span>
+ </p>
+
+ {authenticated ? (
+ <Button
+ onClick={() => downgrade ? downgradeHandler(selectedTier) : onPlanChange(selectedTier)}
+ type='button'
+ loading={planCodeLoading === selectedTier.planCode}
+ disabled={planCodeLoading !== null || (selectedTier.planCode === user.planCode && (user.billingFrequency === billingFrequency || user.planCode === 'free' || user.planCode === 'trial' || user.planCode === 'none'))}
+ primary
+ large
+ >
+ {action}
+ </Button>
+ ) : (
+ <Link
+ className='relative inline-flex select-none items-center border leading-4 font-medium rounded-md px-4 py-2 text-sm shadow-sm text-gray-50 bg-slate-900 hover:bg-slate-700 dark:bg-indigo-700 dark:hover:bg-indigo-800 border-transparent'
+ to={routes.signup}
+ aria-label={t('titles.signup')}
+ >
+ {t('common.getStarted')}
+ </Link>
+ )}
+ </div>
+ )}
+ </ClientOnly>
+ </div>
+ <div className='px-6 border-none'>
+ <hr className='w-full mx-auto border border-gray-300 dark:border-slate-800' />
+ </div>
+ <div className='pt-6 pb-8 px-6 border-none'>
+ <h3 className='text-xs font-medium text-gray-900 dark:text-gray-50 tracking-wide uppercase'>
+ {t('pricing.whatIncl')}
+ </h3>
+ {/* space-y-4 */}
+ <ul className='mt-6 grid grid-cols-2 gap-4'>
+ {_map(planFeatures, (feature) => (
+ <li key={feature} className='flex space-x-3'>
+ <CheckIcon className='flex-shrink-0 h-5 w-5 text-green-500' aria-hidden='true' />
+ <span className='text-sm text-gray-700 dark:text-gray-200'>{feature}</span>
+ </li>
+ ))}
+ </ul>
+ </div>
</div>
+ <p className='text-base text-gray-900 dark:text-gray-50 tracking-tight mt-5'>
+ <Trans
+ // @ts-ignore
+ t={t}
+ i18nKey='billing.contact'
+ values={{
+ amount: 10,
+ }}
+ // @ts-ignore
+ components={{
+ url: <Link to={routes.contact} className='font-semibold leading-6 text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500' aria-label={t('footer.tos')} />,
+ }}
+ />
+ </p>
</div>
<div className='checkout-container' id='checkout-container' />
</div>
diff --git a/app/redux/constants/index.ts b/app/redux/constants/index.ts
index 658690aac..512343d0a 100644
--- a/app/redux/constants/index.ts
+++ b/app/redux/constants/index.ts
@@ -468,10 +468,30 @@ export const BillingFrequency = {
// TODO: Eventually this should be fetched from the API, e.g. GET /config route
export const PLAN_LIMITS = {
+ none: {
+ index: 0, // 'downgrade' or 'upgrade' logic depends on this
+ planCode: 'none',
+ monthlyUsageLimit: 0,
+ legacy: false,
+ price: {
+ USD: {
+ monthly: 0,
+ yearly: 0,
+ },
+ EUR: {
+ monthly: 0,
+ yearly: 0,
+ },
+ GBP: {
+ monthly: 0,
+ yearly: 0,
+ },
+ },
+ },
free: {
+ index: 0, // 'downgrade' or 'upgrade' logic depends on this
+ planCode: 'free',
monthlyUsageLimit: 5000,
- maxProjects: 10,
- maxAlerts: 1,
legacy: true,
price: {
USD: {
@@ -489,9 +509,9 @@ export const PLAN_LIMITS = {
},
},
trial: {
+ index: 0, // 'downgrade' or 'upgrade' logic depends on this
+ planCode: 'trial',
monthlyUsageLimit: 100000,
- maxProjects: 20,
- maxAlerts: 20,
legacy: false,
price: {
USD: {
@@ -509,9 +529,9 @@ export const PLAN_LIMITS = {
},
},
hobby: {
+ index: 1, // 'downgrade' or 'upgrade' logic depends on this
+ planCode: 'hobby',
monthlyUsageLimit: 10000,
- maxProjects: 20,
- maxAlerts: 10,
legacy: false,
price: {
USD: {
@@ -527,11 +547,13 @@ export const PLAN_LIMITS = {
yearly: 40,
},
},
+ pid: 813694, // Plan ID
+ ypid: 813695, // Plan ID - Yearly billing
},
freelancer: {
+ index: 2, // 'downgrade' or 'upgrade' logic depends on this
+ planCode: 'freelancer',
monthlyUsageLimit: 100000,
- maxProjects: 20,
- maxAlerts: 20,
legacy: false,
price: {
USD: {
@@ -547,11 +569,57 @@ export const PLAN_LIMITS = {
yearly: 140,
},
},
+ pid: 752316, // Plan ID
+ ypid: 776469, // Plan ID - Yearly billing
+ },
+ '200k': {
+ index: 3, // 'downgrade' or 'upgrade' logic depends on this
+ planCode: '200k',
+ monthlyUsageLimit: 200000,
+ legacy: false,
+ price: {
+ USD: {
+ monthly: 25,
+ yearly: 250,
+ },
+ EUR: {
+ monthly: 25,
+ yearly: 250,
+ },
+ GBP: {
+ monthly: 23,
+ yearly: 230,
+ },
+ },
+ pid: 854654, // Plan ID
+ ypid: 854655, // Plan ID - Yearly billing
+ },
+ '500k': {
+ index: 4, // 'downgrade' or 'upgrade' logic depends on this
+ planCode: '500k',
+ monthlyUsageLimit: 500000,
+ legacy: false,
+ price: {
+ USD: {
+ monthly: 45,
+ yearly: 450,
+ },
+ EUR: {
+ monthly: 45,
+ yearly: 450,
+ },
+ GBP: {
+ monthly: 40,
+ yearly: 400,
+ },
+ },
+ pid: 854656, // Plan ID
+ ypid: 854657, // Plan ID - Yearly billing
},
startup: {
+ index: 5, // 'downgrade' or 'upgrade' logic depends on this
+ planCode: 'startup',
monthlyUsageLimit: 1000000,
- maxProjects: 30,
- maxAlerts: 50,
legacy: false,
price: {
USD: {
@@ -567,11 +635,35 @@ export const PLAN_LIMITS = {
yearly: 490,
},
},
+ pid: 752317,
+ ypid: 776470,
+ },
+ '2m': {
+ index: 6, // 'downgrade' or 'upgrade' logic depends on this
+ planCode: '2m',
+ monthlyUsageLimit: 2000000,
+ legacy: false,
+ price: {
+ USD: {
+ monthly: 84,
+ yearly: 840,
+ },
+ EUR: {
+ monthly: 84,
+ yearly: 840,
+ },
+ GBP: {
+ monthly: 74,
+ yearly: 740,
+ },
+ },
+ pid: 854663,
+ ypid: 854664,
},
enterprise: {
+ index: 7, // 'downgrade' or 'upgrade' logic depends on this
+ planCode: 'enterprise',
monthlyUsageLimit: 5000000,
- maxProjects: 50,
- maxAlerts: 100,
legacy: false,
price: {
USD: {
@@ -587,9 +679,35 @@ export const PLAN_LIMITS = {
yearly: 950,
},
},
+ pid: 752318,
+ ypid: 776471,
+ },
+ '10m': {
+ index: 8, // 'downgrade' or 'upgrade' logic depends on this
+ planCode: '10m',
+ monthlyUsageLimit: 10000000,
+ legacy: false,
+ price: {
+ USD: {
+ monthly: 150,
+ yearly: 1500,
+ },
+ EUR: {
+ monthly: 150,
+ yearly: 1500,
+ },
+ GBP: {
+ monthly: 130,
+ yearly: 1300,
+ },
+ },
+ pid: 854665,
+ ypid: 854666,
},
}
+export const STANDARD_PLANS = ['hobby', 'freelancer', '200k', '500k', 'startup', '2m', 'enterprise', '10m']
+
export const TRIAL_DAYS: number = 14
export const chartTypes = Object.freeze({
diff --git a/app/routes/billing.tsx b/app/routes/billing.tsx
index 6a2e11015..6ae56cac0 100644
--- a/app/routes/billing.tsx
+++ b/app/routes/billing.tsx
@@ -5,7 +5,7 @@ import type { SitemapFunction } from 'remix-sitemap'
import Billing from 'pages/Billing'
import { isSelfhosted } from 'redux/constants'
-import { isAuthenticated } from 'utils/server'
+import { isAuthenticated, detectTheme } from 'utils/server'
export const sitemap: SitemapFunction = () => ({
exclude: true,
@@ -16,13 +16,14 @@ export async function loader({ request }: LoaderArgs) {
return redirect('/login', 302)
}
+ const [theme] = detectTheme(request)
const isAuth = isAuthenticated(request)
- return json({ isAuth })
+ return json({ isAuth, theme })
}
export default function Index() {
- const { isAuth } = useLoaderData<typeof loader>()
+ const { isAuth, theme } = useLoaderData<typeof loader>()
- return <Billing ssrAuthenticated={isAuth} />
+ return <Billing ssrAuthenticated={isAuth} ssrTheme={theme} />
}
diff --git a/app/styles/index.css b/app/styles/index.css
index bf3d6c32f..0779bde9f 100644
--- a/app/styles/index.css
+++ b/app/styles/index.css
@@ -370,4 +370,37 @@ code {
::-webkit-scrollbar-thumb:hover {
background-color: #6b7280;
-}
\ No newline at end of file
+}
+
+.arrows-handle {
+ appearance: none;
+ -moz-appearance: none;
+ -webkit-appearance: none;
+ cursor: grab;
+}
+
+.arrows-handle::-webkit-slider-thumb {
+ -webkit-appearance: none;
+ appearance: none;
+ width: 30px;
+ height: 30px;
+ border: 0;
+ border-radius: 50%;
+ background-color: #6366f1;
+ background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2212%22%20height%3D%228%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8%20.5v7L12%204zM0%204l4%203.5v-7z%22%20fill%3D%22%23FFFFFF%22%20fill-rule%3D%22nonzero%22%2F%3E%3C%2Fsvg%3E");
+ background-position: center;
+ background-repeat: no-repeat;
+ cursor: grab;
+}
+
+.arrows-handle::-moz-range-thumb {
+ width: 30px;
+ height: 30px;
+ border: 0;
+ border-radius: 50%;
+ background-color: #6366f1;
+ background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2212%22%20height%3D%228%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8%20.5v7L12%204zM0%204l4%203.5v-7z%22%20fill%3D%22%23FFFFFF%22%20fill-rule%3D%22nonzero%22%2F%3E%3C%2Fsvg%3E");
+ background-position: center;
+ background-repeat: no-repeat;
+ cursor: grab;
+}
diff --git a/app/ui/MultiProgress.tsx b/app/ui/MultiProgress.tsx
new file mode 100644
index 000000000..c1c154198
--- /dev/null
+++ b/app/ui/MultiProgress.tsx
@@ -0,0 +1,54 @@
+import React, { memo } from 'react'
+import cx from 'clsx'
+import PropTypes from 'prop-types'
+import _map from 'lodash/map'
+
+interface IProgress {
+ value: number,
+ lightColour: string,
+ darkColour: string,
+}
+
+interface IMultiProgress {
+ progress: IProgress[],
+ theme: 'dark' | 'light',
+ className?: string,
+}
+
+const MultiProgress = ({ progress, theme, className }: IMultiProgress): JSX.Element => (
+ <div
+ className='relative'
+ data-testid='multiprogress'
+ >
+ <div
+ className={cx('overflow-hidden h-5 text-xs flex rounded bg-gray-200 dark:bg-slate-600', className)}
+ >
+ {_map(progress, ({ value, lightColour, darkColour }) => (
+ <div
+ key={`${value}-${lightColour}-${darkColour}`}
+ style={{
+ width: `${value}%`,
+ backgroundColor: theme === 'dark' ? darkColour : lightColour,
+ }}
+ className='shadow-none flex flex-col text-center whitespace-nowrap text-white justify-center'
+ />
+ ))}
+ </div>
+ </div>
+)
+
+MultiProgress.propTypes = {
+ progress: PropTypes.arrayOf(PropTypes.shape({
+ value: PropTypes.number.isRequired,
+ lightColour: PropTypes.string.isRequired,
+ darkColour: PropTypes.string.isRequired,
+ })).isRequired,
+ theme: PropTypes.oneOf(['dark', 'light']).isRequired,
+ className: PropTypes.string,
+}
+
+MultiProgress.defaultProps = {
+ className: '',
+}
+
+export default memo(MultiProgress)
diff --git a/app/ui/Tooltip.tsx b/app/ui/Tooltip.tsx
index cb6c19789..eeaff401b 100644
--- a/app/ui/Tooltip.tsx
+++ b/app/ui/Tooltip.tsx
@@ -12,7 +12,7 @@ interface ITooltip {
const Tooltip = ({
text, className, tooltipNode,
}: ITooltip): JSX.Element => (
- <div className={cx('w-5 h-5 relative flex flex-col group items-center', className)} data-testid='tooltip-wrapper'>
+ <div className={cx('relative flex flex-col group items-center', className)} data-testid='tooltip-wrapper'>
{tooltipNode || (
<QuestionMarkCircleIcon className='w-5 h-5 text-gray-700 dark:text-gray-300' data-testid='tooltip-icon' />
)}
diff --git a/public/locales/en.json b/public/locales/en.json
index 5b55e2ef6..db677645c 100644
--- a/public/locales/en.json
+++ b/public/locales/en.json
@@ -714,7 +714,7 @@
"billing": {
"title": "Billing & Plans",
"desc": "It is free to get started and use our services.\nIf you need to handle more traffic, you probably need to upgrade your plan.\nBelow is a list of available plans. No hidden fees or other BS, everything is clear and transparent!",
- "contact": "Need to track more than {{amount}} million events per month?\nContact us at <mail>{{email}}</mail> to discuss your needs.",
+ "contact": "Do you have more than {{amount}} million events per month? <url>Get in touch</url> to discuss your needs!",
"update": "Update payment details",
"nextBillDate": "Next bill date:",
"nextBillDateIs": "Your next bill date is {{date}}",
@@ -759,7 +759,6 @@
"title": "Pricing Plans",
"adv": "Start out for free, no credit card needed.\nWhen your business grows, you can upgrade your plan at any time.",
"currentPlan": "Current plan",
- "mostPopular": "Most popular",
"free": "Free",
"legacy": "Legacy",
"perMonth": "mo",
@@ -768,9 +767,11 @@
"downgrade": "Downgrade",
"upgrade": "Upgrade",
"whatIncl": "What's included",
- "monthlyBilling": "Monthly billing",
- "yearlyBilling": "Yearly billing",
+ "monthlyBilling": "Monthly",
+ "yearlyBilling": "Yearly",
"switchToMonthly": "Switch to monthly billing",
+ "frequency": "Payment frequency",
+ "eventPerMonth": "Events per month",
"switchToYearly": "Switch to yearly billing",
"xTrialDaysLeft": "{{amount}} trial days left",
"trialEnded": "Trial ended",