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!

(feature) Header solutions tab (#418)

Andrii Romasiund04864b4720f
diff --git a/app/components/Header/index.tsx b/app/components/Header/index.tsx
index b389e5c57..f1c64e138 100644
--- a/app/components/Header/index.tsx
+++ b/app/components/Header/index.tsx
@@ -1,22 +1,34 @@
/* eslint-disable jsx-a11y/anchor-is-valid, react/no-unstable-nested-components */
-import React, { memo, Fragment, useRef, useMemo, MutableRefObject } from 'react'
+import React, { memo, Fragment, useMemo, useState } from 'react'
import { Link } from '@remix-run/react'
import { useDispatch, useSelector } from 'react-redux'
import { useTranslation } from 'react-i18next'
import Flag from 'react-flagkit'
import i18next from 'i18next'
-import { Popover, Transition, Menu } from '@headlessui/react'
-import { Bars3Icon, XMarkIcon, ChevronDownIcon, ArrowSmallRightIcon } from '@heroicons/react/24/outline'
+import { Popover, Transition, Menu, Disclosure, Dialog } from '@headlessui/react'
+import {
+ Bars3Icon,
+ XMarkIcon,
+ ChevronDownIcon,
+ ArrowSmallRightIcon,
+ ChartPieIcon,
+ PlayCircleIcon,
+ PhoneIcon,
+ BoltIcon,
+ FaceSmileIcon,
+ PuzzlePieceIcon,
+} from '@heroicons/react/24/outline'
import { MoonIcon, SunIcon } from '@heroicons/react/24/solid'
import dayjs from 'dayjs'
import utc from 'dayjs/plugin/utc'
import duration from 'dayjs/plugin/duration'
import _map from 'lodash/map'
import _includes from 'lodash/includes'
+import _startsWith from 'lodash/startsWith'
import cx from 'clsx'
-import routesPath from 'routesPath'
+import routes from 'routesPath'
import { authActions } from 'redux/reducers/auth'
import sagaActions from 'redux/sagas/actions'
import UIActions from 'redux/reducers/ui'
@@ -28,6 +40,7 @@ import {
DOCS_URL,
SUPPORTED_THEMES,
isBrowser,
+ CAPTCHA_URL,
} from 'redux/constants'
import Dropdown from 'ui/Dropdown'
import { IUser } from 'redux/models/IUser'
@@ -43,6 +56,127 @@ const TRIAL_STATUS_MAPPING = {
ENDS_IN_X_DAYS: 4,
}
+const getSolutions = (t: typeof i18next.t) => [
+ {
+ name: t('header.solutions.analytics.title'),
+ description: t('header.solutions.analytics.desc'),
+ link: routes.main,
+ icon: ChartPieIcon,
+ },
+ {
+ name: t('header.solutions.performance.title'),
+ description: t('header.solutions.performance.desc'),
+ link: routes.performance,
+ icon: BoltIcon,
+ },
+ {
+ name: t('header.solutions.errors.title'),
+ description: t('header.solutions.errors.desc'),
+ link: routes.errorTracking,
+ icon: FaceSmileIcon,
+ },
+ {
+ name: t('header.solutions.captcha.title'),
+ description: t('header.solutions.captcha.desc'),
+ link: CAPTCHA_URL,
+ icon: PuzzlePieceIcon,
+ },
+]
+
+const getCallsToAction = (t: typeof i18next.t) => [
+ { name: t('header.watchDemo'), link: 'https://www.youtube.com/watch?v=XBp38fZREIE', icon: PlayCircleIcon },
+ { name: t('header.contactSales'), link: routes.contact, icon: PhoneIcon },
+]
+
+const SolutionsMenu = () => {
+ const { t } = useTranslation('common')
+ const solutions = getSolutions(t)
+ const ctas = getCallsToAction(t)
+
+ return (
+ <Popover className='relative'>
+ <Popover.Button className='inline-flex items-center gap-x-1 font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white'>
+ <span>{t('header.solutions.title')}</span>
+ <ChevronDownIcon className='h-3 w-3 stroke-2' aria-hidden='true' />
+ </Popover.Button>
+
+ <Transition
+ as={Fragment}
+ enter='transition ease-out duration-200'
+ enterFrom='opacity-0 translate-y-1'
+ enterTo='opacity-100 translate-y-0'
+ leave='transition ease-in duration-150'
+ leaveFrom='opacity-100 translate-y-0'
+ leaveTo='opacity-0 translate-y-1'
+ >
+ <Popover.Panel className='absolute z-30 mt-5 flex w-screen max-w-max'>
+ <div className='rounded-lg border backdrop-blur-2xl flex flex-col w-[650px] p-[6px] bg-gray-100/80 border-gray-300/80 dark:bg-slate-800/80 dark:border-slate-900/80 divide-y divide-gray-300/80 dark:divide-slate-900/60'>
+ <div className='grid grid-cols-2 p-4 w-full gap-1'>
+ {_map(solutions, (item) => (
+ <div
+ key={item.name}
+ className='group relative flex gap-x-2 rounded-lg p-2 hover:bg-gray-300/50 dark:hover:bg-slate-700/80'
+ >
+ <item.icon className='h-5 w-5 text-gray-600 dark:text-gray-300 mt-1' aria-hidden='true' />
+ <div>
+ {_startsWith(item.link, '/') ? (
+ <Link to={item.link} className='text-sm font-semibold text-gray-900 dark:text-gray-50'>
+ {item.name}
+ <span className='absolute inset-0' />
+ </Link>
+ ) : (
+ <a
+ href={item.link}
+ target='_blank'
+ rel='noopener noreferrer'
+ className='text-sm font-semibold text-gray-900 dark:text-gray-50'
+ >
+ {item.name}
+ <span className='absolute inset-0' />
+ </a>
+ )}
+
+ <p className='text-xs mt-1 text-gray-600 dark:text-neutral-100'>{item.description}</p>
+ </div>
+ </div>
+ ))}
+ </div>
+ <div className='grid grid-cols-2 gap-1 px-4 py-2'>
+ {_map(ctas, (item) => {
+ if (_startsWith(item.link, '/')) {
+ return (
+ <Link
+ key={item.name}
+ to={item.link}
+ className='flex items-center justify-center gap-x-2 rounded-lg p-3 text-gray-800 dark:text-gray-100 hover:bg-gray-300/50 dark:hover:bg-slate-700/80'
+ >
+ <item.icon className='h-5 w-5 flex-none text-gray-400 dark:text-gray-300' aria-hidden='true' />
+ {item.name}
+ </Link>
+ )
+ }
+
+ return (
+ <a
+ key={item.name}
+ href={item.link}
+ target='_blank'
+ rel='noopener noreferrer'
+ className='flex items-center justify-center gap-x-2 rounded-lg p-3 text-gray-800 dark:text-gray-100 hover:bg-gray-300/50 dark:hover:bg-slate-700/80'
+ >
+ <item.icon className='h-5 w-5 flex-none text-gray-400 dark:text-gray-300' aria-hidden='true' />
+ {item.name}
+ </a>
+ )
+ })}
+ </div>
+ </div>
+ </Popover.Panel>
+ </Transition>
+ </Popover>
+ )
+}
+
const ThemeMenu = ({
theme,
t,
@@ -180,7 +314,10 @@ const ProfileMenu = ({
/>
{languages[language]}
</div>
- <ChevronDownIcon className='-mr-1 ml-2 h-5 w-5 stroke-2' aria-hidden='true' />
+ <ChevronDownIcon
+ className={cx(open ? 'rotate-180' : '', '-mr-1 ml-2 h-5 w-5 stroke-2')}
+ aria-hidden='true'
+ />
</Menu.Button>
</div>
@@ -230,7 +367,7 @@ const ProfileMenu = ({
<Menu.Item>
{({ active }) => (
<Link
- to={routesPath.changelog}
+ to={routes.changelog}
className={cx('block px-4 py-2 text-sm text-gray-700 dark:text-gray-50', {
'bg-gray-100 dark:bg-slate-800': active,
})}
@@ -243,7 +380,7 @@ const ProfileMenu = ({
<Menu.Item>
{({ active }) => (
<Link
- to={routesPath.contact}
+ 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,
})}
@@ -256,7 +393,7 @@ const ProfileMenu = ({
<Menu.Item>
{({ active }) => (
<Link
- to={routesPath.billing}
+ 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,
})}
@@ -271,7 +408,7 @@ const ProfileMenu = ({
<Menu.Item>
{({ active }) => (
<Link
- to={routesPath.user_settings}
+ 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,
})}
@@ -304,10 +441,9 @@ const AuthedHeader = ({
onLanguageChange,
rawStatus,
status,
- t,
- language,
logoutHandler,
colourBackground,
+ openMenu,
}: {
user: IUser
switchTheme: (thm?: string) => void
@@ -315,203 +451,26 @@ const AuthedHeader = ({
onLanguageChange: (lng: string) => void
rawStatus: string | number
status: string
- t: (
- key: string,
- options?: {
- [key: string]: string | number | null
- },
- ) => string
- language: string
logoutHandler: () => void
colourBackground: boolean
-}): JSX.Element => (
- <header
- className={cx('relative overflow-x-clip', {
- 'bg-gray-50 dark:bg-slate-900 border-b border-gray-200 dark:border-slate-600/40': colourBackground,
- })}
- >
- <nav className='mx-auto px-4 sm:px-6 lg:px-8' aria-label='Top'>
- <div className='w-full py-4 flex items-center justify-between border-b border-indigo-500 dark:border-slate-600 lg:border-none'>
- <div className='flex items-center'>
- {/* Logo */}
- <Link to={routesPath.main}>
- <span className='sr-only'>Swetrix</span>
- <img
- className='-translate-y-[3px]'
- height='28px'
- width='126.35px'
- src={theme === 'dark' ? '/assets/logo_white.png' : '/assets/logo_blue.png'}
- alt=''
- />
- </Link>
-
- <div className='hidden ml-10 space-x-1 lg:flex gap-4'>
- {user?.planCode === 'trial' && (
- <Link
- to={routesPath.billing}
- className={cx('font-semibold leading-6 text-base', {
- 'text-amber-600 hover:text-amber-500': rawStatus === TRIAL_STATUS_MAPPING.ENDS_IN_X_DAYS,
- 'text-rose-600 hover:text-rose-500':
- rawStatus === TRIAL_STATUS_MAPPING.ENDS_TODAY ||
- rawStatus === TRIAL_STATUS_MAPPING.ENDS_TOMORROW ||
- rawStatus === TRIAL_STATUS_MAPPING.ENDED,
- })}
- key='TrialNotification'
- >
- {status}
- </Link>
- )}
- {user?.planCode === 'none' && (
- <Link
- to={routesPath.billing}
- className='font-semibold leading-6 text-base text-rose-600 hover:text-rose-500'
- key='NoSubscription'
- >
- {t('billing.inactive')}
- </Link>
- )}
- {isSelfhosted ? (
- <a
- href={`https://swetrix.com${routesPath.blog}`}
- target='_blank'
- rel='noopener noreferrer'
- className='font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white'
- >
- {t('footer.blog')}
- </a>
- ) : (
- <Link
- to={routesPath.blog}
- className='font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white'
- >
- {t('footer.blog')}
- </Link>
- )}
- <a
- href={DOCS_URL}
- className='font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white'
- target='_blank'
- rel='noreferrer noopener'
- >
- {t('common.docs')}
- </a>
- <Link
- to={routesPath.dashboard}
- className='font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white'
- >
- {t('common.dashboard')}
- </Link>
- </div>
- </div>
- <div className='hidden md:flex justify-center items-center flex-wrap ml-1 md:ml-10 space-y-1 sm:space-y-0 space-x-2 md:space-x-4'>
- <ThemeMenu theme={theme} switchTheme={switchTheme} t={t} />
- <ProfileMenu
- user={user}
- logoutHandler={logoutHandler}
- onLanguageChange={onLanguageChange}
- language={language}
- t={t}
- />
- </div>
- <div className='md:hidden flex justify-center items-center'>
- {/* Theme switch */}
- {theme === 'dark' ? (
- <div className='transition-all duration-1000 ease-in-out rotate-180'>
- <SunIcon
- onClick={() => switchTheme()}
- className='h-10 w-10 text-gray-200 hover:text-gray-300 cursor-pointer'
- />
- </div>
- ) : (
- <div className='transition-all duration-1000 ease-in-out'>
- <MoonIcon
- onClick={() => switchTheme()}
- className='h-10 w-10 text-slate-700 hover:text-slate-600 cursor-pointer'
- />
- </div>
- )}
- <Popover.Button className='bg-white dark:bg-slate-800 dark:hover:bg-slate-700 dark:text-gray-200 rounded-md p-2 ml-3 inline-flex items-center justify-center text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500'>
- <span className='sr-only'>{t('common.openMenu')}</span>
- <Bars3Icon className='h-6 w-6' aria-hidden='true' />
- </Popover.Button>
- </div>
- </div>
- <div className='py-4 flex gap-4 flex-wrap justify-center space-x-2 lg:hidden'>
- {isSelfhosted ? (
- <a
- href={`https://swetrix.com${routesPath.blog}`}
- target='_blank'
- rel='noopener noreferrer'
- className='font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white'
- >
- {t('footer.blog')}
- </a>
- ) : (
- <Link
- to={routesPath.blog}
- className='font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white'
- >
- {t('footer.blog')}
- </Link>
- )}
- <a
- href={DOCS_URL}
- className='font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white'
- target='_blank'
- rel='noreferrer noopener'
- >
- {t('common.docs')}
- </a>
- <Link
- to={routesPath.dashboard}
- className='font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white'
- >
- {t('common.dashboard')}
- </Link>
- </div>
- </nav>
- </header>
-)
+ openMenu: () => void
+}): JSX.Element => {
+ const {
+ t,
+ i18n: { language },
+ } = useTranslation('common')
-const NotAuthedHeader = ({
- switchTheme,
- theme,
- onLanguageChange,
- t,
- language,
- colourBackground,
- refPage,
-}: {
- switchTheme: (a?: string) => void
- theme: string
- onLanguageChange: (lang: string) => void
- t: (key: string) => string
- language: string
- colourBackground: boolean
- refPage?: boolean
-}) => (
- <header
- className={cx('relative overflow-x-clip', {
- 'bg-gray-50 dark:bg-slate-900 border-b border-gray-200 dark:border-slate-600/40': colourBackground,
- })}
- >
- <nav className='mx-auto px-4 sm:px-6 lg:px-8' aria-label='Top'>
- <div className='w-full py-4 flex items-center justify-between border-b border-indigo-500 dark:border-slate-600 lg:border-none'>
- <div className='flex items-center'>
- {/* Logo */}
- {refPage ? (
- <span>
- <span className='sr-only'>Swetrix</span>
- <img
- className='-translate-y-[3px]'
- height='28px'
- width='126.35px'
- src={theme === 'dark' ? '/assets/logo_white.png' : '/assets/logo_blue.png'}
- alt=''
- />
- </span>
- ) : (
- <Link to={routesPath.main}>
+ return (
+ <header
+ className={cx('relative overflow-x-clip', {
+ 'bg-gray-50 dark:bg-slate-900 border-b border-gray-200 dark:border-slate-600/40': colourBackground,
+ })}
+ >
+ <nav className='mx-auto px-4 sm:px-6 lg:px-8' aria-label='Top'>
+ <div className='w-full py-4 flex items-center justify-between'>
+ <div className='flex items-center'>
+ {/* Logo */}
+ <Link to={routes.main}>
<span className='sr-only'>Swetrix</span>
<img
className='-translate-y-[3px]'
@@ -521,13 +480,36 @@ const NotAuthedHeader = ({
alt=''
/>
</Link>
- )}
- {!refPage && (
- <div className='hidden ml-10 space-x-1 lg:flex gap-4 items-center'>
+ <div className='hidden ml-10 space-x-1 lg:flex gap-4'>
+ {user?.planCode === 'trial' && (
+ <Link
+ to={routes.billing}
+ className={cx('font-semibold leading-6 text-base', {
+ 'text-amber-600 hover:text-amber-500': rawStatus === TRIAL_STATUS_MAPPING.ENDS_IN_X_DAYS,
+ 'text-rose-600 hover:text-rose-500':
+ rawStatus === TRIAL_STATUS_MAPPING.ENDS_TODAY ||
+ rawStatus === TRIAL_STATUS_MAPPING.ENDS_TOMORROW ||
+ rawStatus === TRIAL_STATUS_MAPPING.ENDED,
+ })}
+ key='TrialNotification'
+ >
+ {status}
+ </Link>
+ )}
+ {user?.planCode === 'none' && (
+ <Link
+ to={routes.billing}
+ className='font-semibold leading-6 text-base text-rose-600 hover:text-rose-500'
+ key='NoSubscription'
+ >
+ {t('billing.inactive')}
+ </Link>
+ )}
+ {!isSelfhosted && <SolutionsMenu />}
{isSelfhosted ? (
<a
- href={`https://swetrix.com${routesPath.blog}`}
+ href={`https://swetrix.com${routes.blog}`}
target='_blank'
rel='noopener noreferrer'
className='font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white'
@@ -536,138 +518,239 @@ const NotAuthedHeader = ({
</a>
) : (
<Link
- to={routesPath.blog}
+ to={routes.blog}
className='font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white'
>
{t('footer.blog')}
</Link>
)}
- {!isSelfhosted && (
- <Link
- to={`${routesPath.main}#pricing`}
- className='font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white'
- key='Pricing'
- >
- {t('common.pricing')}
- </Link>
- )}
<a
href={DOCS_URL}
className='font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white'
target='_blank'
rel='noreferrer noopener'
>
- {/* <DocumentTextIcon className='w-5 h-5 mr-1' /> */}
{t('common.docs')}
</a>
+ <Link
+ to={routes.dashboard}
+ className='font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white'
+ >
+ {t('common.dashboard')}
+ </Link>
</div>
- )}
+ </div>
+ <div className='hidden lg:flex justify-center items-center flex-wrap ml-1 lg:ml-10 space-y-1 sm:space-y-0 space-x-2 lg:space-x-4'>
+ <ThemeMenu theme={theme} switchTheme={switchTheme} t={t} />
+ <ProfileMenu
+ user={user}
+ logoutHandler={logoutHandler}
+ onLanguageChange={onLanguageChange}
+ language={language}
+ t={t}
+ />
+ </div>
+ <div className='lg:hidden flex justify-center items-center space-x-3'>
+ {/* Theme switch */}
+ {theme === 'dark' ? (
+ <div className='transition-all duration-1000 ease-in-out rotate-180'>
+ <SunIcon
+ onClick={() => switchTheme()}
+ className='h-8 w-8 text-gray-200 hover:text-gray-300 cursor-pointer'
+ />
+ </div>
+ ) : (
+ <div className='transition-all duration-1000 ease-in-out'>
+ <MoonIcon
+ onClick={() => switchTheme()}
+ className='h-8 w-8 text-slate-700 hover:text-slate-600 cursor-pointer'
+ />
+ </div>
+ )}
+ <button
+ type='button'
+ onClick={openMenu}
+ className='flex items-center gap-x-1 text-sm font-semibold leading-6 text-slate-700 hover:text-slate-600 dark:text-gray-200 dark:hover:text-gray-300'
+ >
+ <span className='sr-only'>{t('common.openMenu')}</span>
+ <Bars3Icon className='h-8 w-8 flex-none' aria-hidden='true' />
+ </button>
+ </div>
</div>
- <div className='hidden md:flex justify-center items-center flex-wrap ml-1 md:ml-10 space-y-1 sm:space-y-0 space-x-2 md:space-x-4'>
- {/* Language selector */}
- <Dropdown
- items={whitelist}
- buttonClassName='!py-0 inline-flex items-center [&>svg]:w-4 [&>svg]:h-4 [&>svg]:mr-0 [&>svg]:ml-1 text-sm font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white'
- selectItemClassName='text-gray-700 block px-4 py-2 text-base cursor-pointer hover:bg-gray-200 dark:text-gray-50 dark:bg-slate-800 dark:hover:bg-slate-700'
- title={
- <>
- <Flag
- className='rounded-sm mr-1.5'
- country={languageFlag[language]}
- size={18}
+ </nav>
+ </header>
+ )
+}
+
+const NotAuthedHeader = ({
+ switchTheme,
+ theme,
+ onLanguageChange,
+ colourBackground,
+ refPage,
+ openMenu,
+}: {
+ switchTheme: (a?: string) => void
+ theme: string
+ onLanguageChange: (lang: string) => void
+ colourBackground: boolean
+ refPage?: boolean
+ openMenu: () => void
+}) => {
+ const {
+ t,
+ i18n: { language },
+ } = useTranslation('common')
+
+ return (
+ <header
+ className={cx('relative overflow-x-clip', {
+ 'bg-gray-50 dark:bg-slate-900 border-b border-gray-200 dark:border-slate-600/40': colourBackground,
+ })}
+ >
+ <nav className='mx-auto px-4 sm:px-6 lg:px-8' aria-label='Top'>
+ <div className='w-full py-4 flex items-center justify-between'>
+ <div className='flex items-center'>
+ {/* Logo */}
+ {refPage ? (
+ <span>
+ <span className='sr-only'>Swetrix</span>
+ <img
+ className='-translate-y-[3px]'
+ height='28px'
+ width='126.35px'
+ src={theme === 'dark' ? '/assets/logo_white.png' : '/assets/logo_blue.png'}
alt=''
- aria-hidden='true'
/>
- {languages[language]}
- </>
- }
- labelExtractor={(lng: string) => (
- <div className='flex'>
- <div className='pt-1'>
- <Flag className='rounded-sm mr-1.5' country={languageFlag[lng]} size={21} alt={languageFlag[lng]} />
+ </span>
+ ) : (
+ <Link to={routes.main}>
+ <span className='sr-only'>Swetrix</span>
+ <img
+ className='-translate-y-[3px]'
+ height='28px'
+ width='126.35px'
+ src={theme === 'dark' ? '/assets/logo_white.png' : '/assets/logo_blue.png'}
+ alt=''
+ />
+ </Link>
+ )}
+
+ {!refPage && (
+ <div className='hidden ml-10 space-x-1 lg:flex gap-4 items-center'>
+ {!isSelfhosted && <SolutionsMenu />}
+ {isSelfhosted ? (
+ <a
+ href={`https://swetrix.com${routes.blog}`}
+ target='_blank'
+ rel='noopener noreferrer'
+ className='font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white'
+ >
+ {t('footer.blog')}
+ </a>
+ ) : (
+ <Link
+ to={routes.blog}
+ className='font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white'
+ >
+ {t('footer.blog')}
+ </Link>
+ )}
+ {!isSelfhosted && (
+ <Link
+ to={`${routes.main}#pricing`}
+ className='font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white'
+ key='Pricing'
+ >
+ {t('common.pricing')}
+ </Link>
+ )}
+ <a
+ href={DOCS_URL}
+ className='font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white'
+ target='_blank'
+ rel='noreferrer noopener'
+ >
+ {/* <DocumentTextIcon className='w-5 h-5 mr-1' /> */}
+ {t('common.docs')}
+ </a>
+ </div>
+ )}
+ </div>
+ <div className='hidden lg:flex justify-center items-center flex-wrap ml-1 lg:ml-10 space-y-1 sm:space-y-0 space-x-2 lg:space-x-4'>
+ {/* Language selector */}
+ <Dropdown
+ items={whitelist}
+ buttonClassName='!py-0 inline-flex items-center [&>svg]:w-4 [&>svg]:h-4 [&>svg]:mr-0 [&>svg]:ml-1 text-sm font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white'
+ selectItemClassName='text-gray-700 block px-4 py-2 text-base cursor-pointer hover:bg-gray-200 dark:text-gray-50 dark:bg-slate-800 dark:hover:bg-slate-700'
+ title={
+ <>
+ <Flag
+ className='rounded-sm mr-1.5'
+ country={languageFlag[language]}
+ size={18}
+ alt=''
+ aria-hidden='true'
+ />
+ {languages[language]}
+ </>
+ }
+ labelExtractor={(lng: string) => (
+ <div className='flex'>
+ <div className='pt-1'>
+ <Flag className='rounded-sm mr-1.5' country={languageFlag[lng]} size={21} alt={languageFlag[lng]} />
+ </div>
+ {languages[lng]}
</div>
- {languages[lng]}
+ )}
+ onSelect={onLanguageChange}
+ headless
+ />
+ <ThemeMenu theme={theme} switchTheme={switchTheme} t={t} />
+ {!refPage && (
+ <>
+ <span className='text-slate-700'>|</span>
+ <Link
+ to={routes.signin}
+ className='flex items-center font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white'
+ >
+ {t('auth.common.signin')}
+ <ArrowSmallRightIcon className='ml-1 stroke-2 h-4 w-4 mt-[1px]' />
+ </Link>
+ </>
+ )}
+ </div>
+ <div className='lg:hidden flex justify-center items-center space-x-3'>
+ {/* Theme switch */}
+ {theme === 'dark' ? (
+ <div className='transition-all duration-1000 ease-in-out rotate-180'>
+ <SunIcon
+ onClick={() => switchTheme()}
+ className='h-8 w-8 text-gray-200 hover:text-gray-300 cursor-pointer'
+ />
+ </div>
+ ) : (
+ <div className='transition-all duration-1000 ease-in-out'>
+ <MoonIcon
+ onClick={() => switchTheme()}
+ className='h-8 w-8 text-slate-700 hover:text-slate-600 cursor-pointer'
+ />
</div>
)}
- onSelect={onLanguageChange}
- headless
- />
- <ThemeMenu theme={theme} switchTheme={switchTheme} t={t} />
- {!refPage && (
- <>
- <span className='text-slate-700'>|</span>
- <Link
- to={routesPath.signin}
- className='flex items-center font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white'
- >
- {t('auth.common.signin')}
- <ArrowSmallRightIcon className='ml-1 stroke-2 h-4 w-4 mt-[1px]' />
- </Link>
- </>
- )}
- </div>
- <div className='md:hidden flex justify-center items-center'>
- {/* Theme switch */}
- {theme === 'dark' ? (
- <div className='transition-all duration-1000 ease-in-out rotate-180'>
- <SunIcon
- onClick={() => switchTheme()}
- className='h-10 w-10 text-gray-200 hover:text-gray-300 cursor-pointer'
- />
- </div>
- ) : (
- <div className='transition-all duration-1000 ease-in-out'>
- <MoonIcon
- onClick={() => switchTheme()}
- className='h-10 w-10 text-slate-700 hover:text-slate-600 cursor-pointer'
- />
- </div>
- )}
- <Popover.Button className='bg-white dark:bg-slate-800 dark:hover:bg-slate-700 dark:text-gray-200 rounded-md p-2 ml-3 inline-flex items-center justify-center text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500'>
- <span className='sr-only'>{t('common.openMenu')}</span>
- <Bars3Icon className='h-6 w-6' aria-hidden='true' />
- </Popover.Button>
- </div>
- </div>
- {!refPage && (
- <div className='py-4 flex gap-4 flex-wrap justify-center space-x-2 lg:hidden'>
- {isSelfhosted ? (
- <a
- href={`https://swetrix.com${routesPath.blog}`}
- target='_blank'
- rel='noopener noreferrer'
- className='font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white'
- >
- {t('footer.blog')}
- </a>
- ) : (
- <Link
- to={routesPath.blog}
- className='flex items-center font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white'
+ <button
+ type='button'
+ onClick={openMenu}
+ className='flex items-center gap-x-1 text-sm font-semibold leading-6 text-slate-700 hover:text-slate-600 dark:text-gray-200 dark:hover:text-gray-300'
>
- {t('footer.blog')}
- </Link>
- )}
- <Link
- to={`${routesPath.main}#pricing`}
- className='flex items-center font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white'
- key='Pricing'
- >
- {t('common.pricing')}
- </Link>
- <a
- href={DOCS_URL}
- className='flex items-center font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white'
- target='_blank'
- rel='noreferrer noopener'
- >
- {t('common.docs')}
- </a>
+ <span className='sr-only'>{t('common.openMenu')}</span>
+ <Bars3Icon className='h-8 w-8 flex-none' aria-hidden='true' />
+ </button>
+ </div>
</div>
- )}
- </nav>
- </header>
-)
+ </nav>
+ </header>
+ )
+}
interface IHeader {
ssrTheme: 'dark' | 'light'
@@ -680,23 +763,16 @@ const Header: React.FC<IHeader> = ({ ssrTheme, authenticated, refPage, transpare
const {
t,
i18n: { language },
- }: {
- t: (
- key: string,
- options?: {
- [key: string]: string | number | null
- },
- ) => string
- i18n: { language: string }
} = useTranslation('common')
const dispatch = useAppDispatch()
const _dispatch = useDispatch()
const { user } = useSelector((state: StateType) => state.auth)
const reduxTheme = useSelector((state: StateType) => state.ui.theme.theme)
- // @ts-ignore
- const buttonRef: MutableRefObject<HTMLButtonElement> = useRef<HTMLButtonElement>()
+ const [mobileMenuOpen, setMobileMenuOpen] = useState(false)
const theme = isBrowser ? reduxTheme : ssrTheme
+ const solutions = getSolutions(t)
+
const [rawStatus, status] = useMemo(() => {
const { trialEndDate } = user || {}
@@ -732,6 +808,7 @@ const Header: React.FC<IHeader> = ({ ssrTheme, authenticated, refPage, transpare
}, [user, t])
const logoutHandler = () => {
+ setMobileMenuOpen(false)
dispatch(authActions.logout())
_dispatch(sagaActions.logout(false, false))
}
@@ -745,6 +822,10 @@ const Header: React.FC<IHeader> = ({ ssrTheme, authenticated, refPage, transpare
i18next.changeLanguage(id)
}
+ const openMenu = () => {
+ setMobileMenuOpen(true)
+ }
+
return (
<Popover className='relative'>
{/* Computer / Laptop / Tablet layout header */}
@@ -757,171 +838,304 @@ const Header: React.FC<IHeader> = ({ ssrTheme, authenticated, refPage, transpare
switchTheme={switchTheme}
theme={theme}
onLanguageChange={onLanguageChange}
- language={language}
colourBackground={!transparent}
- t={t}
+ openMenu={openMenu}
/>
) : (
<NotAuthedHeader
switchTheme={switchTheme}
theme={theme}
onLanguageChange={onLanguageChange}
- language={language}
colourBackground={!transparent}
refPage={refPage}
- t={t}
+ openMenu={openMenu}
/>
)}
{/* Mobile header popup */}
- <Transition
- as={Fragment}
- enter='duration-200 ease-out'
- enterFrom='opacity-0 scale-95'
- enterTo='opacity-100 scale-100'
- leave='duration-100 ease-in'
- leaveFrom='opacity-100 scale-100'
- leaveTo='opacity-0 scale-95'
- >
- <Popover.Panel
- focus
- className='absolute top-0 z-50 inset-x-0 p-2 transition transform origin-top-right md:hidden'
- >
- <div className='rounded-lg shadow-lg ring-1 ring-slate-200 dark:ring-slate-800 bg-white dark:bg-gray-750 divide-y-2 divide-gray-50 dark:divide-gray-800'>
- <div className='pt-5 pb-6 px-5'>
- <div className='flex items-center justify-between'>
- <Link to={routesPath.main}>
- <span className='sr-only'>Swetrix</span>
- <img
- height='28px'
- width='126.35px'
- src={theme === 'dark' ? '/assets/logo_white.png' : '/assets/logo_blue.png'}
- alt=''
+ <Dialog className='lg:hidden' open={mobileMenuOpen} onClose={setMobileMenuOpen}>
+ <div className='fixed inset-0 z-10' />
+ <Dialog.Panel className='fixed top-0 inset-y-0 right-0 z-30 w-full overflow-y-auto p-4 sm:max-w-sm sm:border backdrop-blur-2xl bg-gray-100/80 border-gray-300/80 dark:bg-slate-800/80 dark:border-slate-900/80'>
+ <div className='flex items-center justify-between'>
+ <div>
+ <span className='sr-only'>Swetrix</span>
+ <img
+ className='-translate-y-[3px]'
+ height='28px'
+ width='126.35px'
+ src={theme === 'dark' ? '/assets/logo_white.png' : '/assets/logo_blue.png'}
+ alt=''
+ />
+ </div>
+ <div className='flex justify-center items-center space-x-3'>
+ {/* Theme switch */}
+ {theme === 'dark' ? (
+ <div className='transition-all duration-1000 ease-in-out rotate-180'>
+ <SunIcon
+ onClick={() => switchTheme()}
+ className='h-8 w-8 text-gray-200 hover:text-gray-300 cursor-pointer'
/>
- </Link>
- <Popover.Button
- ref={buttonRef}
- className='bg-white dark:bg-slate-800 dark:hover:bg-slate-700 dark:text-gray-200 rounded-md p-2 inline-flex items-center justify-center text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500'
- >
- <span className='sr-only'>{t('common.closeMenu')}</span>
- <XMarkIcon className='h-6 w-6' aria-hidden='true' />
- </Popover.Button>
- </div>
+ </div>
+ ) : (
+ <div className='transition-all duration-1000 ease-in-out'>
+ <MoonIcon
+ onClick={() => switchTheme()}
+ className='h-8 w-8 text-slate-700 hover:text-slate-600 cursor-pointer'
+ />
+ </div>
+ )}
+ <button
+ type='button'
+ onClick={() => setMobileMenuOpen(false)}
+ className='flex items-center gap-x-1 text-sm font-semibold leading-6 text-slate-700 hover:text-slate-600 dark:text-gray-200 dark:hover:text-gray-300'
+ >
+ <span className='sr-only'>{t('common.openMenu')}</span>
+ <XMarkIcon className='h-8 w-8 flex-none' aria-hidden='true' />
+ </button>
</div>
- <div className='py-6 px-5 space-y-6'>
- <div className='grid grid-cols-1 gap-y-4'>
+ </div>
+ <div className='mt-6 flow-root'>
+ <div className='-my-6 divide-y divide-gray-500/10'>
+ <div className='space-y-2 py-6'>
{/* Language selector */}
- <Dropdown
- items={whitelist}
- buttonClassName='flex items-center w-full rounded-md border border-gray-300 shadow-sm px-3 md:px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-indigo-500 dark:text-gray-50 dark:border-gray-800 dark:bg-slate-800 dark:hover:bg-slate-700'
- selectItemClassName='text-gray-700 block px-4 py-2 text-base cursor-pointer hover:bg-gray-200 dark:text-gray-50 dark:bg-slate-800 dark:hover:bg-slate-700'
- title={
+ <Menu as='div' className='-mx-3'>
+ {({ open }) => (
<>
- <Flag
- className='rounded-sm mr-1.5'
- country={languageFlag[language]}
- size={21}
- alt=''
- aria-hidden='true'
- />
- {languages[language]}
+ <Menu.Button className='flex w-full items-center justify-between rounded-lg py-2 pl-3 pr-3.5 text-base font-semibold leading-7 text-gray-900 dark:text-gray-50 hover:bg-gray-300/50 dark:hover:bg-slate-700/80'>
+ <div className='flex'>
+ <Flag
+ className='rounded-sm mr-1.5'
+ country={languageFlag[language]}
+ size={20}
+ alt=''
+ aria-hidden='true'
+ />
+ {languages[language]}
+ </div>
+ <ChevronDownIcon
+ className={cx(open ? 'rotate-180' : '', 'h-5 w-5 flex-none')}
+ aria-hidden='true'
+ />
+ </Menu.Button>
+
+ <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'
+ >
+ <Menu.Items
+ className='z-50 py-1 origin-top-right absolute right-0 mt-1 w-full min-w-max rounded-md shadow-lg bg-white dark:bg-slate-800 ring-1 ring-slate-200 dark:ring-slate-800 focus:outline-none'
+ static
+ >
+ {_map(whitelist, (lng) => (
+ <Menu.Item key={lng}>
+ <span
+ className='text-gray-700 dark:text-gray-50 dark:bg-slate-800 block px-4 py-2 text-sm cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-600'
+ role='menuitem'
+ tabIndex={0}
+ onClick={() => onLanguageChange(lng)}
+ >
+ <div className='flex'>
+ <div className='pt-1'>
+ <Flag
+ className='rounded-sm mr-1.5'
+ country={languageFlag[lng]}
+ size={20}
+ alt={languageFlag[lng]}
+ />
+ </div>
+ {languages[lng]}
+ </div>
+ </span>
+ </Menu.Item>
+ ))}
+ </Menu.Items>
+ </Transition>
</>
- }
- labelExtractor={(lng: string) => (
- <div className='flex'>
- <div className='pt-1'>
- <Flag
- className='rounded-sm mr-1.5'
- country={languageFlag[lng]}
- size={21}
- alt={languageFlag[lng]}
+ )}
+ </Menu>
+ <Disclosure as='div' className='-mx-3'>
+ {({ open }) => (
+ <>
+ <Disclosure.Button className='flex w-full items-center justify-between rounded-lg py-2 pl-3 pr-3.5 text-base font-semibold leading-7 text-gray-900 dark:text-gray-50 hover:bg-gray-300/50 dark:hover:bg-slate-700/80'>
+ {t('header.solutions.title')}
+ <ChevronDownIcon
+ className={cx(open ? 'rotate-180' : '', 'h-5 w-5 flex-none')}
+ aria-hidden='true'
/>
- </div>
- {languages[lng]}
- </div>
+ </Disclosure.Button>
+ <Disclosure.Panel className='mt-2 space-y-2'>
+ {_map(solutions, (item) => (
+ <Disclosure.Button
+ key={item.name}
+ as='div'
+ className='group relative flex gap-x-2 rounded-lg p-2 hover:bg-gray-300/50 dark:hover:bg-slate-700/80'
+ >
+ <item.icon className='h-5 w-5 text-gray-600 dark:text-gray-300 mt-1' aria-hidden='true' />
+ <div>
+ {_startsWith(item.link, '/') ? (
+ <Link
+ to={item.link}
+ onClick={() => setMobileMenuOpen(false)}
+ className='text-sm font-semibold text-gray-900 dark:text-gray-50'
+ >
+ {item.name}
+ <span className='absolute inset-0' />
+ </Link>
+ ) : (
+ <a
+ href={item.link}
+ onClick={() => setMobileMenuOpen(false)}
+ target='_blank'
+ rel='noopener noreferrer'
+ className='text-sm font-semibold text-gray-900 dark:text-gray-50'
+ >
+ {item.name}
+ <span className='absolute inset-0' />
+ </a>
+ )}
+
+ <p className='text-xs mt-1 text-gray-600 dark:text-neutral-100'>{item.description}</p>
+ </div>
+ </Disclosure.Button>
+ ))}
+ </Disclosure.Panel>
+ </>
)}
- onSelect={onLanguageChange}
- />
+ </Disclosure>
+ {!isSelfhosted && authenticated && user?.planCode === 'trial' && (
+ <Link
+ to={routes.billing}
+ onClick={() => setMobileMenuOpen(false)}
+ className={cx(
+ '-mx-3 block rounded-lg px-3 py-2 text-base font-semibold leading-7 hover:bg-gray-300/50 dark:hover:bg-slate-700/80',
+ {
+ 'text-amber-600': rawStatus === TRIAL_STATUS_MAPPING.ENDS_IN_X_DAYS,
+ 'text-rose-600':
+ rawStatus === TRIAL_STATUS_MAPPING.ENDS_TODAY ||
+ rawStatus === TRIAL_STATUS_MAPPING.ENDS_TOMORROW ||
+ rawStatus === TRIAL_STATUS_MAPPING.ENDED,
+ },
+ )}
+ key='TrialNotification'
+ >
+ {status}
+ </Link>
+ )}
+ {!isSelfhosted && authenticated && user?.planCode === 'none' && (
+ <Link
+ to={routes.billing}
+ onClick={() => setMobileMenuOpen(false)}
+ className='-mx-3 block rounded-lg px-3 py-2 text-base font-semibold leading-7 text-rose-600 hover:bg-gray-300/50 dark:hover:bg-slate-700/80'
+ key='NoSubscription'
+ >
+ {t('billing.inactive')}
+ </Link>
+ )}
+ {!isSelfhosted && authenticated && user?.planCode !== 'none' && user?.planCode !== 'trial' && (
+ <Link
+ to={routes.billing}
+ onClick={() => setMobileMenuOpen(false)}
+ className='-mx-3 block rounded-lg px-3 py-2 text-base font-semibold leading-7 text-gray-900 dark:text-gray-50 hover:bg-gray-300/50 dark:hover:bg-slate-700/80'
+ key='Billing'
+ >
+ {t('common.billing')}
+ </Link>
+ )}
+ {!isSelfhosted && !authenticated && (
+ <Link
+ to={`${routes.main}#pricing`}
+ onClick={() => setMobileMenuOpen(false)}
+ className='-mx-3 block rounded-lg px-3 py-2 text-base font-semibold leading-7 text-gray-900 dark:text-gray-50 hover:bg-gray-300/50 dark:hover:bg-slate-700/80'
+ key='Pricing'
+ >
+ {t('common.pricing')}
+ </Link>
+ )}
+ {isSelfhosted ? (
+ <a
+ onClick={() => setMobileMenuOpen(false)}
+ href={`https://swetrix.com${routes.blog}`}
+ target='_blank'
+ rel='noopener noreferrer'
+ className='-mx-3 block rounded-lg px-3 py-2 text-base font-semibold leading-7 text-gray-900 dark:text-gray-50 hover:bg-gray-300/50 dark:hover:bg-slate-700/80'
+ >
+ {t('footer.blog')}
+ </a>
+ ) : (
+ <Link
+ to={routes.blog}
+ onClick={() => setMobileMenuOpen(false)}
+ className='-mx-3 block rounded-lg px-3 py-2 text-base font-semibold leading-7 text-gray-900 dark:text-gray-50 hover:bg-gray-300/50 dark:hover:bg-slate-700/80'
+ >
+ {t('footer.blog')}
+ </Link>
+ )}
+ <a
+ href={DOCS_URL}
+ onClick={() => setMobileMenuOpen(false)}
+ className='-mx-3 block rounded-lg px-3 py-2 text-base font-semibold leading-7 text-gray-900 dark:text-gray-50 hover:bg-gray-300/50 dark:hover:bg-slate-700/80'
+ target='_blank'
+ rel='noreferrer noopener'
+ >
+ {t('common.docs')}
+ </a>
+ {authenticated && (
+ <Link
+ to={routes.dashboard}
+ onClick={() => setMobileMenuOpen(false)}
+ className='-mx-3 block rounded-lg px-3 py-2 text-base font-semibold leading-7 text-gray-900 dark:text-gray-50 hover:bg-gray-300/50 dark:hover:bg-slate-700/80'
+ >
+ {t('common.dashboard')}
+ </Link>
+ )}
+ </div>
+ <div className='py-6 space-y-2'>
{authenticated ? (
<>
- {user?.planCode === 'trial' && (
- <Link
- to={routesPath.billing}
- className={cx('font-semibold leading-6 text-base text-center', {
- 'text-amber-600 hover:text-amber-500': rawStatus === TRIAL_STATUS_MAPPING.ENDS_IN_X_DAYS,
- 'text-rose-600 hover:text-rose-500':
- rawStatus === TRIAL_STATUS_MAPPING.ENDS_TODAY ||
- rawStatus === TRIAL_STATUS_MAPPING.ENDS_TOMORROW ||
- rawStatus === TRIAL_STATUS_MAPPING.ENDED,
- })}
- key='TrialNotification'
- >
- {status}
- </Link>
- )}
- {user?.planCode === 'none' && (
- <Link
- to={routesPath.billing}
- className='font-semibold leading-6 text-base text-rose-600 hover:text-rose-500'
- key='NoSubscription'
- >
- {t('billing.inactive')}
- </Link>
- )}
- {/* Temporarily put it here until the header is fully redesigned */}
- {!isSelfhosted && user?.planCode !== 'none' && user?.planCode !== 'trial' && (
- <Link
- to={routesPath.billing}
- className='w-full flex items-center justify-center px-4 py-2 border border-transparent rounded-md shadow-sm text-base font-medium text-white bg-indigo-600 hover:bg-indigo-700 dark:text-gray-50 dark:bg-slate-800 dark:hover:bg-slate-700'
- key='Billing'
- >
- {t('common.billing')}
- </Link>
- )}
- <div onClick={() => buttonRef.current?.click()}>
- <Link
- to={routesPath.user_settings}
- className='w-full flex items-center justify-center px-4 py-2 border border-transparent rounded-md shadow-sm text-base font-medium text-white bg-indigo-600 hover:bg-indigo-700 dark:text-gray-50 dark:bg-slate-800 dark:hover:bg-slate-700'
- >
- {t('common.accountSettings')}
- </Link>
- </div>
- <div onClick={() => buttonRef.current?.click()}>
- <Link
- to='#'
- className='w-full flex items-center justify-center px-4 py-2 border border-transparent rounded-md shadow-sm text-base font-medium text-indigo-600 bg-gray-50 hover:bg-indigo-50 dark:text-gray-50 dark:bg-slate-800 dark:hover:bg-slate-700'
- onClick={logoutHandler}
- >
- {t('common.logout')}
- </Link>
- </div>
+ <Link
+ to={routes.user_settings}
+ onClick={() => setMobileMenuOpen(false)}
+ className='-mx-3 block rounded-lg px-3 py-2 text-base font-semibold leading-7 text-gray-900 dark:text-gray-50 hover:bg-gray-300/50 dark:hover:bg-slate-700/80'
+ >
+ {t('common.accountSettings')}
+ </Link>
+ <span
+ className='-mx-3 block rounded-lg px-3 py-2 text-base font-semibold leading-7 text-gray-900 dark:text-gray-50 hover:bg-gray-300/50 dark:hover:bg-slate-700/80'
+ onClick={logoutHandler}
+ >
+ {t('common.logout')}
+ </span>
</>
) : (
<>
- <div onClick={() => buttonRef.current?.click()}>
- <Link
- to={routesPath.signin}
- className='w-full flex items-center justify-center px-4 py-2 border border-transparent rounded-md shadow-sm text-base font-medium text-indigo-600 bg-gray-50 hover:bg-indigo-50'
- >
- {t('auth.common.signin')}
- </Link>
- </div>
- <div onClick={() => buttonRef.current?.click()}>
- <Link
- to={routesPath.signup}
- className='w-full flex items-center justify-center px-4 py-2 border border-transparent rounded-md shadow-sm text-base font-medium text-white bg-indigo-600 hover:bg-indigo-700'
- aria-label={t('titles.signup')}
- >
- {t('common.getStarted')}
- </Link>
- </div>
+ <Link
+ to={routes.signin}
+ onClick={() => setMobileMenuOpen(false)}
+ className='-mx-3 block rounded-lg px-3 py-2 text-base font-semibold leading-7 text-gray-900 dark:text-gray-50 hover:bg-gray-300/50 dark:hover:bg-slate-700/80'
+ >
+ {t('auth.common.signin')}
+ </Link>
+ <Link
+ to={routes.signup}
+ onClick={() => setMobileMenuOpen(false)}
+ className='-mx-3 block rounded-lg px-3 py-2 text-base font-semibold leading-7 text-gray-900 dark:text-gray-50 hover:bg-gray-300/50 dark:hover:bg-slate-700/80'
+ aria-label={t('titles.signup')}
+ >
+ {t('common.getStarted')}
+ </Link>
</>
)}
</div>
</div>
</div>
- </Popover.Panel>
- </Transition>
+ </Dialog.Panel>
+ </Dialog>
</Popover>
)
}
diff --git a/app/pages/Press/index.tsx b/app/pages/Press/index.tsx
index fc613b565..0948dde01 100644
--- a/app/pages/Press/index.tsx
+++ b/app/pages/Press/index.tsx
@@ -77,10 +77,14 @@ const Press = (): JSX.Element => {
<h2 className='text-2xl mt-2 font-bold text-gray-900 dark:text-gray-50 tracking-tight'>{t('press.logos')}</h2>
<div className='grid grid-cols-none sm:grid-cols-2 gap-4 mt-2'>
<div className='dark:bg-gray-100 p-2 rounded-lg backdrop-blur-lg bg-gray-100 '>
- <LogoComponent description={t('press.logo')} logoPNG='/assets/logo_blue.png' textColor='text-black' />
+ <LogoComponent description={t('press.logo')} logoPNG='/assets/logo_blue.png' textColor='text-black' />
</div>
<div className='dark:bg-slate-800 p-2 rounded-lg backdrop-blur-lg bg-slate-800'>
- <LogoComponent description={t('press.logoWhiteText')} logoPNG='/assets/logo_white.png' textColor='text-white' />
+ <LogoComponent
+ description={t('press.logoWhiteText')}
+ logoPNG='/assets/logo_white.png'
+ textColor='text-white'
+ />
</div>
</div>
<div className='grid grid-cols-2 gap-4 mt-8'>
diff --git a/public/locales/en.json b/public/locales/en.json
index e0646d0eb..c62428697 100644
--- a/public/locales/en.json
+++ b/public/locales/en.json
@@ -1023,7 +1023,28 @@
"switchTheme": "Switch theme",
"dark": "Dark",
"light": "Light",
- "signedInAs": "Signed in as"
+ "signedInAs": "Signed in as",
+ "watchDemo": "Watch demo",
+ "contactSales": "Contact sales",
+ "solutions": {
+ "title": "Solutions",
+ "analytics": {
+ "title": "Analytics",
+ "desc": "Monitor your site's traffic with privacy in mind"
+ },
+ "errors": {
+ "title": "Error tracking",
+ "desc": "Deliver bug-free experiences to your users"
+ },
+ "captcha": {
+ "title": "CAPTCHA",
+ "desc": "Protect your site from bots with privacy-focused captcha"
+ },
+ "performance": {
+ "title": "Performance monitoring",
+ "desc": "Analyse your sites key speed metrics"
+ }
+ }
},
"footer": {
"slogan": "The best apps need the best services.",