mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-03 22:16:54 +00:00
feat(bank/nui): new state for alert
This commit is contained in:
1 parent
d238e2a612
commit
e17f9211f5
3 files changed
+6
-19
No files matched your search
@@ -1,16 +0,0 @@
|
||||
import React from 'react'
|
||||
import Alert from '@material-ui/lab/Alert';
|
||||
import Notification from '../../../../ui/components/Notification';
|
||||
import { useBankAlert } from './../../hooks/useBankAlert';
|
||||
|
||||
export const BankNotification = ({ alert }) => {
|
||||
const { setBankAlert } = useBankAlert();
|
||||
|
||||
const handleClose = () => {
|
||||
setBankAlert(false)
|
||||
}
|
||||
|
||||
return (
|
||||
<div></div>
|
||||
)
|
||||
}
|
||||
@@ -11,10 +11,10 @@ export const bankState = {
|
||||
}),
|
||||
bankAlert: atom({
|
||||
key: 'bankAlert',
|
||||
default: false
|
||||
default: null
|
||||
}),
|
||||
bankCredentials: atom({
|
||||
key: 'bankCredentails',
|
||||
default: null
|
||||
})
|
||||
}),
|
||||
}
|
||||
@@ -2,12 +2,15 @@ import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
|
||||
import { bankState } from './state';
|
||||
import { useTransactions } from './useTransactions'
|
||||
import { useCredentials } from './useCredentials';
|
||||
import { useBankAlert } from './useBankAlert';
|
||||
import { useSetRecoilState } from 'recoil'
|
||||
|
||||
export const useBankService = () => {
|
||||
const setTransaction = useSetRecoilState(bankState.transactions)
|
||||
const setCredentials = useSetRecoilState(bankState.bankCredentials)
|
||||
const setAlertMessage = useSetRecoilState(bankState.bankAlert)
|
||||
useNuiEvent('BANK', 'setTransaction', setTransaction);
|
||||
useNuiEvent('BANK', 'setCredentials', setCredentials)
|
||||
return {useTransactions, useCredentials};
|
||||
useNuiEvent('BANK', 'setAlert', setAlertMessage)
|
||||
return {useTransactions, useCredentials, useBankAlert};
|
||||
}
|
||||
Reference in new issue
Block a user