mirror of
https://github.com/prymitive/karma
synced 2026-05-09 03:36:44 +00:00
chore(ui): migrate more code to typescript
This commit is contained in:
committed by
Łukasz Mierzwa
parent
55170f8812
commit
4d4dd111c1
@@ -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 };
|
||||
17
ui/src/Components/FetchPauser/index.tsx
Normal file
17
ui/src/Components/FetchPauser/index.tsx
Normal 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 };
|
||||
Reference in New Issue
Block a user