bottomsheet

This commit is contained in:
focp212@naver.com
2025-11-07 16:23:49 +09:00
parent 0696c42e62
commit 6b6d3cff0e
24 changed files with 185 additions and 124 deletions

View File

@@ -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}
/>
</>
);
};