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!

change no events

kruzhambus81c2b9fcf265
diff --git a/src/pages/Captcha/View/components/NoEvents.jsx b/src/pages/Captcha/View/components/NoEvents.jsx
index b89ef0282..fdf8d110c 100644
--- a/src/pages/Captcha/View/components/NoEvents.jsx
+++ b/src/pages/Captcha/View/components/NoEvents.jsx
@@ -1,15 +1,11 @@
import React, {
- memo, useEffect, useState, useRef,
+ memo,
} from 'react'
import { useTranslation, Trans } from 'react-i18next'
-import Prism from 'prismjs'
-import { ClipboardDocumentIcon } from '@heroicons/react/24/outline'
import _isEmpty from 'lodash/isEmpty'
import PropTypes from 'prop-types'
-import Code from 'ui/Code'
import Button from 'ui/Button'
-import { getUMDBuildExample } from 'pages/Docs/examples'
import { DOCS_URL } from 'redux/constants'
/**
@@ -21,31 +17,9 @@ import { DOCS_URL } from 'redux/constants'
* @returns {JSX.Element}
*/
const NoEvents = ({
- filters, resetFilters, pid,
+ filters, resetFilters,
}) => {
const { t } = useTranslation('common')
- const [copied, setCopied] = useState(false)
- const umdBuildExample = getUMDBuildExample(pid)
-
- const copyTimerRef = useRef(null)
-
- const setToClipboard = (value) => {
- if (!copied) {
- navigator.clipboard.writeText(value)
- setCopied(true)
- copyTimerRef.current = setTimeout(() => {
- setCopied(false)
- }, 2000)
- }
- }
-
- useEffect(() => {
- Prism.highlightAll()
-
- return () => {
- clearTimeout(copyTimerRef.current)
- }
- }, [])
return (
<div className='flex flex-col py-6 sm:px-6 lg:px-8 mt-5'>
@@ -75,32 +49,6 @@ const NoEvents = ({
</Button>
</div>
)}
- {_isEmpty(filters) && (
- <>
- <hr className='mt-3 mb-2 border-gray-200 dark:border-gray-600' />
- <h2 className='text-2xl mb-2 text-center leading-snug'>
- {t('project.codeExample')}
- </h2>
- <div className='relative'>
- <Code text={umdBuildExample} language='html' />
- <div className='absolute top-3 right-5'>
- <Button
- type='button'
- onClick={() => setToClipboard(umdBuildExample)}
- className='opacity-80 hover:opacity-100'
- noBorder
- >
- <ClipboardDocumentIcon className='w-6 h-6 text-gray-100' />
- {copied && (
- <div className='animate-appear cursor-auto rounded p-1 absolute sm:top-0 top-0.5 right-8 text-xs text-green-500'>
- {t('common.copied')}
- </div>
- )}
- </Button>
- </div>
- </div>
- </>
- )}
</div>
</div>
)
@@ -113,7 +61,6 @@ NoEvents.propTypes = {
isExclusive: PropTypes.bool,
})),
resetFilters: PropTypes.func.isRequired,
- pid: PropTypes.string.isRequired,
}
NoEvents.defaultProps = {