chore(ui): migrate more code to typescript

This commit is contained in:
Łukasz Mierzwa
2020-06-29 16:14:53 +01:00
committed by Łukasz Mierzwa
parent 55170f8812
commit 4d4dd111c1
36 changed files with 392 additions and 205 deletions

View File

@@ -1,19 +0,0 @@
import { useEffect } from "react";
import PropTypes from "prop-types";
import { AlertStore } from "Stores/AlertStore";
const FetchPauser = ({ children, alertStore }) => {
useEffect(() => {
alertStore.status.pause();
return alertStore.status.resume;
}, [alertStore.status]);
return children;
};
FetchPauser.propTypes = {
children: PropTypes.any,
alertStore: PropTypes.instanceOf(AlertStore).isRequired,
};
export { FetchPauser };

View File

@@ -0,0 +1,17 @@
import { FC, ReactElement, useEffect } from "react";
import { AlertStore } from "Stores/AlertStore";
const FetchPauser: FC<{
children: ReactElement;
alertStore: AlertStore;
}> = ({ children, alertStore }) => {
useEffect(() => {
alertStore.status.pause();
return alertStore.status.resume;
}, [alertStore.status]);
return children;
};
export { FetchPauser };