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!

added no sub warning

Blue Mouseac44f792f89e
diff --git a/public/locales/en.json b/public/locales/en.json
index 4da9eaaee..8f3835e01 100644
--- a/public/locales/en.json
+++ b/public/locales/en.json
@@ -581,7 +581,8 @@
"update": "Update payment details",
"nextBillDate": "Next bill date:",
"trialEnds": "Trial ends {{date}}",
- "cancelSub": "Cancel subscription"
+ "cancelSub": "Cancel subscription",
+ "noSubWarning": "You don't have an active subscription.\nNo new analytics data will be stored into our database. You can still view the data that was collected before the subscription was cancelled."
},
"modals": {
"paidFeature": {
diff --git a/src/pages/Billing/index.jsx b/src/pages/Billing/index.jsx
index f594bff47..d61719bd0 100644
--- a/src/pages/Billing/index.jsx
+++ b/src/pages/Billing/index.jsx
@@ -5,6 +5,7 @@ import { useSelector } from 'react-redux'
import dayjs from 'dayjs'
import utc from 'dayjs/plugin/utc'
import duration from 'dayjs/plugin/duration'
+import { ExclamationTriangleIcon } from '@heroicons/react/24/outline'
import { CONTACT_EMAIL, paddleLanguageMapping } from 'redux/constants'
import { withAuthentication, auth } from 'hoc/protected'
@@ -21,22 +22,30 @@ const Billing = () => {
const { theme } = useSelector(state => state.ui.theme)
const { t, i18n: { language } } = useTranslation('common')
const {
- nextBillDate, planCode, subUpdateURL, trialEndDate, timeFormat,
+ nextBillDate, planCode, subUpdateURL, trialEndDate, timeFormat, isPaymentActive,
} = user
const isFree = planCode === 'free'
const isTrial = planCode === 'trial'
- const trialMessage = useMemo(() => {
- if (!trialEndDate || !isTrial) {
- return null
+ const isTrialEnded = useMemo(() => {
+ if (!trialEndDate) {
+ return false
}
const now = dayjs.utc()
const future = dayjs.utc(trialEndDate)
const diff = future.diff(now)
- if (diff < 0) {
+ return diff < 0
+ }, [trialEndDate])
+
+ const trialMessage = useMemo(() => {
+ if (!trialEndDate || !isTrial) {
+ return null
+ }
+
+ if (isTrialEnded) {
return t('pricing.trialEnded')
}
@@ -57,7 +66,7 @@ const Billing = () => {
return t('billing.trialEnds', {
date,
})
- }, [language, trialEndDate, isTrial, timeFormat, t])
+ }, [language, trialEndDate, isTrial, timeFormat, isTrialEnded, t])
const onSubscriptionCancel = () => {
if (!window.Paddle) {
@@ -142,6 +151,14 @@ const Billing = () => {
</span>
</div>
)}
+ {!isPaymentActive && !isFree && isTrialEnded && (
+ <div className='flex items-center text-lg text-gray-900 dark:text-gray-50 tracking-tight'>
+ <ExclamationTriangleIcon className='h-10 w-10 mr-2 text-red-600' aria-hidden='true' />
+ <span className='font-bold max-w-prose'>
+ {t('billing.noSubWarning')}
+ </span>
+ </div>
+ )}
<Pricing t={t} language={language} />
<p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight mt-10'>
<Trans