From 0644b0f70475644a050c09af771f1040427dfefe Mon Sep 17 00:00:00 2001 From: SilviaAmAm Date: Fri, 3 Nov 2023 16:55:49 +0100 Subject: [PATCH] :recycle: [#467] Refactor more components to use the ErrorMessage component --- src/components/MaintenanceMode.js | 14 ++----------- src/components/auth/AuthenticationOutage.js | 23 +++++++-------------- 2 files changed, 10 insertions(+), 27 deletions(-) diff --git a/src/components/MaintenanceMode.js b/src/components/MaintenanceMode.js index 8b3734e2f..b13933615 100644 --- a/src/components/MaintenanceMode.js +++ b/src/components/MaintenanceMode.js @@ -2,14 +2,11 @@ import PropTypes from 'prop-types'; import React from 'react'; import {FormattedMessage} from 'react-intl'; -import Body from 'components/Body'; import Card from 'components/Card'; -import FAIcon from 'components/FAIcon'; +import ErrorMessage from 'components/Errors/ErrorMessage'; import {IsFormDesigner} from 'headers'; -import {getBEMClassName} from 'utils'; const MaintenanceModeAlert = () => { - const alertClassName = getBEMClassName('alert', ['info']); const userIsFormDesigner = IsFormDesigner.getValue(); let message; @@ -32,14 +29,7 @@ const MaintenanceModeAlert = () => { ); } - return ( -
- - - - {message} -
- ); + return {message}; }; const MaintenanceMode = ({title, asToast = false}) => { diff --git a/src/components/auth/AuthenticationOutage.js b/src/components/auth/AuthenticationOutage.js index ce14c8c41..d467b1d5d 100644 --- a/src/components/auth/AuthenticationOutage.js +++ b/src/components/auth/AuthenticationOutage.js @@ -2,10 +2,8 @@ import PropTypes from 'prop-types'; import React from 'react'; import {FormattedMessage} from 'react-intl'; -import Body from 'components/Body'; -import FAIcon from 'components/FAIcon'; +import ErrorMessage from 'components/Errors/ErrorMessage'; import useQuery from 'hooks/useQuery'; -import {getBEMClassName} from 'utils'; const AUTHENTICATION_OUTAGE_QUERY_PARAM = 'of-auth-problem'; @@ -15,20 +13,15 @@ export const useDetectAuthenticationOutage = () => { }; const AuthenticationOutage = ({loginOption}) => ( -
- - - - - + - -
+ values={{label: loginOption.label}} + /> + ); AuthenticationOutage.propTypes = {