mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
Add EMAIL app
This commit is contained in:
1 parent
107dc43624
commit
804c9982b2
13 files changed
+271
-3
No files matched your search
@@ -0,0 +1,9 @@
|
||||
import { atom } from 'recoil';
|
||||
import { IEmail } from '../../../common/typings/email';
|
||||
|
||||
export const emailState = {
|
||||
emails: atom<IEmail[]>({
|
||||
default: null,
|
||||
key: 'EMAIL:emails',
|
||||
}),
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { emailState } from './state';
|
||||
|
||||
export const useEmail = () => {
|
||||
const emails = useRecoilValue(emailState.emails);
|
||||
|
||||
return { emails };
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
import { useSetRecoilState } from 'recoil';
|
||||
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
|
||||
import { emailState } from './state';
|
||||
|
||||
export const useEmailService = () => {
|
||||
const setEmails = useSetRecoilState(emailState.emails);
|
||||
|
||||
useNuiEvent('EMAIL', 'phone:fetchAllEmailsSuccess', setEmails);
|
||||
};
|
||||
Reference in new issue
Block a user