mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
Merge pull request #177 from project-error/feat/bank-enums
Feat(phone): Update to use all enums.
This commit is contained in:
17 files changed
+47
-30
No files matched your search
@@ -6,6 +6,8 @@ import { useSetRecoilState } from 'recoil';
|
||||
import { useBankNotification } from './useBankNotification';
|
||||
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { BankEvents } from '../../../../../typings/bank';
|
||||
import { PhoneEvents } from '../../../../../typings/phone';
|
||||
|
||||
export const useBankService = () => {
|
||||
const setTransaction = useSetRecoilState(bankState.transactions);
|
||||
@@ -21,9 +23,9 @@ export const useBankService = () => {
|
||||
});
|
||||
};
|
||||
|
||||
useNuiEvent('BANK', 'setTransaction', setTransaction);
|
||||
useNuiEvent('BANK', 'setCredentials', setCredentials);
|
||||
useNuiEvent('BANK', 'setAlert', handleAddAlert);
|
||||
useNuiEvent('BANK', 'setNotification', setNotification);
|
||||
useNuiEvent('BANK', BankEvents.SEND_TRANSFERS, setTransaction);
|
||||
useNuiEvent('BANK', BankEvents.SEND_CREDENTIALS, setCredentials);
|
||||
useNuiEvent('BANK', BankEvents.SEND_ALERT, handleAddAlert);
|
||||
useNuiEvent('BANK', BankEvents.SEND_NOTIFICATION, setNotification);
|
||||
return { useTransactions, useCredentials, useBankNotification };
|
||||
};
|
||||
@@ -4,6 +4,7 @@ import { contactsState } from './state';
|
||||
import { useContacts } from './useContacts';
|
||||
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { ContactEvents } from '../../../../../typings/contact';
|
||||
|
||||
export const useContactsService = () => {
|
||||
const setContacts = useSetRecoilState(contactsState.contacts);
|
||||
@@ -17,7 +18,7 @@ export const useContactsService = () => {
|
||||
});
|
||||
};
|
||||
|
||||
useNuiEvent('CONTACTS', 'setContacts', setContacts);
|
||||
useNuiEvent('CONTACTS', 'setAlert', handleAddAlert);
|
||||
useNuiEvent('CONTACTS', ContactEvents.SEND_CONTACTS, setContacts);
|
||||
useNuiEvent('CONTACTS', ContactEvents.SEND_ALERT, handleAddAlert);
|
||||
return useContacts();
|
||||
};
|
||||
@@ -1,8 +1,9 @@
|
||||
import { useSetRecoilState } from 'recoil';
|
||||
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
|
||||
import { dialState } from './state';
|
||||
import { CallEvents } from '../../../../../typings/call';
|
||||
|
||||
export const useDialService = () => {
|
||||
const setHistory = useSetRecoilState(dialState.history);
|
||||
useNuiEvent('DIALER', 'setHistory', setHistory);
|
||||
useNuiEvent('DIALER', CallEvents.SET_CALL_HISTORY, setHistory);
|
||||
};
|
||||
@@ -3,6 +3,7 @@ import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
|
||||
import { noteStates } from './state';
|
||||
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { NotesEvents } from '../../../../../typings/notes';
|
||||
|
||||
export const useNotesService = () => {
|
||||
const { addAlert } = useSnackbar();
|
||||
@@ -16,6 +17,6 @@ export const useNotesService = () => {
|
||||
});
|
||||
};
|
||||
|
||||
useNuiEvent('NOTES', 'setNotes', setNotes);
|
||||
useNuiEvent('NOTES', 'setAlert', handleAddAlert);
|
||||
useNuiEvent('NOTES', NotesEvents.SEND_NOTE, setNotes);
|
||||
useNuiEvent('NOTES', NotesEvents.SEND_ALERT, handleAddAlert);
|
||||
};
|
||||
@@ -4,6 +4,7 @@ import { useListing } from './useListing';
|
||||
import { useSetRecoilState } from 'recoil';
|
||||
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { MarketplaceEvents } from '../../../../../typings/marketplace';
|
||||
|
||||
export const useSelloutService = () => {
|
||||
const setSellout = useSetRecoilState(selloutState.listing);
|
||||
@@ -17,7 +18,7 @@ export const useSelloutService = () => {
|
||||
});
|
||||
};
|
||||
|
||||
useNuiEvent('SELLOUT', 'setAlert', handleAddAlert);
|
||||
useNuiEvent('SELLOUT', 'setListings', setSellout);
|
||||
useNuiEvent('SELLOUT', MarketplaceEvents.SEND_ALERT, handleAddAlert);
|
||||
useNuiEvent('SELLOUT', MarketplaceEvents.SEND_LISTING, setSellout);
|
||||
return useListing();
|
||||
};
|
||||
Reference in new issue
Block a user