refactor: reviewer's comment

- use Preact's `FunctionalComponent` instead of React's `FC` to keep the app more lightweight
- remove `@node_modules/` from imports
This commit is contained in:
VardanHakobyan
2021-06-15 12:07:03 +04:00
parent 9092c670c8
commit adfef38bdc
10 changed files with 97 additions and 91 deletions

View File

@@ -1,15 +1,15 @@
import { WebApplication } from '@/ui_models/application';
import { FC } from 'react';
import { FunctionalComponent } from 'preact';
type Props = {
application: WebApplication;
protectionsDisabledUntil: string | null;
};
const Protections: FC<Props> = ({
application,
protectionsDisabledUntil
}) => {
const Protections: FunctionalComponent<Props> = ({
application,
protectionsDisabledUntil
}) => {
const enableProtections = () => {
application.clearProtectionSession();
};
@@ -41,6 +41,6 @@ const Protections: FC<Props> = ({
)}
</div>
);
}
};
export default Protections;