📈 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!
TypeScript chartsclickhousedockergdprgoogle-analyticsmetricsmonitoringmysqlnestjsprivacyredisself-hostedselfhostedstatisticstailwindcssweb-analyticswebanalyticswebsite
Code review fixes
Blue Mouse4e8444c371ae
diff --git a/web/app/pages/Onboarding/Onboarding.tsx b/web/app/pages/Onboarding/Onboarding.tsxindex b6e04d4b3..f1875d64f 100644--- a/web/app/pages/Onboarding/Onboarding.tsx+++ b/web/app/pages/Onboarding/Onboarding.tsx@@ -6,7 +6,6 @@ import {CursorClickIcon,FileTextIcon,ClockIcon,- FolderPlusIcon,InfoIcon,} from '@phosphor-icons/react'import { useState, useEffect, useRef, useCallback } from 'react'diff --git a/web/app/pages/Subscribe/TrialTimeline.tsx b/web/app/pages/Subscribe/TrialTimeline.tsxindex d022a96f0..dc1a6de13 100644--- a/web/app/pages/Subscribe/TrialTimeline.tsx+++ b/web/app/pages/Subscribe/TrialTimeline.tsx@@ -5,7 +5,6 @@ import { TRIAL_DAYS } from '~/lib/constants'import { Text } from '~/ui/Text'import { cn } from '~/utils/generic'-const DAY_MS = 24 * 60 * 60 * 1000const REMINDER_LEAD_DAYS = 2interface TrialStep {@@ -54,7 +53,7 @@ const StepText = ({<Textas='p'size='xs'- colour='muted'+ colour='secondary'className={cn('mt-1 text-pretty', align === 'center' && 'max-w-[20ch]')}>{step.label}@@ -69,17 +68,20 @@ export const TrialTimeline = () => {} = useTranslation('common')const { reminderDate, endDate } = useMemo(() => {- const now = Date.now()+ const now = new Date()+ const reminder = new Date(now)+ const end = new Date(now)const formatter = new Intl.DateTimeFormat(language, {month: 'short',day: 'numeric',})+ reminder.setDate(reminder.getDate() + TRIAL_DAYS - REMINDER_LEAD_DAYS)+ end.setDate(end.getDate() + TRIAL_DAYS)+return {- reminderDate: formatter.format(- new Date(now + (TRIAL_DAYS - REMINDER_LEAD_DAYS) * DAY_MS),- ),- endDate: formatter.format(new Date(now + TRIAL_DAYS * DAY_MS)),+ reminderDate: formatter.format(reminder),+ endDate: formatter.format(end),}}, [language])diff --git a/web/app/ui/TimezonePicker.tsx b/web/app/ui/TimezonePicker.tsxindex 66b77686b..7a8b1a63f 100644--- a/web/app/ui/TimezonePicker.tsx+++ b/web/app/ui/TimezonePicker.tsx@@ -197,10 +197,22 @@ const TimezoneSelect = ({ value, onChange }: TimezoneSelectProps) => {() => new Date(optionsCacheKey + 12 * 60 * 60 * 1000),[optionsCacheKey],)- const options = useMemo(- () => buildOptions(optionsReferenceDate),- [optionsReferenceDate],- )+ const options = useMemo(() => {+ const builtOptions = buildOptions(optionsReferenceDate)+ const customValue = typeof value === 'string' ? value : value.value+ const customOption = customValue+ ? buildCustomOption(customValue, optionsReferenceDate)+ : null++ if (+ !customOption ||+ builtOptions.some((option) => option.value === customOption.value)+ ) {+ return builtOptions+ }++ return [...builtOptions, customOption].sort((a, b) => a.offset - b.offset)+ }, [optionsReferenceDate, value])const keyExtractor = (option: TimezoneOption) => option.valueconst parseTimezone = (diff --git a/web/public/locales/en.json b/web/public/locales/en.jsonindex f6e0ce4db..7694d6dc6 100644--- a/web/public/locales/en.json+++ b/web/public/locales/en.json@@ -3330,8 +3330,8 @@"dueToday": "Due today, after {{days}} free days","next": "Start free trial","selectPlan": "Choose a plan",- "customPlanTitle": "Need more than 20M pageviews?",- "customPlanDesc": "Select \"Up to {{count}} monthly pageviews\" and <contact>contact us</contact> for a custom quote.",+ "customPlanTitle": "Need more than 20M events?",+ "customPlanDesc": "Select \"Up to {{count}} monthly events\" and <contact>contact us</contact> for a custom quote.","trial": {"today": "Today","step1Label": "Your free trial starts with full access",