bottomsheet
This commit is contained in:
@@ -7,6 +7,8 @@ import 'react-slidedown/lib/slidedown.css';
|
||||
import { showAlert } from '@/widgets/show-alert';
|
||||
import { snackBar } from '@/shared/lib';
|
||||
import { useCashReceiptReceiptDownloadMutation } from '../../api/use-cash-receipt-receipt-download-mutation';
|
||||
import { useState } from 'react';
|
||||
import { EmailBottomSheet } from '@/entities/common/ui/email-bottom-sheet';
|
||||
|
||||
export const AmountInfoSection = ({
|
||||
transactionCategory,
|
||||
@@ -20,7 +22,7 @@ export const AmountInfoSection = ({
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { mutateAsync: cashReceiptReceiptDownload } = useCashReceiptReceiptDownloadMutation();
|
||||
|
||||
const [emailBottomSheetOn, setEmailBottomSheetOn] = useState<boolean>(false);
|
||||
let newAmountInfo: Record<string, any> | undefined = amountInfo;
|
||||
const subItems: Record<string, Record<string, string>> = {
|
||||
mid: {name: t('transaction.fields.mid'), type: 'string'},
|
||||
@@ -184,7 +186,15 @@ export const AmountInfoSection = ({
|
||||
}
|
||||
};
|
||||
|
||||
const onClickToDownload = () => {
|
||||
const onClickToOpenDownloadBottomSheet = () => {
|
||||
setEmailBottomSheetOn(true);
|
||||
};
|
||||
|
||||
const onSendRequest = (email?: string) => {
|
||||
|
||||
};
|
||||
|
||||
const onRequestToDownload = () => {
|
||||
if(!!tid){
|
||||
let params: CashReceiptReceiptDownloadParams = {
|
||||
tid: tid
|
||||
@@ -395,15 +405,22 @@ export const AmountInfoSection = ({
|
||||
<div className="txn-doc">
|
||||
{
|
||||
(transactionCategory === TransactionCategory.CashReceipt) &&
|
||||
!!canDownloadReceipt &&
|
||||
|
||||
<button
|
||||
className="doc-btn"
|
||||
type="button"
|
||||
onClick={ () => onClickToDownload() }
|
||||
onClick={ () => onClickToOpenDownloadBottomSheet() }
|
||||
>{t('transaction.fields.transactionConfirmation')}</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<EmailBottomSheet
|
||||
bottomSheetOn={emailBottomSheetOn}
|
||||
setBottomSheetOn={setEmailBottomSheetOn}
|
||||
imageMode={true}
|
||||
emailMode={true}
|
||||
sendRequest={onSendRequest}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user