mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 06:28:51 +00:00
fix(phone/notes): Fixed slide transition with notes modal
This commit is contained in:
1 parent
ec4ebdc54d
commit
4b7a6280fd
3 files changed
+6
-20
No files matched your search
@@ -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 />
|
||||
) : (
|
||||
|
||||
Reference in new issue
Block a user