From 971d375a5c9fb664159870ef1907a2206acf94bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Wed, 15 Sep 2021 19:57:22 +0200 Subject: [PATCH] Convert AppWarning to TS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- .../elements/{AppWarning.js => AppWarning.tsx} | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) rename src/components/views/elements/{AppWarning.js => AppWarning.tsx} (60%) diff --git a/src/components/views/elements/AppWarning.js b/src/components/views/elements/AppWarning.tsx similarity index 60% rename from src/components/views/elements/AppWarning.js rename to src/components/views/elements/AppWarning.tsx index 517242dab5..bac486d4b8 100644 --- a/src/components/views/elements/AppWarning.js +++ b/src/components/views/elements/AppWarning.tsx @@ -1,24 +1,20 @@ -import React from 'react'; // eslint-disable-line no-unused-vars -import PropTypes from 'prop-types'; +import React from 'react'; -const AppWarning = (props) => { +interface IProps { + errorMsg?: string; +} + +const AppWarning: React.FC = (props) => { return (
- { props.errorMsg } + { props.errorMsg || "Error" }
); }; -AppWarning.propTypes = { - errorMsg: PropTypes.string, -}; -AppWarning.defaultProps = { - errorMsg: 'Error', -}; - export default AppWarning;