diff --git a/src/components/Loader.jsx b/src/components/Loader.tsx similarity index 72% rename from src/components/Loader.jsx rename to src/components/Loader.tsx index 1e527862b..8122f7327 100644 --- a/src/components/Loader.jsx +++ b/src/components/Loader.tsx @@ -1,11 +1,15 @@ -import PropTypes from 'prop-types'; import {FormattedMessage} from 'react-intl'; import {getBEMClassName} from 'utils'; -export const MODIFIERS = ['centered', 'only-child', 'small', 'gray']; +export const MODIFIERS = ['centered', 'only-child', 'small', 'gray'] as const; -const Loader = ({modifiers = [], withoutTranslation}) => { +export interface LoaderProps { + modifiers?: (typeof MODIFIERS)[number][]; + withoutTranslation?: boolean; +} + +const Loader: React.FC = ({modifiers = [], withoutTranslation}) => { const className = getBEMClassName('loading', modifiers); return (
@@ -21,9 +25,4 @@ const Loader = ({modifiers = [], withoutTranslation}) => { ); }; -Loader.propTypes = { - withoutTranslation: PropTypes.bool, - modifiers: PropTypes.arrayOf(PropTypes.oneOf(MODIFIERS)), -}; - export default Loader;