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!

Make panel selectors look like regular buttons

Blue Mousef071e507de2e
diff --git a/web/app/pages/Project/View/Panels.tsx b/web/app/pages/Project/View/Panels.tsx
index d9069814f..1bf00014a 100644
--- a/web/app/pages/Project/View/Panels.tsx
+++ b/web/app/pages/Project/View/Panels.tsx
@@ -141,68 +141,98 @@ const PanelContainer = ({
</h3>
<div className='flex'>
{checkIfBarsNeeded(type) || checkCustomTabs(type, customTabs) ? (
- <AlignJustifyIcon
- className={cx(iconClassName, 'cursor-pointer', {
- 'text-slate-900 dark:text-gray-50': activeFragment === 0,
- 'text-slate-400 dark:text-slate-500': _isString(activeFragment) || activeFragment === 1,
- })}
+ <button
+ type='button'
onClick={() => setActiveFragment(0)}
- strokeWidth={1.5}
- />
+ aria-label='Switch to bar view'
+ className='rounded-md p-1 hover:bg-gray-50 dark:hover:bg-slate-700'
+ >
+ <AlignJustifyIcon
+ className={cx(iconClassName, {
+ 'text-slate-900 dark:text-gray-50': activeFragment === 0,
+ 'text-slate-400 dark:text-slate-500': _isString(activeFragment) || activeFragment === 1,
+ })}
+ strokeWidth={1.5}
+ />
+ </button>
) : null}
{/* if it is a Country tab */}
{type === 'cc' || type === 'rg' || type === 'ct' ? (
<>
- <MapIcon
- className={cx(iconClassName, 'ml-2 cursor-pointer', {
- 'text-slate-900 dark:text-gray-50': activeFragment === 1,
- 'text-slate-400 dark:text-slate-500': _isString(activeFragment) || activeFragment === 0,
- })}
+ <button
+ type='button'
onClick={() => setActiveFragment(1)}
- strokeWidth={1.5}
- />
- <MaximizeIcon
- className={cx(iconClassName, 'ml-2 cursor-pointer text-slate-400 dark:text-slate-500', {
+ aria-label='Switch to map view'
+ className='ml-1 rounded-md p-1 hover:bg-gray-50 dark:hover:bg-slate-700'
+ >
+ <MapIcon
+ className={cx(iconClassName, {
+ 'text-slate-900 dark:text-gray-50': activeFragment === 1,
+ 'text-slate-400 dark:text-slate-500': _isString(activeFragment) || activeFragment === 0,
+ })}
+ strokeWidth={1.5}
+ />
+ </button>
+ <button
+ type='button'
+ onClick={onExpandClick}
+ aria-label='Expand view'
+ className={cx('ml-1 rounded-md p-1 hover:bg-gray-50 dark:hover:bg-slate-700', {
hidden: activeFragment === 0,
})}
- onClick={onExpandClick}
- strokeWidth={1.5}
- />
+ >
+ <MaximizeIcon className={cx(iconClassName, 'text-slate-400 dark:text-slate-500')} strokeWidth={1.5} />
+ </button>
</>
) : null}
{type === 'pg' && activeTab !== PROJECT_TABS.performance && activeTab !== PROJECT_TABS.errors ? (
- <WorkflowIcon
- className={cx(iconClassName, 'ml-2 cursor-pointer', {
- 'text-slate-900 dark:text-gray-50': activeFragment === 1,
- 'text-slate-400 dark:text-slate-500': _isString(activeFragment) || activeFragment === 0,
- })}
+ <button
+ type='button'
onClick={onExpandClick}
- strokeWidth={1.5}
- />
+ aria-label='View user flow'
+ className='ml-1 rounded-md p-1 hover:bg-gray-50 dark:hover:bg-slate-700'
+ >
+ <WorkflowIcon
+ className={cx(iconClassName, {
+ 'text-slate-900 dark:text-gray-50': activeFragment === 1,
+ 'text-slate-400 dark:text-slate-500': _isString(activeFragment) || activeFragment === 0,
+ })}
+ strokeWidth={1.5}
+ />
+ </button>
) : null}
{/* if this tab using Circle showing stats panel */}
{type === 'ce' || type === 'os' || type === 'br' || type === 'dv' ? (
- <ChartPieIcon
- className={cx(iconClassName, 'ml-2 cursor-pointer', {
- 'text-slate-900 dark:text-gray-50': activeFragment === 1,
- 'text-slate-400 dark:text-slate-500': _isString(activeFragment) || activeFragment === 0,
- })}
+ <button
+ type='button'
onClick={() => setActiveFragment(1)}
- strokeWidth={1.5}
- />
+ aria-label='Switch to pie chart view'
+ className='ml-1 rounded-md p-1 hover:bg-gray-50 dark:hover:bg-slate-700'
+ >
+ <ChartPieIcon
+ className={cx(iconClassName, {
+ 'text-slate-900 dark:text-gray-50': activeFragment === 1,
+ 'text-slate-400 dark:text-slate-500': _isString(activeFragment) || activeFragment === 0,
+ })}
+ strokeWidth={1.5}
+ />
+ </button>
) : null}
{/* if it is a 'Custom events' tab */}
{type === 'ce' || type === 'props' ? (
<>
- <MaximizeIcon
- className={cx(iconClassName, 'ml-2 cursor-pointer text-slate-400 dark:text-slate-500')}
+ <button
+ type='button'
onClick={onExpandClick}
- strokeWidth={1.5}
- />
+ aria-label='Expand view'
+ className='ml-1 rounded-md p-1 hover:bg-gray-50 dark:hover:bg-slate-700'
+ >
+ <MaximizeIcon className={cx(iconClassName, 'text-slate-400 dark:text-slate-500')} strokeWidth={1.5} />
+ </button>
</>
) : null}
@@ -219,15 +249,21 @@ const PanelContainer = ({
}
return (
- <PuzzleIcon
+ <button
+ type='button'
key={`${extensionID}-${panelID}`}
- className={cx(iconClassName, 'ml-2 cursor-pointer', {
- 'text-slate-900 dark:text-gray-50': activeFragment === extensionID,
- 'text-slate-400 dark:text-slate-500': activeFragment === 0,
- })}
onClick={onClick}
- strokeWidth={1.5}
- />
+ aria-label='Switch to custom tab'
+ className='ml-1 rounded-md p-1 hover:bg-gray-50 dark:hover:bg-slate-700'
+ >
+ <PuzzleIcon
+ className={cx(iconClassName, {
+ 'text-slate-900 dark:text-gray-50': activeFragment === extensionID,
+ 'text-slate-400 dark:text-slate-500': activeFragment === 0,
+ })}
+ strokeWidth={1.5}
+ />
+ </button>
)
})}
</>
diff --git a/web/app/pages/Project/View/ViewProject.helpers.tsx b/web/app/pages/Project/View/ViewProject.helpers.tsx
index 66e75b528..dda4bb568 100644
--- a/web/app/pages/Project/View/ViewProject.helpers.tsx
+++ b/web/app/pages/Project/View/ViewProject.helpers.tsx
@@ -1418,7 +1418,7 @@ const typeNameMapping = (t: typeof i18next.t) => ({
'ev:value': t('project.metamapping.ev.value'),
})
-const iconClassName = 'w-6 h-6'
+const iconClassName = 'w-5 h-5'
const panelIconMapping = {
cc: <MapPinIcon className={iconClassName} strokeWidth={1.5} />,
pg: <FileTextIcon className={iconClassName} strokeWidth={1.5} />,