feat: add notify by sms .

This commit is contained in:
elforjani13
2021-11-07 20:11:15 +02:00
parent 7706d2992c
commit 4d89f1e0e0
17 changed files with 141 additions and 75 deletions

View File

@@ -1,6 +1,9 @@
import React from 'react';
import { DialogContent } from 'components';
// import { } from 'hooks/query';
import {
useEstimateSMSDetail,
useCreateNotifyEstimateBySMS,
} from 'hooks/query';
const NotifyEstimateViaSMSContext = React.createContext();
@@ -9,16 +12,25 @@ function NotifyEstimateViaSMSFormProvider({
dialogName,
...props
}) {
const { data: estimateSMSDetail, isLoading: isEstimateSMSDetailLoading } =
useEstimateSMSDetail(estimateId, {
enabled: !!estimateId,
});
// Create notfiy estimate by sms mutations.
const { mutateAsync: createNotifyEstimateBySMSMutate } =
useCreateNotifyEstimateBySMS();
// State provider.
const provider = {
estimateId,
dialogName,
estimateSMSDetail,
createNotifyEstimateBySMSMutate,
};
return (
<DialogContent
// isLoading={}
>
<DialogContent isLoading={isEstimateSMSDetailLoading}>
<NotifyEstimateViaSMSContext.Provider value={provider} {...props} />
</DialogContent>
);