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!

Merge branch 'main' into fixSingInTooltip

Earth Spirit336fa252e421
diff --cc src/ui/Tooltip.jsx
index 640c0a595,f265aaff4..18dac153d
--- a/src/ui/Tooltip.jsx
+++ b/src/ui/Tooltip.jsx
@@@ -2,46 -2,20 +2,45 @@@ import React, { memo, useEffect, useSta
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' />
- )}
- <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' />
+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',
++ 'w-5 h-5 relative flex flex-col items-center group',
+ className,
+ {
+ 'items-end': language === 'el',
+ 'items-center': language !== 'el',
+ },
- )}
+ >
+ {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([