diff options
author | ilyayudovin <ilyayudovin123@gmail.com> | 2020-10-19 00:53:19 +0300 |
---|---|---|
committer | ilyayudovin <ilyayudovin123@gmail.com> | 2020-10-19 00:53:19 +0300 |
commit | a40961a2564738ca9f14d9e50e0d1d5c6ab7ec54 (patch) | |
tree | 62bd85a19a874c65f0261e286efb1f305fe79191 /src/components/ModalScreen | |
parent | cda51156c20c04a20a9fcfe1e0f3aa51f54e9ad2 (diff) | |
download | which-ui-a40961a2564738ca9f14d9e50e0d1d5c6ab7ec54.tar.gz |
feat: Add avatar crop
Diffstat (limited to 'src/components/ModalScreen')
-rw-r--r-- | src/components/ModalScreen/ModalScreen.tsx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/components/ModalScreen/ModalScreen.tsx b/src/components/ModalScreen/ModalScreen.tsx index cf76272..0f2c96f 100644 --- a/src/components/ModalScreen/ModalScreen.tsx +++ b/src/components/ModalScreen/ModalScreen.tsx @@ -49,19 +49,17 @@ const ModalScreen: React.FC<PropTypes> = ({ title, actionIcon, handleAction, isA const isMobile = useMediaQuery(theme.breakpoints.down('sm')); const history = useHistory(); - const handleClose = useCallback(() => setIsOpen(false), [setIsOpen]); - const onExited = useCallback(() => history.goBack(), [history]); + const handleClose = useCallback(() => history.goBack(), [history]); const handleClickAction = useCallback(async () => { if (handleAction) await handleAction(); - return handleClose(); + return window.location.pathname.includes('/profile') ? null : handleClose(); }, [handleAction, handleClose]); return ( <Dialog - open={isOpen} + open={true} onClose={handleClose} - onExited={onExited} TransitionComponent={Transition} PaperProps={{ className: classes.root }} fullScreen={isMobile} |