File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import React , { useCallback , useMemo } from 'react' ;
1+ import React from 'react' ;
22import { useTranslation } from 'react-i18next' ;
33import Button from 'react-bootstrap/Button' ;
44import Modal from 'react-bootstrap/Modal' ;
@@ -22,14 +22,16 @@ const ConfigModal: React.FC<IProps> = observer(({
2222 const { t } = useTranslation ( ) ;
2323 const handleClose = ( ) => setShow ( false ) ;
2424 const { filterStore } = useStore ( ) ;
25+ const { isLoading, isValidAllFilters } = filterStore ;
26+ const isSubmitDisabled = isLoading || ! isValidAllFilters ;
2527
2628 const submitChanges = action ?
2729 < Button
2830 variant = "primary"
2931 onClick = { action }
30- disabled = { filterStore . isLoading || ! filterStore . isValidAllFilters }
32+ disabled = { isSubmitDisabled }
3133 >
32- { filterStore . isLoading ? t ( 'Loading' ) : t ( 'Submit' ) }
34+ { isLoading ? t ( 'Loading' ) : t ( 'Submit' ) }
3335 </ Button >
3436 : null
3537
You can’t perform that action at this time.
0 commit comments