mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
feat(contacts/nui): alert on actions
This commit is contained in:
1 parent
a415301145
commit
da32d2ca35
4 files changed
+45
-28
No files matched your search
@@ -0,0 +1,8 @@
|
||||
import { useRecoilState } from 'recoil';
|
||||
import { IContactAlert } from '../../../common/interfaces/contact';
|
||||
import { contactsState } from './state';
|
||||
|
||||
export const useContactAlert = (): IContactAlert => {
|
||||
const [alert, setAlert] = useRecoilState(contactsState.contactAlert);
|
||||
return { alert, setAlert };
|
||||
};
|
||||
@@ -1,10 +1,13 @@
|
||||
import { useNuiEvent } from "../../../os/nui-events/hooks/useNuiEvent";
|
||||
import { useSetRecoilState } from "recoil";
|
||||
import { contactsState } from "./state";
|
||||
import { useContacts } from "./useContacts";
|
||||
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
|
||||
import { useSetRecoilState } from 'recoil';
|
||||
import { contactsState } from './state';
|
||||
import { useContacts } from './useContacts';
|
||||
import { useContactAlert } from './useAlert';
|
||||
|
||||
export const useContactsService = () => {
|
||||
const setContacts = useSetRecoilState(contactsState.contacts);
|
||||
useNuiEvent("CONTACTS", "setContacts", setContacts);
|
||||
return useContacts();
|
||||
const setAlert = useSetRecoilState(contactsState.contactAlert);
|
||||
useNuiEvent('CONTACTS', 'setContacts', setContacts);
|
||||
useNuiEvent('CONTACTS', 'setAlert', setAlert);
|
||||
return { useContacts, useContactAlert };
|
||||
};
|
||||
Reference in new issue
Block a user