fix(phone/notes): Fixed slide transition with notes modal

This commit is contained in:
Taso committed 2021-04-19 13:15:55 -04:00
1 parent ec4ebdc54d
commit 4b7a6280fd
3 files changed
+6 -20

No files matched your search

+2 -10
View File
@@ -14,28 +14,22 @@ import { useNoteDetail } from '../hooks/useNoteDetail';
import useStyles from './modal.styles';
import { useNuiRequest } from 'fivem-nui-react-lib';
import { useTranslation } from 'react-i18next';
import { useHistory } from 'react-router-dom';
import { StatusButton } from '../../../ui/components/StatusButton';
import { NotesEvents } from '../../../../../typings/notes';
export const NoteModal = () => {
const Nui = useNuiRequest();
const classes = useStyles();
const history = useHistory();
const { t } = useTranslation();
const { detail, setDetail } = useNoteDetail();
const onClose = () => history.goBack();
const _handleClose = () => {
setDetail(null);
onClose();
};
const handleNoteSave = () => {
Nui.send(NotesEvents.ADD_NOTE, detail);
setDetail(null);
onClose();
};
const handleDeleteNote = () => {
@@ -44,18 +38,16 @@ export const NoteModal = () => {
id,
});
setDetail(null);
onClose();
};
const handleUpdateNote = () => {
Nui.send(NotesEvents.UPDATE_NOTE, detail);
setDetail(null);
onClose();
};
return (
<Slide direction="left" in={!!detail}>
<Paper className={classes.modalRoot}>
<Slide direction="left" in={!!detail} mountOnEnter unmountOnExit>
<Paper className={classes.modalRoot} square>
{!detail ? (
<CircularProgress />
) : (