aboutsummaryrefslogtreecommitdiff
path: root/src/components/ModalScreen/ModalScreen.tsx
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-10-29 23:53:13 +0300
committereug-vs <eug-vs@keemail.me>2020-10-29 23:54:35 +0300
commit3fef7795681c405322aed6e1c876948ebc2cc932 (patch)
treec961340ae0364e189361ff7032377f41756e79c7 /src/components/ModalScreen/ModalScreen.tsx
parente086da62473bf542d972aa53e605926f9af796f5 (diff)
downloadwhich-ui-3fef7795681c405322aed6e1c876948ebc2cc932.tar.gz
refactor: separate ImageCropAreaSelect component
Diffstat (limited to 'src/components/ModalScreen/ModalScreen.tsx')
-rw-r--r--src/components/ModalScreen/ModalScreen.tsx7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/components/ModalScreen/ModalScreen.tsx b/src/components/ModalScreen/ModalScreen.tsx
index 61cf44a..b71c2c8 100644
--- a/src/components/ModalScreen/ModalScreen.tsx
+++ b/src/components/ModalScreen/ModalScreen.tsx
@@ -1,5 +1,4 @@
import React, { useState, useCallback } from 'react';
-import { useHistory } from 'react-router-dom';
import {
AppBar,
Dialog,
@@ -20,7 +19,7 @@ interface PropTypes {
actionIcon?: JSX.Element;
handleAction?: () => void;
isActionDisabled?: boolean;
- handleCloseModal: ()=> void;
+ handleCloseModal?: ()=> void;
}
const useStyles = makeStyles(theme => ({
@@ -48,11 +47,9 @@ const ModalScreen: React.FC<PropTypes> = ({ title, actionIcon, handleAction, isA
const classes = useStyles();
const theme = useTheme();
const isMobile = useMediaQuery(theme.breakpoints.down('sm'));
- const history = useHistory();
-
const handleClose = useCallback(() => setIsOpen(false), [setIsOpen]);
- const onExited = useCallback(handleCloseModal, [history, handleAction]);
+ const onExited = useCallback(() => handleCloseModal && handleCloseModal(), [handleCloseModal]);
const handleClickAction = useCallback(async () => {
if (handleAction) await handleAction();