downloadbottomsheet
This commit is contained in:
@@ -32,7 +32,7 @@ import {
|
||||
import { getCashReceiptTransactionTypeBtnGroup } from '@/entities/transaction/model/contant';
|
||||
import { useStore } from '@/shared/model/store';
|
||||
import { useCashReceiptSummaryMutation } from '@/entities/transaction/api/use-cash-receipt-summary-mutation';
|
||||
import { EmailBottomSheet } from '@/entities/common/ui/email-bottom-sheet';
|
||||
import { DownloadBottomSheet, DownloadSelectedMode } from '@/entities/common/ui/download-bottom-sheet';
|
||||
import useIntersectionObserver from '@/widgets/intersection-observer';
|
||||
import { CashReceiptDetail } from '@/entities/transaction/ui/detail/cash-receit-detail';
|
||||
import { checkGrant } from '@/shared/lib/check-grant';
|
||||
@@ -65,7 +65,7 @@ export const CashReceiptListPage = () => {
|
||||
const [cancelAmount, setCancelAmount] = useState<number>(0);
|
||||
const [totalCount, setTotalCount] = useState<number>(0);
|
||||
|
||||
const [emailBottomSheetOn, setEmailBottomSheetOn] = useState<boolean>(false);
|
||||
const [downloadBottomSheetOn, setDownloadBottomSheetOn] = useState<boolean>(false);
|
||||
|
||||
const [detailOn, setDetailOn] = useState<boolean>(false);
|
||||
const [detailTid, setDetailTid] = useState<string>('');
|
||||
@@ -172,10 +172,14 @@ export const CashReceiptListPage = () => {
|
||||
|
||||
}
|
||||
|
||||
const onRequestDownloadExcel = (userEmail?: string) => {
|
||||
setEmailBottomSheetOn(true);
|
||||
const onRequestDownloadExcel = (
|
||||
selectedMode: DownloadSelectedMode,
|
||||
userEmail?: string
|
||||
) => {
|
||||
|
||||
};
|
||||
|
||||
|
||||
const setDetailData = (detailData: DetailData) => {
|
||||
setDetailOn(detailData.detailOn);
|
||||
setDetailTid(detailData.tid);
|
||||
@@ -187,9 +191,9 @@ export const CashReceiptListPage = () => {
|
||||
const onClickToOpenFilter = () => {
|
||||
setFilterOn(!filterOn);
|
||||
};
|
||||
const onClickToDownloadExcel = () => {
|
||||
const onClickToOpenDownloadBottomSheet = () => {
|
||||
if(checkGrant(menuId, 'D')){
|
||||
setEmailBottomSheetOn(true);
|
||||
setDownloadBottomSheetOn(true);
|
||||
}
|
||||
else{
|
||||
showAlert(t('common.nopermission'));
|
||||
@@ -245,7 +249,7 @@ export const CashReceiptListPage = () => {
|
||||
<img
|
||||
src={IMAGE_ROOT + '/ico_download.svg'}
|
||||
alt={ t('transaction.download') }
|
||||
onClick={() => onClickToDownloadExcel()}
|
||||
onClick={() => onClickToOpenDownloadBottomSheet()}
|
||||
/>
|
||||
</button>
|
||||
</div>
|
||||
@@ -330,14 +334,14 @@ export const CashReceiptListPage = () => {
|
||||
setDetailOn={ setDetailOn }
|
||||
tid={ detailTid }
|
||||
></CashReceiptDetail>
|
||||
{ !!emailBottomSheetOn &&
|
||||
<EmailBottomSheet
|
||||
bottomSheetOn={ emailBottomSheetOn }
|
||||
setBottomSheetOn={ setEmailBottomSheetOn }
|
||||
{ !!downloadBottomSheetOn &&
|
||||
<DownloadBottomSheet
|
||||
bottomSheetOn={ downloadBottomSheetOn }
|
||||
setBottomSheetOn={ setDownloadBottomSheetOn }
|
||||
imageMode={ false }
|
||||
emailMode={ true }
|
||||
sendRequest={ onRequestDownloadExcel }
|
||||
></EmailBottomSheet>
|
||||
></DownloadBottomSheet>
|
||||
}
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user