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!

src/modals to ts

kruzhambusc486f6762267
diff --git a/src/modals/Forecast.jsx b/src/modals/Forecast.tsx
similarity index 81%
rename from src/modals/Forecast.jsx
rename to src/modals/Forecast.tsx
index b49b48c37..210d6e251 100644
--- a/src/modals/Forecast.jsx
+++ b/src/modals/Forecast.tsx
@@ -11,12 +11,20 @@ const DEFAULT_PERIOD = 3
const Forecast = ({
onClose, onSubmit, isOpened, activeTB, tb,
-}) => {
- const { t } = useTranslation('common')
- const [period, setPeriod] = useState(DEFAULT_PERIOD)
- const [error, setError] = useState(null)
+}: {
+ onClose: () => void,
+ onSubmit: (period: number) => void,
+ isOpened: boolean,
+ activeTB: string,
+ tb: string,
+}): React.ReactNode => {
+ const { t }: {
+ t: (key: string, options?: { [key: string]: string | number }) => string,
+ } = useTranslation('common')
+ const [period, setPeriod] = useState<string | number>(DEFAULT_PERIOD)
+ const [error, setError] = useState<string | null>(null)
- const handleInput = (e) => {
+ const handleInput = (e: React.ChangeEvent<HTMLInputElement>) => {
const { value } = e.target
setPeriod(value)
diff --git a/src/modals/PaidFeature.jsx b/src/modals/PaidFeature.tsx
similarity index 87%
rename from src/modals/PaidFeature.jsx
rename to src/modals/PaidFeature.tsx
index 23303e964..3cf57aafa 100644
--- a/src/modals/PaidFeature.jsx
+++ b/src/modals/PaidFeature.tsx
@@ -6,7 +6,10 @@ import PropTypes from 'prop-types'
import Modal from 'ui/Modal'
import routes from 'routes'
-const PaidFeature = ({ onClose, isOpened }) => {
+const PaidFeature = ({ onClose, isOpened }: {
+ onClose: () => void,
+ isOpened: boolean,
+}): React.ReactNode => {
const { t } = useTranslation('common')
const history = useHistory()