📈 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
fix singin tooltip
kruzhambus409d06481aa2
diff --git a/src/ui/Tooltip.jsx b/src/ui/Tooltip.jsxindex 525d803a5..640c0a595 100644--- a/src/ui/Tooltip.jsx+++ b/src/ui/Tooltip.jsx@@ -1,21 +1,47 @@-import React, { memo } from 'react'+import React, { memo, useEffect, useState } from 'react'import PropTypes from 'prop-types'import { QuestionMarkCircleIcon } from '@heroicons/react/solid'import cx from 'clsx'+import { getItem } from 'utils/localstorage'-const Tooltip = ({ text, className, tooltipNode }) => (- <div className={cx('w-5 h-5 relative flex flex-col items-center group', className)}>- {tooltipNode || (- <QuestionMarkCircleIcon className='w-5 h-5 text-gray-700 dark:text-gray-300' />+const Tooltip = ({+ text, className, tooltipNode,+}) => {+ const [language, setLanguage] = useState(getItem('language'))++ useEffect(() => {+ setLanguage(getItem('language'))+ }, [text])++ return (+ <div className={cx(+ 'w-5 h-5 relative flex flex-col group',+ className,+ {+ 'items-end': language === 'el',+ 'items-center': language !== 'el',+ },)}- <div className='absolute bottom-0 flex-col items-center hidden mb-6 group-hover:flex'>- <span className='opacity-95 relative w-60 z-10 p-2 text-xs leading-none text-white whitespace-no-wrap bg-gray-700 shadow-lg rounded-md'>- {text}- </span>- <div className='w-3 h-3 -mt-2 rotate-45 bg-gray-700 opacity-95' />+ >+ {tooltipNode || (+ <QuestionMarkCircleIcon className='w-5 h-5 text-gray-700 dark:text-gray-300' />+ )}+ <div className={cx('absolute bottom-0 flex-col mb-6 hidden group-hover:flex', {+ 'items-end': language === 'el',+ 'items-center': language !== 'el',+ })}+ >+ <span className='relative w-60 z-10 p-2 text-xs leading-none text-white whitespace-no-wrap bg-gray-700 shadow-lg rounded-md'>+ {text}+ </span>+ <div className={cx('w-3 h-3 -mt-2 rotate-45 bg-gray-700', {+ 'mr-1': language === 'el',+ })}+ />+ </div></div>- </div>-)+ )+}Tooltip.propTypes = {text: PropTypes.oneOfType([