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!

better timebucket selector UI

Blue Mouse80d8c4e9dedb
diff --git a/web/app/pages/Captcha/View/components/TBPeriodSelector.tsx b/web/app/pages/Captcha/View/components/TBPeriodSelector.tsx
index 4c3b69214..273f2712e 100644
--- a/web/app/pages/Captcha/View/components/TBPeriodSelector.tsx
+++ b/web/app/pages/Captcha/View/components/TBPeriodSelector.tsx
@@ -69,11 +69,11 @@ const TBPeriodSelector = ({
leaveTo='opacity-0 translate-y-1'
>
{/* w-56 */}
- <PopoverPanel className='absolute right-0 left-1/2 z-20 mt-3 w-max max-w-sm -translate-x-1/2 transform px-4 sm:px-0 md:left-auto md:transform-none lg:max-w-3xl'>
+ <PopoverPanel className='absolute right-2.5 z-20 mt-3 w-max max-w-sm transform px-4 font-mono sm:px-0 md:left-auto md:transform-none lg:max-w-3xl'>
<div className='overflow-hidden rounded-lg bg-gray-50 p-1 ring-1 ring-black/5 dark:bg-slate-800'>
<div
className={cx(
- 'relative z-0 mb-1 flex items-center space-x-5 rounded-md bg-slate-200 px-2 py-3 dark:bg-slate-700',
+ 'relative z-0 mb-1 flex items-center space-x-1 rounded-md bg-gray-200 px-1 py-1.5 dark:bg-slate-700/60',
classes?.timeBucket,
)}
>
@@ -88,13 +88,18 @@ const TBPeriodSelector = ({
updateTimebucket(value)
}}
- className={cx('relative inline-flex items-center text-sm font-medium capitalize', {
- 'text-gray-900 dark:text-gray-50': timeBucket === value,
- 'text-gray-700 dark:text-gray-300': available && timeBucket !== value,
- 'text-gray-400 dark:text-gray-500': !available && timeBucket !== value,
- 'cursor-pointer': available,
- 'cursor-default': !available,
- })}
+ className={cx(
+ 'relative inline-flex items-center rounded px-2 py-1.5 text-sm font-medium tracking-tighter capitalize transition-colors duration-150 ease-in-out',
+ {
+ 'bg-gray-50 font-semibold text-gray-900 dark:bg-slate-800 dark:text-gray-50':
+ timeBucket === value,
+ 'text-gray-800 hover:bg-gray-300 dark:text-gray-200 dark:hover:bg-slate-800':
+ available && timeBucket !== value,
+ 'text-gray-400 dark:text-gray-500': !available && timeBucket !== value,
+ 'cursor-pointer': available,
+ 'cursor-not-allowed': !available,
+ },
+ )}
>
{label}
</PopoverButton>