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

@@ -10,6 +10,7 @@ import Nui from '../../../../os/nui-events/utils/Nui';
import { SearchContacts } from './SearchContacts';
import { useHistory } from 'react-router-dom';
import LogDebugEvent from '../../../../os/debug/LogDebugEvents';
import { CallEvents } from '../../../../../../typings/call';
export const ContactList = () => {
const { filteredContacts } = useFilteredContacts();
@@ -27,7 +28,7 @@ export const ContactList = () => {
level: 2,
data: true,
});
Nui.send('phone:beginCall', {
Nui.send(CallEvents.INITIALIZE_CALL, {
number,
});
};
@@ -8,6 +8,7 @@ import Nui from '../../../../os/nui-events/utils/Nui';
import ArrowBackIcon from '@material-ui/icons/ArrowBack';
import LogDebugEvent from '../../../../os/debug/LogDebugEvents';
import { useQueryParams } from '../../../../common/hooks/useQueryParams';
import { ContactEvents } from '../../../../../../typings/contact';
interface ContactInfoRouteParams {
mode: string;
@@ -79,7 +80,7 @@ const ContactsInfoPage = () => {
data: contact,
level: 2,
});
Nui.send('phone:addContacts', {
Nui.send(ContactEvents.ADD_CONTACT, {
display: name,
number,
avatar,
@@ -93,7 +94,7 @@ const ContactsInfoPage = () => {
data: contact,
level: 2,
});
Nui.send('phone:updateContact', {
Nui.send(ContactEvents.UPDATE_CONTACT, {
id: contact.id,
display: name,
number,
@@ -108,7 +109,7 @@ const ContactsInfoPage = () => {
data: contact,
level: 2,
});
Nui.send('phone:deleteContact', {
Nui.send(ContactEvents.DELETE_CONTACT, {
id: contact.id,
});
history.goBack();