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

@@ -24,7 +24,7 @@ import {
import { useEscrowMailResendMutation } from '@/entities/transaction/api/use-escrow-mail-resend-mutation';
import { MerchantInfoSection } from '@/entities/transaction/ui/section/merchant-info-section';
import { AmountInfoSection } from '@/entities/transaction/ui/section/amount-info-section';
import { EmailBottomSheet } from '@/entities/common/ui/email-bottom-sheet';
import { DownloadBottomSheet, DownloadSelectedMode } from '@/entities/common/ui/download-bottom-sheet';
import { DetailMotionDuration, DetailMotionStyle, DetailMotionVariants } from '@/entities/common/model/constant';
import { FullMenuClose } from '@/entities/common/ui/full-menu-close';
import { checkGrant } from '@/shared/lib/check-grant';
@@ -65,7 +65,7 @@ export const EscrowDetail = ({
const [showSettlementInfo, setShowSettlementInfo] = useState<boolean>(false);
const [showMerchantInfo, setShowMerchantInfo] = useState<boolean>(false);
const [bottomSheetOn, setBottomSheetOn] = useState<boolean>(false);
const [downloadBottomSheetOn, setDownloadBottomSheetOn] = useState<boolean>(false);
const [orderNumber, setOrderNumber] = useState<string>();
@@ -102,14 +102,17 @@ export const EscrowDetail = ({
const onClickToShowMailResend = () => {
if(checkGrant(menuId, 'X')){
setBottomSheetOn(true);
setDownloadBottomSheetOn(true);
}
else{
showAlert(t('common.nopermission'));
}
};
const callMailResend = () => {
const callMailResend = (
selectedMode: DownloadSelectedMode,
userEmail?: string
) => {
let params = {
orderNumber: orderNumber,
tid: tid,
@@ -231,14 +234,14 @@ export const EscrowDetail = ({
> </button>
</div>
</motion.div>
{ !!bottomSheetOn &&
<EmailBottomSheet
setBottomSheetOn={ setBottomSheetOn }
bottomSheetOn={ bottomSheetOn }
{ !!downloadBottomSheetOn &&
<DownloadBottomSheet
bottomSheetOn={ downloadBottomSheetOn }
setBottomSheetOn={ setDownloadBottomSheetOn }
imageMode={ false }
emailMode={ true }
sendRequest={ callMailResend }
></EmailBottomSheet>
></DownloadBottomSheet>
}
</>
);

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