downloadbottomsheet

This commit is contained in:
focp212@naver.com
2025-11-07 17:46:06 +09:00
parent 6b6d3cff0e
commit 1bbf90b98e
24 changed files with 485 additions and 368 deletions

View File

@@ -4,11 +4,10 @@ import { SectionTitleArrow } from '@/entities/common/ui/section-title-arrow';
import { CashReceiptReceiptDownloadParams, CashReceiptReceiptDownloadResponse, InfoSectionKeys, InfoSectionProps, TransactionCategory } from '../../model/types';
import { SlideDown } from 'react-slidedown';
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';
import { DownloadBottomSheet, DownloadSelectedMode } from '@/entities/common/ui/download-bottom-sheet';
export const AmountInfoSection = ({
transactionCategory,
@@ -22,7 +21,8 @@ export const AmountInfoSection = ({
const { t } = useTranslation();
const { mutateAsync: cashReceiptReceiptDownload } = useCashReceiptReceiptDownloadMutation();
const [emailBottomSheetOn, setEmailBottomSheetOn] = useState<boolean>(false);
const [downloadBottomSheetOn, setDownloadBottomSheetOn] = 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'},
@@ -187,14 +187,13 @@ export const AmountInfoSection = ({
};
const onClickToOpenDownloadBottomSheet = () => {
setEmailBottomSheetOn(true);
setDownloadBottomSheetOn(true);
};
const onSendRequest = (email?: string) => {
};
const onRequestToDownload = () => {
const onRequestDownload = (
selectedMode: DownloadSelectedMode,
userEmail?: string
) => {
if(!!tid){
let params: CashReceiptReceiptDownloadParams = {
tid: tid
@@ -210,7 +209,7 @@ export const AmountInfoSection = ({
});
}
};
return (
<>
<div className="txn-num-group">
@@ -414,13 +413,15 @@ export const AmountInfoSection = ({
}
</div>
</div>
<EmailBottomSheet
bottomSheetOn={emailBottomSheetOn}
setBottomSheetOn={setEmailBottomSheetOn}
imageMode={true}
emailMode={true}
sendRequest={onSendRequest}
/>
{ !!downloadBottomSheetOn &&
<DownloadBottomSheet
bottomSheetOn={ downloadBottomSheetOn }
setBottomSheetOn={ setDownloadBottomSheetOn }
imageMode={ true }
emailMode={ true }
sendRequest={ onRequestDownload }
></DownloadBottomSheet>
}
</>
);
};