bottomsheet back key
This commit is contained in:
@@ -38,7 +38,7 @@ import { checkGrant } from '@/shared/lib/check-grant';
|
|||||||
import { snackBar } from '@/shared/lib';
|
import { snackBar } from '@/shared/lib';
|
||||||
import { useSettlementsHistoryExcelMutation } from '../api/use-settlements-history-excel-mutation';
|
import { useSettlementsHistoryExcelMutation } from '../api/use-settlements-history-excel-mutation';
|
||||||
import { VatReturnDownloadExcelResponse } from '@/entities/vat-return/model/types';
|
import { VatReturnDownloadExcelResponse } from '@/entities/vat-return/model/types';
|
||||||
import { useDetailOnStore, useFilterlOnStore, useStore } from '@/shared/model/store';
|
import { useDetailOnStore, useDownloadBottomSheetOnStore, useFilterlOnStore, useStore } from '@/shared/model/store';
|
||||||
|
|
||||||
export interface ListWrapProps {
|
export interface ListWrapProps {
|
||||||
startDateFromCalendar?: string;
|
startDateFromCalendar?: string;
|
||||||
@@ -92,7 +92,7 @@ export const ListWrap = ({
|
|||||||
const [detailSettlementId, setDetailSettlementId] = useState<string>('');
|
const [detailSettlementId, setDetailSettlementId] = useState<string>('');
|
||||||
const [detailTid, setDetailTid] = useState<string>('');
|
const [detailTid, setDetailTid] = useState<string>('');
|
||||||
|
|
||||||
const [downloadBottomSheetOn, setDownloadBottomSheetOn] = useState<boolean>(false);
|
const { downloadBottomSheetOn, setDownloadBottomSheetOn } = useDownloadBottomSheetOnStore();
|
||||||
|
|
||||||
const [groupDate, setGroupDate] = useState<string>('');
|
const [groupDate, setGroupDate] = useState<string>('');
|
||||||
const [groupDateOn, setGroupDateOn] = useState<boolean>(false);
|
const [groupDateOn, setGroupDateOn] = useState<boolean>(false);
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import { DetailMotionDuration, DetailMotionStyle, DetailMotionVariants } from '@
|
|||||||
import { FullMenuClose } from '@/entities/common/ui/full-menu-close';
|
import { FullMenuClose } from '@/entities/common/ui/full-menu-close';
|
||||||
import { checkGrant } from '@/shared/lib/check-grant';
|
import { checkGrant } from '@/shared/lib/check-grant';
|
||||||
import { showAlert } from '@/widgets/show-alert';
|
import { showAlert } from '@/widgets/show-alert';
|
||||||
|
import { useDownloadBottomSheetOnStore } from '@/shared/model/store';
|
||||||
|
|
||||||
export interface CashReceiptDetailProps {
|
export interface CashReceiptDetailProps {
|
||||||
detailOn: boolean;
|
detailOn: boolean;
|
||||||
@@ -49,7 +50,7 @@ export const CashReceiptDetail = ({
|
|||||||
const [detailInfo, setDetailInfo] = useState<DetailInfo>();
|
const [detailInfo, setDetailInfo] = useState<DetailInfo>();
|
||||||
const [showAmountInfo, setShowAmountInfo] = useState<boolean>(false);
|
const [showAmountInfo, setShowAmountInfo] = useState<boolean>(false);
|
||||||
const [showDetailInfo, setShowDetailInfo] = useState<boolean>(false);
|
const [showDetailInfo, setShowDetailInfo] = useState<boolean>(false);
|
||||||
const [bottomSheetOn, setBottomSheetOn] = useState<boolean>(false);
|
const { downloadBottomSheetOn, setDownloadBottomSheetOn } = useDownloadBottomSheetOnStore();
|
||||||
const [purposeType, setPurposeType] = useState<string>();
|
const [purposeType, setPurposeType] = useState<string>();
|
||||||
const [canDownloadReceipt, setCanDownloadReceipt] = useState<boolean>(false);
|
const [canDownloadReceipt, setCanDownloadReceipt] = useState<boolean>(false);
|
||||||
|
|
||||||
@@ -65,7 +66,7 @@ export const CashReceiptDetail = ({
|
|||||||
};
|
};
|
||||||
cashReceiptPurposeUpdate(params).then((rs) => {
|
cashReceiptPurposeUpdate(params).then((rs) => {
|
||||||
setPurposeType(rs.afterPurposeType);
|
setPurposeType(rs.afterPurposeType);
|
||||||
setBottomSheetOn(false);
|
setDownloadBottomSheetOn(false);
|
||||||
snackBar('용도 변경을 성공하였습니다.', function(){
|
snackBar('용도 변경을 성공하였습니다.', function(){
|
||||||
reload();
|
reload();
|
||||||
}, 2000);
|
}, 2000);
|
||||||
@@ -120,7 +121,7 @@ export const CashReceiptDetail = ({
|
|||||||
|
|
||||||
const onClickToPurposeUpdate = () => {
|
const onClickToPurposeUpdate = () => {
|
||||||
if(checkGrant(menuId, 'W')){
|
if(checkGrant(menuId, 'W')){
|
||||||
setBottomSheetOn(true);
|
setDownloadBottomSheetOn(true);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
showAlert(t('common.nopermission'));
|
showAlert(t('common.nopermission'));
|
||||||
@@ -196,10 +197,10 @@ export const CashReceiptDetail = ({
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
{ bottomSheetOn &&
|
{ downloadBottomSheetOn &&
|
||||||
<CashReceitPurposeUpdateBottomSheet
|
<CashReceitPurposeUpdateBottomSheet
|
||||||
setBottomSheetOn={ setBottomSheetOn }
|
setBottomSheetOn={ setDownloadBottomSheetOn }
|
||||||
bottomSheetOn={ bottomSheetOn }
|
bottomSheetOn={ downloadBottomSheetOn }
|
||||||
callPurposeUpdate={ callPurposeUpdate }
|
callPurposeUpdate={ callPurposeUpdate }
|
||||||
></CashReceitPurposeUpdateBottomSheet>
|
></CashReceitPurposeUpdateBottomSheet>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import { checkGrant } from '@/shared/lib/check-grant';
|
|||||||
import { showAlert } from '@/widgets/show-alert';
|
import { showAlert } from '@/widgets/show-alert';
|
||||||
import { snackBar } from '@/shared/lib';
|
import { snackBar } from '@/shared/lib';
|
||||||
import { EscrowMailResendBottomSheet } from '../escrow-mail-resend-bottom-sheet';
|
import { EscrowMailResendBottomSheet } from '../escrow-mail-resend-bottom-sheet';
|
||||||
|
import { useDownloadBottomSheetOnStore } from '@/shared/model/store';
|
||||||
|
|
||||||
export interface EscrowDetailProps {
|
export interface EscrowDetailProps {
|
||||||
detailOn: boolean;
|
detailOn: boolean;
|
||||||
@@ -68,7 +69,7 @@ export const EscrowDetail = ({
|
|||||||
const [showSettlementInfo, setShowSettlementInfo] = useState<boolean>(false);
|
const [showSettlementInfo, setShowSettlementInfo] = useState<boolean>(false);
|
||||||
const [showMerchantInfo, setShowMerchantInfo] = useState<boolean>(false);
|
const [showMerchantInfo, setShowMerchantInfo] = useState<boolean>(false);
|
||||||
|
|
||||||
const [downloadBottomSheetOn, setDownloadBottomSheetOn] = useState<boolean>(false);
|
const { downloadBottomSheetOn, setDownloadBottomSheetOn } = useDownloadBottomSheetOnStore();
|
||||||
|
|
||||||
const [orderNumber, setOrderNumber] = useState<string>();
|
const [orderNumber, setOrderNumber] = useState<string>();
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import { useState } from 'react';
|
|||||||
import { DownloadBottomSheet, DownloadSelectedMode } from '@/entities/common/ui/download-bottom-sheet';
|
import { DownloadBottomSheet, DownloadSelectedMode } from '@/entities/common/ui/download-bottom-sheet';
|
||||||
import { CashReceiptSample } from '@/entities/common/ui/cash-receipt-sample';
|
import { CashReceiptSample } from '@/entities/common/ui/cash-receipt-sample';
|
||||||
import { useCashReceiptReceiptSendEmailMutation } from '../../api/use-cash-receipt-receipt-send-email-mutation';
|
import { useCashReceiptReceiptSendEmailMutation } from '../../api/use-cash-receipt-receipt-send-email-mutation';
|
||||||
|
import { useDownloadBottomSheetOnStore } from '@/shared/model/store';
|
||||||
|
|
||||||
export const AmountInfoSection = ({
|
export const AmountInfoSection = ({
|
||||||
transactionCategory,
|
transactionCategory,
|
||||||
@@ -25,7 +26,7 @@ export const AmountInfoSection = ({
|
|||||||
const { mutateAsync: cashReceiptReceiptDownload } = useCashReceiptReceiptDownloadMutation();
|
const { mutateAsync: cashReceiptReceiptDownload } = useCashReceiptReceiptDownloadMutation();
|
||||||
const { mutateAsync: cashReceiptReceiptSendEamil } = useCashReceiptReceiptSendEmailMutation();
|
const { mutateAsync: cashReceiptReceiptSendEamil } = useCashReceiptReceiptSendEmailMutation();
|
||||||
|
|
||||||
const [downloadBottomSheetOn, setDownloadBottomSheetOn] = useState<boolean>(false);
|
const { downloadBottomSheetOn, setDownloadBottomSheetOn } = useDownloadBottomSheetOnStore();
|
||||||
const [cashReceiptSampleOn, setCashReceiptSampleOn] = useState<boolean>(false);
|
const [cashReceiptSampleOn, setCashReceiptSampleOn] = useState<boolean>(false);
|
||||||
|
|
||||||
const [receiptIssueInfo, setReceiptIssueInfo] = useState<IssueInfo>({});
|
const [receiptIssueInfo, setReceiptIssueInfo] = useState<IssueInfo>({});
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import { DetailMotionDuration, DetailMotionStyle, DetailMotionVariants } from '@
|
|||||||
import { FullMenuClose } from '@/entities/common/ui/full-menu-close';
|
import { FullMenuClose } from '@/entities/common/ui/full-menu-close';
|
||||||
import { showAlert } from '@/widgets/show-alert';
|
import { showAlert } from '@/widgets/show-alert';
|
||||||
import { snackBar } from '@/shared/lib';
|
import { snackBar } from '@/shared/lib';
|
||||||
|
import { useDownloadBottomSheetOnStore } from '@/shared/model/store';
|
||||||
|
|
||||||
export interface TaxInvoiceDetailProps {
|
export interface TaxInvoiceDetailProps {
|
||||||
detailOn: boolean;
|
detailOn: boolean;
|
||||||
@@ -38,7 +39,7 @@ export const TaxInvoiceDetail = ({
|
|||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
|
||||||
const [openAmount, setOpenAmount] = useState<boolean>(false);
|
const [openAmount, setOpenAmount] = useState<boolean>(false);
|
||||||
const [bottomSheetOn, setBottomSheetOn] = useState<boolean>(false);
|
const { downloadBottomSheetOn, setDownloadBottomSheetOn } = useDownloadBottomSheetOnStore();
|
||||||
const [detail, setDetail] = useState<VatReturnDetailResponse>({});
|
const [detail, setDetail] = useState<VatReturnDetailResponse>({});
|
||||||
const [breakdown, setBreakdown] = useState<Array<Breakdown>>([]);
|
const [breakdown, setBreakdown] = useState<Array<Breakdown>>([]);
|
||||||
|
|
||||||
@@ -76,7 +77,7 @@ export const TaxInvoiceDetail = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onClickToOpenBottomSheet = () => {
|
const onClickToOpenBottomSheet = () => {
|
||||||
setBottomSheetOn(true);
|
setDownloadBottomSheetOn(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
const onClickToClose = () => {
|
const onClickToClose = () => {
|
||||||
@@ -144,10 +145,10 @@ export const TaxInvoiceDetail = ({
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</motion.div>
|
</motion.div>
|
||||||
{ !!bottomSheetOn &&
|
{ !!downloadBottomSheetOn &&
|
||||||
<VatReturnListDetailBottomSheet
|
<VatReturnListDetailBottomSheet
|
||||||
bottomSheetOn={ bottomSheetOn }
|
bottomSheetOn={ downloadBottomSheetOn }
|
||||||
setBottomSheetOn={ setBottomSheetOn }
|
setBottomSheetOn={ setDownloadBottomSheetOn }
|
||||||
breakdown={ breakdown }
|
breakdown={ breakdown }
|
||||||
transactionAmount={ detail?.transactionAmount }
|
transactionAmount={ detail?.transactionAmount }
|
||||||
supplyAmount={ detail?.supplyAmount }
|
supplyAmount={ detail?.supplyAmount }
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import {
|
|||||||
} from '../model/types';
|
} from '../model/types';
|
||||||
import { useVatReturnListMutation } from '../api/use-vat-return-list-mutation';
|
import { useVatReturnListMutation } from '../api/use-vat-return-list-mutation';
|
||||||
import { ListDateGroup } from './list-date-group';
|
import { ListDateGroup } from './list-date-group';
|
||||||
import { useDetailOnStore, useFilterlOnStore, useStore } from '@/shared/model/store';
|
import { useDetailOnStore, useDownloadBottomSheetOnStore, useFilterlOnStore, useStore } from '@/shared/model/store';
|
||||||
import { DownloadBottomSheet, DownloadSelectedMode } from '@/entities/common/ui/download-bottom-sheet';
|
import { DownloadBottomSheet, DownloadSelectedMode } from '@/entities/common/ui/download-bottom-sheet';
|
||||||
import useIntersectionObserver from '@/widgets/intersection-observer';
|
import useIntersectionObserver from '@/widgets/intersection-observer';
|
||||||
import { TaxInvoiceDetail } from './detail/tax-invoice-detail';
|
import { TaxInvoiceDetail } from './detail/tax-invoice-detail';
|
||||||
@@ -50,7 +50,7 @@ export const ListWrap = () => {
|
|||||||
const [receiptType, setReceiptType] = useState<VatReturnReceiptType>(defaultParams.receiptType);
|
const [receiptType, setReceiptType] = useState<VatReturnReceiptType>(defaultParams.receiptType);
|
||||||
const [targetType, setTargetType] = useState<VatReturnTargetType>(defaultParams.targetType);
|
const [targetType, setTargetType] = useState<VatReturnTargetType>(defaultParams.targetType);
|
||||||
|
|
||||||
const [downloadBottomSheetOn, setDownloadBottomSheetOn] = useState<boolean>(false);
|
const { downloadBottomSheetOn, setDownloadBottomSheetOn } = useDownloadBottomSheetOnStore();
|
||||||
|
|
||||||
const { detailOn, setDetailOn } = useDetailOnStore();
|
const { detailOn, setDetailOn } = useDetailOnStore();
|
||||||
const [detailTaxInvoiceNumber, setDetailTaxInvoiceNumber] = useState<string>('');
|
const [detailTaxInvoiceNumber, setDetailTaxInvoiceNumber] = useState<string>('');
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import { useVatReturnTaxInvoiceMutation } from '../../api/use-vat-return-tax-inv
|
|||||||
import { TaxInvoiceSample } from '@/entities/common/ui/tax-invoice-sample';
|
import { TaxInvoiceSample } from '@/entities/common/ui/tax-invoice-sample';
|
||||||
import { useVatReturnTaxInvoiceSendEmailMutation } from '../../api/use-vat-return-tax-invoice-send-email-mutation';
|
import { useVatReturnTaxInvoiceSendEmailMutation } from '../../api/use-vat-return-tax-invoice-send-email-mutation';
|
||||||
import { snackBar } from '@/shared/lib';
|
import { snackBar } from '@/shared/lib';
|
||||||
|
import { useDownloadBottomSheetOnStore } from '@/shared/model/store';
|
||||||
|
|
||||||
export interface AmountSectionProps {
|
export interface AmountSectionProps {
|
||||||
taxInvoiceNumber: string;
|
taxInvoiceNumber: string;
|
||||||
@@ -22,7 +23,7 @@ export const AmountSection = ({
|
|||||||
}: AmountSectionProps) => {
|
}: AmountSectionProps) => {
|
||||||
const { t, i18n } = useTranslation();
|
const { t, i18n } = useTranslation();
|
||||||
const [isOpen, setIsOpen] = useState<boolean>(false);
|
const [isOpen, setIsOpen] = useState<boolean>(false);
|
||||||
const [downloadBottomSheetOn, setDownloadBottomSheetOn] = useState<boolean>(false);
|
const { downloadBottomSheetOn, setDownloadBottomSheetOn } = useDownloadBottomSheetOnStore();
|
||||||
|
|
||||||
const [taxInvoiceSampleOn, setTaxInvoiceSampleOn] = useState<boolean>(false);
|
const [taxInvoiceSampleOn, setTaxInvoiceSampleOn] = useState<boolean>(false);
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { useDetailOnStore, useFilterlOnStore, useStore } from '@/shared/model/store';
|
import { useDetailOnStore, useDownloadBottomSheetOnStore, useFilterlOnStore, useStore } from '@/shared/model/store';
|
||||||
import { ChangeEvent, useEffect, useState } from 'react';
|
import { ChangeEvent, useEffect, useState } from 'react';
|
||||||
import { IMAGE_ROOT } from '@/shared/constants/common';
|
import { IMAGE_ROOT } from '@/shared/constants/common';
|
||||||
import { PATHS } from '@/shared/constants/paths';
|
import { PATHS } from '@/shared/constants/paths';
|
||||||
@@ -87,7 +87,7 @@ export const AllTransactionListPage = () => {
|
|||||||
const [totalCount, setTotalCount] = useState<number>(0);
|
const [totalCount, setTotalCount] = useState<number>(0);
|
||||||
const [totalAmount, setTotalAmount] = useState<number>(0);
|
const [totalAmount, setTotalAmount] = useState<number>(0);
|
||||||
|
|
||||||
const [downloadBottomSheetOn, setDownloadBottomSheetOn] = useState<boolean>(false);
|
const { downloadBottomSheetOn, setDownloadBottomSheetOn } = useDownloadBottomSheetOnStore();
|
||||||
|
|
||||||
const { detailOn, setDetailOn } = useDetailOnStore();
|
const { detailOn, setDetailOn } = useDetailOnStore();
|
||||||
const [detailTid, setDetailTid] = useState<string>('');
|
const [detailTid, setDetailTid] = useState<string>('');
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useDetailOnStore, useFilterlOnStore, useStore } from '@/shared/model/store';
|
import { useDetailOnStore, useDownloadBottomSheetOnStore, useFilterlOnStore, useStore } from '@/shared/model/store';
|
||||||
import { IMAGE_ROOT } from '@/shared/constants/common';
|
import { IMAGE_ROOT } from '@/shared/constants/common';
|
||||||
import { PATHS } from '@/shared/constants/paths';
|
import { PATHS } from '@/shared/constants/paths';
|
||||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||||
@@ -72,7 +72,7 @@ export const BillingListPage = () => {
|
|||||||
const [minAmount, setMinAmount] = useState<number | undefined>(defaultParams.minAmount);
|
const [minAmount, setMinAmount] = useState<number | undefined>(defaultParams.minAmount);
|
||||||
const [maxAmount, setMaxAmount] = useState<number | undefined>(defaultParams.maxAmount);
|
const [maxAmount, setMaxAmount] = useState<number | undefined>(defaultParams.maxAmount);
|
||||||
|
|
||||||
const [downloadBottomSheetOn, setDownloadBottomSheetOn] = useState<boolean>(false);
|
const { downloadBottomSheetOn, setDownloadBottomSheetOn } = useDownloadBottomSheetOnStore();
|
||||||
|
|
||||||
const { detailOn, setDetailOn } = useDetailOnStore();
|
const { detailOn, setDetailOn } = useDetailOnStore();
|
||||||
const [detailTid, setDetailTid] = useState<string>('');
|
const [detailTid, setDetailTid] = useState<string>('');
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import {
|
|||||||
useSetFooterMode
|
useSetFooterMode
|
||||||
} from '@/widgets/sub-layout/use-sub-layout';
|
} from '@/widgets/sub-layout/use-sub-layout';
|
||||||
import { getCashReceiptTransactionTypeBtnGroup } from '@/entities/transaction/model/contant';
|
import { getCashReceiptTransactionTypeBtnGroup } from '@/entities/transaction/model/contant';
|
||||||
import { useDetailOnStore, useFilterlOnStore, useStore } from '@/shared/model/store';
|
import { useDetailOnStore, useDownloadBottomSheetOnStore, useFilterlOnStore, useStore } from '@/shared/model/store';
|
||||||
import { useCashReceiptSummaryMutation } from '@/entities/transaction/api/use-cash-receipt-summary-mutation';
|
import { useCashReceiptSummaryMutation } from '@/entities/transaction/api/use-cash-receipt-summary-mutation';
|
||||||
import { DownloadBottomSheet, DownloadSelectedMode } from '@/entities/common/ui/download-bottom-sheet';
|
import { DownloadBottomSheet, DownloadSelectedMode } from '@/entities/common/ui/download-bottom-sheet';
|
||||||
import useIntersectionObserver from '@/widgets/intersection-observer';
|
import useIntersectionObserver from '@/widgets/intersection-observer';
|
||||||
@@ -78,7 +78,7 @@ export const CashReceiptListPage = () => {
|
|||||||
const [cancelAmount, setCancelAmount] = useState<number>(0);
|
const [cancelAmount, setCancelAmount] = useState<number>(0);
|
||||||
const [totalCount, setTotalCount] = useState<number>(0);
|
const [totalCount, setTotalCount] = useState<number>(0);
|
||||||
|
|
||||||
const [downloadBottomSheetOn, setDownloadBottomSheetOn] = useState<boolean>(false);
|
const { downloadBottomSheetOn, setDownloadBottomSheetOn } = useDownloadBottomSheetOnStore();
|
||||||
|
|
||||||
const { detailOn, setDetailOn } = useDetailOnStore();
|
const { detailOn, setDetailOn } = useDetailOnStore();
|
||||||
const [detailTid, setDetailTid] = useState<string>('');
|
const [detailTid, setDetailTid] = useState<string>('');
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useDetailOnStore, useFilterlOnStore, useStore } from '@/shared/model/store';
|
import { useDetailOnStore, useDownloadBottomSheetOnStore, useFilterlOnStore, useStore } from '@/shared/model/store';
|
||||||
import { IMAGE_ROOT } from '@/shared/constants/common';
|
import { IMAGE_ROOT } from '@/shared/constants/common';
|
||||||
import { PATHS } from '@/shared/constants/paths';
|
import { PATHS } from '@/shared/constants/paths';
|
||||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||||
@@ -71,7 +71,7 @@ export const EscrowListPage = () => {
|
|||||||
const [minAmount, setMinAmount] = useState<number | undefined>();
|
const [minAmount, setMinAmount] = useState<number | undefined>();
|
||||||
const [maxAmount, setMaxAmount] = useState<number | undefined>();
|
const [maxAmount, setMaxAmount] = useState<number | undefined>();
|
||||||
|
|
||||||
const [downloadBottomSheetOn, setDownloadBottomSheetOn] = useState<boolean>(false);
|
const { downloadBottomSheetOn, setDownloadBottomSheetOn } = useDownloadBottomSheetOnStore();
|
||||||
|
|
||||||
const { detailOn, setDetailOn } = useDetailOnStore();
|
const { detailOn, setDetailOn } = useDetailOnStore();
|
||||||
const [detailTid, setDetailTid] = useState<string>('');
|
const [detailTid, setDetailTid] = useState<string>('');
|
||||||
|
|||||||
@@ -6,6 +6,10 @@ import { createUserInfoStore, UserInfoState } from '@/entities/user/model/store'
|
|||||||
import { createBannerInfoStore, BannerInfoState, createCommonStore, CommonState } from '@/entities/common/model/store';
|
import { createBannerInfoStore, BannerInfoState, createCommonStore, CommonState } from '@/entities/common/model/store';
|
||||||
import { StorageKeys } from '@/shared/constants/local-storage';
|
import { StorageKeys } from '@/shared/constants/local-storage';
|
||||||
|
|
||||||
|
export interface DownloadBottomSheetOnStore {
|
||||||
|
downloadBottomSheetOn: boolean;
|
||||||
|
setDownloadBottomSheetOn: (downloadBottomSheetOn: boolean) => void;
|
||||||
|
};
|
||||||
export interface FilterOnStore {
|
export interface FilterOnStore {
|
||||||
filterOn: boolean;
|
filterOn: boolean;
|
||||||
setFilterOn: (filterOn: boolean) => void;
|
setFilterOn: (filterOn: boolean) => void;
|
||||||
@@ -38,6 +42,15 @@ export interface MenuIdsStore {
|
|||||||
deleteMenuId: (menuId: number) => void;
|
deleteMenuId: (menuId: number) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const useDownloadBottomSheetOnStore = create<DownloadBottomSheetOnStore>((set) => ({
|
||||||
|
downloadBottomSheetOn: false,
|
||||||
|
setDownloadBottomSheetOn: (downloadBottomSheetOn: boolean) => {
|
||||||
|
set((state: {downloadBottomSheetOn: boolean}) => ({
|
||||||
|
downloadBottomSheetOn: (state.downloadBottomSheetOn = downloadBottomSheetOn)
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
export const useFilterlOnStore = create<FilterOnStore>((set) => ({
|
export const useFilterlOnStore = create<FilterOnStore>((set) => ({
|
||||||
filterOn: false,
|
filterOn: false,
|
||||||
setFilterOn: (filterOn: boolean) => {
|
setFilterOn: (filterOn: boolean) => {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import {
|
|||||||
import { useHomeGroupsMutation } from '@/entities/home/api/use-home-groups-mutation';
|
import { useHomeGroupsMutation } from '@/entities/home/api/use-home-groups-mutation';
|
||||||
import { useUserInfo } from '@/entities/user/lib/use-user-info';
|
import { useUserInfo } from '@/entities/user/lib/use-user-info';
|
||||||
import { useAppBridge } from '@/hooks';
|
import { useAppBridge } from '@/hooks';
|
||||||
import { useDetailOnStore, useFavoriteEditOnStore, useFilterlOnStore, useMenuOnStore, useStore, useTransactionCancelOnStore, useTransactionCancelPreventBondOnStore } from '@/shared/model/store';
|
import { useDetailOnStore, useDownloadBottomSheetOnStore, useFavoriteEditOnStore, useFilterlOnStore, useMenuOnStore, useStore, useTransactionCancelOnStore, useTransactionCancelPreventBondOnStore } from '@/shared/model/store';
|
||||||
import { HomeGroupsParams, HomeGroupsResponse } from '@/entities/home/model/types';
|
import { HomeGroupsParams, HomeGroupsResponse } from '@/entities/home/model/types';
|
||||||
import {
|
import {
|
||||||
BusinessPropertyParams,
|
BusinessPropertyParams,
|
||||||
@@ -38,6 +38,7 @@ import { MenuItems } from '@/entities/common/model/constant';
|
|||||||
import { AlarmLinkOptions } from '@/entities/alarm/model/types';
|
import { AlarmLinkOptions } from '@/entities/alarm/model/types';
|
||||||
import { AlarmRoutes } from '@/entities/alarm/ui/alarm-routes';
|
import { AlarmRoutes } from '@/entities/alarm/ui/alarm-routes';
|
||||||
import { useNavigate } from '@/shared/lib/hooks';
|
import { useNavigate } from '@/shared/lib/hooks';
|
||||||
|
import { PATHS } from '@/shared/constants/paths';
|
||||||
|
|
||||||
export interface ContextType {
|
export interface ContextType {
|
||||||
setOnBack: (onBack: () => void) => void;
|
setOnBack: (onBack: () => void) => void;
|
||||||
@@ -67,7 +68,7 @@ export const SubLayout = () => {
|
|||||||
updateUserData
|
updateUserData
|
||||||
} = useUserInfo();
|
} = useUserInfo();
|
||||||
|
|
||||||
const { reload, navigateBack } = useNavigate();
|
const { reload, navigateBack, navigate } = useNavigate();
|
||||||
|
|
||||||
const { menuOn, setMenuOn } = useMenuOnStore();
|
const { menuOn, setMenuOn } = useMenuOnStore();
|
||||||
const { favoriteEditOn, setFavoriteEditOn } = useFavoriteEditOnStore();
|
const { favoriteEditOn, setFavoriteEditOn } = useFavoriteEditOnStore();
|
||||||
@@ -75,6 +76,7 @@ export const SubLayout = () => {
|
|||||||
const { transactionCancelOn, setTransactionCancelOn } = useTransactionCancelOnStore();
|
const { transactionCancelOn, setTransactionCancelOn } = useTransactionCancelOnStore();
|
||||||
const { cancelPreventBondOn, setCancelPreventBondOn } = useTransactionCancelPreventBondOnStore();
|
const { cancelPreventBondOn, setCancelPreventBondOn } = useTransactionCancelPreventBondOnStore();
|
||||||
const { filterOn, setFilterOn } = useFilterlOnStore();
|
const { filterOn, setFilterOn } = useFilterlOnStore();
|
||||||
|
const { downloadBottomSheetOn, setDownloadBottomSheetOn } = useDownloadBottomSheetOnStore();
|
||||||
|
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
console.log(location)
|
console.log(location)
|
||||||
@@ -411,6 +413,9 @@ export const SubLayout = () => {
|
|||||||
console.log('pathname = [' + pathname + ']');
|
console.log('pathname = [' + pathname + ']');
|
||||||
if(pathname === '/home'){
|
if(pathname === '/home'){
|
||||||
|
|
||||||
|
}
|
||||||
|
else if(pathname === '/additionalService/list'){
|
||||||
|
navigate(PATHS.home);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
if(menuOn){
|
if(menuOn){
|
||||||
@@ -423,6 +428,9 @@ export const SubLayout = () => {
|
|||||||
else if(transactionCancelOn){
|
else if(transactionCancelOn){
|
||||||
setTransactionCancelOn(false);
|
setTransactionCancelOn(false);
|
||||||
}
|
}
|
||||||
|
else if(downloadBottomSheetOn){
|
||||||
|
setDownloadBottomSheetOn(false);
|
||||||
|
}
|
||||||
else if(detailOn){
|
else if(detailOn){
|
||||||
setDetailOn(false);
|
setDetailOn(false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user