From 7b883c7ebef2f6e893cc294a3b6270e0abbaaf92 Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Tue, 17 Oct 2023 15:09:23 -0600 Subject: [PATCH] - Updated to use our pre-built modal instead of re-inventing the wheel --- .../components/STTComboBox/STTComboBox.jsx | 52 ++++++++----------- 1 file changed, 21 insertions(+), 31 deletions(-) diff --git a/tdrs-frontend/src/components/STTComboBox/STTComboBox.jsx b/tdrs-frontend/src/components/STTComboBox/STTComboBox.jsx index 266f9d0b8..4f8adf0f2 100644 --- a/tdrs-frontend/src/components/STTComboBox/STTComboBox.jsx +++ b/tdrs-frontend/src/components/STTComboBox/STTComboBox.jsx @@ -4,6 +4,7 @@ import { useDispatch, useSelector } from 'react-redux' import { fetchSttList } from '../../actions/sttList' import ComboBox from '../ComboBox' import Button from '../Button' +import Modal from '../Modal' /** * @param {function} selectStt - Function to reference and change the @@ -15,27 +16,27 @@ import Button from '../Button' */ function STTComboBox({ selectStt, selectedStt, handleBlur, error }) { - const sttReduction = useSelector((state) => state?.stts) + const sttListRequest = useSelector((state) => state?.stts) const dispatch = useDispatch() const [numTries, setNumTries] = useState(0) const [reachedMaxTries, setReachedMaxTries] = useState(false) useEffect(() => { if ( - sttReduction.sttList.length === 0 && + sttListRequest.sttList.length === 0 && numTries <= 3 && - !sttReduction.loading + !sttListRequest.loading ) { dispatch(fetchSttList()) setNumTries(numTries + 1) } else if ( - sttReduction.sttList.length === 0 && + sttListRequest.sttList.length === 0 && numTries > 3 && !reachedMaxTries ) { setReachedMaxTries(true) } - }, [dispatch, sttReduction.sttList, numTries, reachedMaxTries]) + }, [dispatch, sttListRequest.sttList, numTries, reachedMaxTries]) const modalRef = useRef() const headerRef = useRef() @@ -58,37 +59,26 @@ function STTComboBox({ selectStt, selectedStt, handleBlur, error }) { - {sttReduction.sttList.map((stt) => ( + {sttListRequest.sttList.map((stt) => ( ))} -
-
-

- TDP systems are currently experiencing technical difficulties. -

-

- Please sign out and try signing in again. If the issue persists - contact support at tanfdata@acf.hhs.gov. -

-
- -
-
-
+ { + onSignOut() + }, + }, + ]} + /> ) }