refactor(events): Events are now tied to a common enum typings (#167)

* chore(scripts/twitter): Refactored twitter to use event enums

* chore(scripts/marketplace): Refactored marketplace to use event enums

* chore(scripts/messages): Refactored messages to use event enums

* chore(scripts/contacts): Refactored contacts to use event enums

* chore(scripts/calls): Refactored calls to use event enums

* chore(scripts/notes): Refactored notes to use event enums

* chore(scripts/photos): Refactored photos to use event enums

* chore(scripts/bank): Refactored bank to use event enums

* chore(scripts/phone): Refactored phone to use event enums

* chore(events): Removed old events object

* refactor(phone/nui-events): Attached NUI events to respective enum

* tweak(event-enums): Added npwd prefix to all events

* tweak(phone/serve): Added craco to override CRA without eject

Also bumped react-scripts to 4.0.1, with seemingly no issues

* fix(typings/twitter): Fixed method enums for twitter
This commit is contained in:
Taso authored and GitHub committed 2021-03-22 13:37:07 -04:00
1 parent 53d5bb459d
commit 0f61088999
62 files changed
+4734 -3470

No files matched your search

+4 -3
View File
@@ -16,6 +16,7 @@ import Nui from '../../../os/nui-events/utils/Nui';
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 classes = useStyles();
@@ -31,14 +32,14 @@ export const NoteModal = () => {
};
const handleNoteSave = () => {
Nui.send('phone:addNote', detail);
Nui.send(NotesEvents.ADD_NOTE, detail);
setDetail(null);
onClose();
};
const handleDeleteNote = () => {
const id = detail.id;
Nui.send('phone:deleteNote', {
Nui.send(NotesEvents.DELETE_NOTE, {
id,
});
setDetail(null);
@@ -46,7 +47,7 @@ export const NoteModal = () => {
};
const handleUpdateNote = () => {
Nui.send('phone:updateNote', detail);
Nui.send(NotesEvents.UPDATE_NOTE, detail);
setDetail(null);
onClose();
};