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!

last fix

kruzhambus0cf902edca2a
diff --git a/src/ui/Tooltip.jsx b/src/ui/Tooltip.jsx
index 9dbcff9c6..a0dbede16 100644
--- a/src/ui/Tooltip.jsx
+++ b/src/ui/Tooltip.jsx
@@ -1,47 +1,23 @@
-import React, { memo, useEffect, useState } from 'react'
+import React, { memo } 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,
-}) => {
- const [language, setLanguage] = useState(getItem('language'))
-
- useEffect(() => {
- setLanguage(getItem('language'))
- }, [text])
-
- return (
- <div className={cx(
- 'w-5 h-5 relative flex flex-col items-center group',
- className,
- {
- 'items-end': language === 'el',
- 'items-center': language !== 'el',
- },
- )}
- >
- {tooltipNode || (
+}) => (
+ <div className={cx('w-5 h-5 relative flex flex-col group items-end', className)}>
+ {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 className='absolute bottom-0 right-0 flex-col mb-6 hidden group-hover:flex items-end'>
+ <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='mr-1 w-3 h-3 -mt-2 rotate-45 bg-gray-700' />
</div>
- )
-}
+ </div>
+)
Tooltip.propTypes = {
text: PropTypes.oneOfType([