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!

redesign profile menu

Blue Mouseb96ce271f005
diff --git a/web/app/components/Header/index.tsx b/web/app/components/Header/index.tsx
index d867934be..72dacfe37 100644
--- a/web/app/components/Header/index.tsx
+++ b/web/app/components/Header/index.tsx
@@ -285,167 +285,141 @@ const ProfileMenu = ({ logoutHandler }: { logoutHandler: () => void }) => {
leaveFrom='transform opacity-100 scale-100'
leaveTo='transform opacity-0 scale-95'
>
- <MenuItems className='absolute right-0 z-30 mt-2 w-60 min-w-max origin-top-right rounded-md bg-white py-1 ring-1 ring-slate-200 focus:outline-hidden dark:bg-slate-900 dark:ring-slate-800'>
- <div className='border-b-[1px] border-gray-200 dark:border-slate-700/50'>
- <MenuItem>
- <p className='truncate px-4 py-2' role='none'>
- <span className='block text-xs text-gray-500 dark:text-gray-300' role='none'>
- {t('header.signedInAs')}
- </span>
- <span className='mt-0.5 text-sm font-semibold text-gray-700 dark:text-gray-50' role='none'>
- {user?.email}
- </span>
- </p>
- </MenuItem>
- </div>
+ <MenuItems className='absolute right-0 z-30 mt-2 w-60 min-w-max origin-top-right rounded-md bg-white p-1 ring-1 ring-slate-200 focus:outline-hidden dark:bg-slate-900 dark:ring-slate-800'>
+ <p className='truncate p-2' role='none'>
+ <span className='block text-xs text-gray-500 dark:text-gray-300' role='none'>
+ {t('header.signedInAs')}
+ </span>
+ <span className='mt-0.5 text-sm font-semibold text-gray-700 dark:text-gray-50' role='none'>
+ {user?.email}
+ </span>
+ </p>
+ <div className='my-0.5 w-full border-b-[1px] border-gray-200 dark:border-slate-700/50' />
- <div className='border-b-[1px] border-gray-200 dark:border-slate-700/50'>
- {/* Language selector */}
- <Disclosure>
- {({ open }) => (
- <>
- <DisclosureButton className='flex w-full justify-between px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:text-gray-50 hover:dark:bg-slate-800'>
- <div className='flex'>
- <Flag
- className='mr-1.5 rounded-xs'
- country={languageFlag[language]}
- size={20}
- alt=''
- aria-hidden='true'
- />
- {languages[language]}
- </div>
- <ChevronDownIcon
- className={cx(
- open ? 'rotate-180' : '',
- '-mr-1 ml-2 h-5 w-5 transform-gpu stroke-2 transition-transform',
- )}
+ {/* Language selector */}
+ <Disclosure>
+ {({ open }) => (
+ <>
+ <DisclosureButton className='flex w-full justify-between rounded-md p-2 text-sm text-gray-700 hover:bg-gray-200 dark:text-gray-50 dark:hover:bg-slate-700'>
+ <div className='flex'>
+ <Flag
+ className='mr-1.5 rounded-xs'
+ country={languageFlag[language]}
+ size={20}
+ alt=''
aria-hidden='true'
/>
- </DisclosureButton>
+ {languages[language]}
+ </div>
+ <ChevronDownIcon
+ className={cx(
+ open ? 'rotate-180' : '',
+ '-mr-1 ml-2 h-5 w-5 transform-gpu stroke-2 transition-transform',
+ )}
+ aria-hidden='true'
+ />
+ </DisclosureButton>
- <Transition
- show={open}
- as={Fragment}
- enter='transition ease-out duration-100'
- enterFrom='transform opacity-0 scale-95'
- enterTo='transform opacity-100 scale-100'
- leave='transition ease-in duration-75'
- leaveFrom='transform opacity-100 scale-100'
- leaveTo='transform opacity-0 scale-95'
+ <Transition
+ show={open}
+ as={Fragment}
+ enter='transition ease-out duration-100'
+ enterFrom='transform opacity-0 scale-95'
+ enterTo='transform opacity-100 scale-100'
+ leave='transition ease-in duration-75'
+ leaveFrom='transform opacity-100 scale-100'
+ leaveTo='transform opacity-0 scale-95'
+ >
+ <DisclosurePanel
+ className='absolute right-0 z-50 w-full min-w-max origin-top-right rounded-md bg-white p-1 ring-1 ring-slate-200 focus:outline-hidden dark:bg-slate-800 dark:ring-slate-800'
+ static
>
- <DisclosurePanel
- className='absolute right-0 z-50 mt-1 w-full min-w-max origin-top-right rounded-md bg-white py-1 ring-1 ring-slate-200 focus:outline-hidden dark:bg-slate-800 dark:ring-slate-800'
- static
- >
- {_map(whitelist, (lng) => (
- <DisclosureButton
- key={lng}
- as='span'
- className='block cursor-pointer px-4 py-2 text-sm text-gray-700 hover:bg-gray-200 dark:bg-slate-800 dark:text-gray-50 dark:hover:bg-gray-600'
- onClick={() => changeLanguage(lng)}
- >
- <div className='flex'>
- <div className='pt-1'>
- <Flag
- className='mr-1.5 rounded-xs'
- country={languageFlag[lng]}
- size={20}
- alt={languageFlag[lng]}
- />
- </div>
- {languages[lng]}
+ {_map(whitelist, (lng) => (
+ <DisclosureButton
+ key={lng}
+ as='span'
+ className='block cursor-pointer rounded-md p-2 text-sm text-gray-700 hover:bg-gray-200 dark:bg-slate-800 dark:text-gray-50 dark:hover:bg-gray-600'
+ onClick={() => changeLanguage(lng)}
+ >
+ <div className='flex'>
+ <div className='pt-1'>
+ <Flag
+ className='mr-1.5 rounded-xs'
+ country={languageFlag[lng]}
+ size={20}
+ alt={languageFlag[lng]}
+ />
</div>
- </DisclosureButton>
- ))}
- </DisclosurePanel>
- </Transition>
- </>
- )}
- </Disclosure>
-
- {isSelfhosted ? (
- <MenuItem>
- {({ active }) => (
- <a
- href={CONTACT_US_URL}
- target='_blank'
- rel='noopener noreferrer'
- className={cx('block px-4 py-2 text-sm text-gray-700 dark:text-gray-50', {
- 'bg-gray-100 dark:bg-slate-800': active,
- })}
- >
- {t('footer.support')}
- </a>
- )}
- </MenuItem>
- ) : (
- <MenuItem>
- {({ active }) => (
- <Link
- to={routes.contact}
- className={cx('block px-4 py-2 text-sm text-gray-700 dark:text-gray-50', {
- 'bg-gray-100 dark:bg-slate-800': active,
- })}
- >
- {t('footer.support')}
- </Link>
- )}
- </MenuItem>
+ {languages[lng]}
+ </div>
+ </DisclosureButton>
+ ))}
+ </DisclosurePanel>
+ </Transition>
+ </>
)}
- {!isSelfhosted ? (
- <MenuItem>
- {({ active }) => (
- <Link
- to={routes.billing}
- className={cx('block px-4 py-2 text-sm text-gray-700 dark:text-gray-50', {
- 'bg-gray-100 dark:bg-slate-800': active,
- })}
- >
- {t('common.billing')}
- </Link>
- )}
- </MenuItem>
- ) : null}
- </div>
+ </Disclosure>
- <MenuItem>
- {({ active }) => (
+ {isSelfhosted ? (
+ <MenuItem>
+ <a
+ href={CONTACT_US_URL}
+ target='_blank'
+ rel='noopener noreferrer'
+ className='block rounded-md p-2 text-sm text-gray-700 hover:bg-gray-200 dark:text-gray-50 dark:hover:bg-slate-700'
+ >
+ {t('footer.support')}
+ </a>
+ </MenuItem>
+ ) : (
+ <MenuItem>
<Link
- to={routes.user_settings}
- className={cx('block px-4 py-2 text-sm text-gray-700 dark:text-gray-50', {
- 'bg-gray-100 dark:bg-slate-800': active,
- })}
+ to={routes.contact}
+ className='block rounded-md p-2 text-sm text-gray-700 hover:bg-gray-200 dark:text-gray-50 dark:hover:bg-slate-700'
>
- {t('common.accountSettings')}
+ {t('footer.support')}
</Link>
- )}
- </MenuItem>
+ </MenuItem>
+ )}
{!isSelfhosted ? (
<MenuItem>
- {({ active }) => (
- <Link
- to={routes.organisations}
- className={cx('block px-4 py-2 text-sm text-gray-700 dark:text-gray-50', {
- 'bg-gray-100 dark:bg-slate-800': active,
- })}
- >
- {t('organisations.organisations')}
- </Link>
- )}
+ <Link
+ to={routes.billing}
+ className='block rounded-md p-2 text-sm text-gray-700 hover:bg-gray-200 dark:text-gray-50 dark:hover:bg-slate-700'
+ >
+ {t('common.billing')}
+ </Link>
</MenuItem>
) : null}
+
+ <div className='my-0.5 w-full border-b-[1px] border-gray-200 dark:border-slate-700/50' />
+
<MenuItem>
- {({ active }) => (
- <p
- className={cx('cursor-pointer px-4 py-2 text-sm text-gray-700 dark:text-gray-50', {
- 'bg-gray-100 dark:bg-slate-800': active,
- })}
- onClick={logoutHandler}
+ <Link
+ to={routes.user_settings}
+ className='block rounded-md p-2 text-sm text-gray-700 hover:bg-gray-200 dark:text-gray-50 dark:hover:bg-slate-700'
+ >
+ {t('common.accountSettings')}
+ </Link>
+ </MenuItem>
+ {!isSelfhosted ? (
+ <MenuItem>
+ <Link
+ to={routes.organisations}
+ className='block rounded-md p-2 text-sm text-gray-700 hover:bg-gray-200 dark:text-gray-50 dark:hover:bg-slate-700'
>
- {t('common.logout')}
- </p>
- )}
+ {t('organisations.organisations')}
+ </Link>
+ </MenuItem>
+ ) : null}
+ <MenuItem>
+ <button
+ type='button'
+ className='w-full rounded-md p-2 text-left text-sm text-gray-700 hover:bg-gray-200 dark:text-gray-50 dark:hover:bg-slate-700'
+ onClick={logoutHandler}
+ >
+ {t('common.logout')}
+ </button>
</MenuItem>
</MenuItems>
</Transition>