mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-14 11:50:31 +00:00
feat: add transactions locking.
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import React from 'react';
|
||||
import { DialogContent } from 'components';
|
||||
import { useCreateLockingTransactoin } from 'hooks/query';
|
||||
|
||||
const LockingTransactionsContext = React.createContext();
|
||||
|
||||
/**
|
||||
* Locking transactions form provider.
|
||||
*/
|
||||
function LockingTransactionsFormProvider({ dialogName, ...props }) {
|
||||
|
||||
// Create locking transactions mutations.
|
||||
const { mutateAsync: createLockingTransactionMutate } =
|
||||
useCreateLockingTransactoin();
|
||||
|
||||
// State provider.
|
||||
const provider = {
|
||||
dialogName,
|
||||
createLockingTransactionMutate,
|
||||
};
|
||||
return (
|
||||
<DialogContent>
|
||||
<LockingTransactionsContext.Provider value={provider} {...props} />
|
||||
</DialogContent>
|
||||
);
|
||||
}
|
||||
|
||||
const useLockingTransactionsContext = () =>
|
||||
React.useContext(LockingTransactionsContext);
|
||||
|
||||
export { LockingTransactionsFormProvider, useLockingTransactionsContext };
|
||||
Reference in New Issue
Block a user