diff --git a/src/entities/additional-service/ui/link-payment/detail/link-payment-history-detail.tsx b/src/entities/additional-service/ui/link-payment/detail/link-payment-history-detail.tsx index 0ac4576..6dd95f0 100644 --- a/src/entities/additional-service/ui/link-payment/detail/link-payment-history-detail.tsx +++ b/src/entities/additional-service/ui/link-payment/detail/link-payment-history-detail.tsx @@ -43,20 +43,13 @@ export const LinkPaymentHistoryDetail = ({ const { t } = useTranslation(); const { navigate } = useNavigate(); const location = useLocation(); - + const [titleInfo, setTitleInfo] = useState(); const [detailInfo, setDetailInfo] = useState(); const [paymentInfo, setPaymentInfo] = useState(); const [detailExposure, setDetailExposure] = useState(false); const [showPayment, setShowPayment] = useState(false); - useSetHeaderTitle(t('additionalService.linkPayment.detailTitle')); - useSetHeaderType(HeaderType.RightClose); - useSetOnBack(() => { - navigate(-1); // Go back using browser history - }); - useSetFooterMode(false); - const { mutateAsync: linkPayHistoryDetail } = useExtensionLinkPayHistoryDetailMutation(); const { mutateAsync: linkPayHistoryResend } = useExtensionLinkPayHistoryResendMutation(); diff --git a/src/entities/additional-service/ui/link-payment/link-payment-history-wrap.tsx b/src/entities/additional-service/ui/link-payment/link-payment-history-wrap.tsx index a32cc83..683a9ea 100644 --- a/src/entities/additional-service/ui/link-payment/link-payment-history-wrap.tsx +++ b/src/entities/additional-service/ui/link-payment/link-payment-history-wrap.tsx @@ -49,31 +49,31 @@ export const LinkPaymentHistoryWrap = () => { const [sendMethod, setSendMethod] = useState(LinkPaymentSendMethod.ALL); const [emailBottomSheetOn, setEmailBottomSheetOn] = useState(false); const [detailOn, setDetailOn] = useState(false); - const [detailMid, setDetailMid] = useState(''); - const [detailRequestId, setDetailRequestId] = useState(''); + const [detailMid, setDetailMid] = useState(''); + const [detailRequestId, setDetailRequestId] = useState(''); const [detailSubReqId, setDetailSubReqId] = useState(''); const { mutateAsync: linkPayHistoryList } = useExtensionLinkPayHistoryListMutation(); const { mutateAsync: downloadExcel } = useExtensionLinkPayHistoryDownloadExcelMutation(); const onIntersect: IntersectionObserverCallback = (entries: Array) => { - entries.forEach((entry: IntersectionObserverEntry) => { - if(entry.isIntersecting){ - console.log('Element is now intersecting with the root. [' + onActionIntersect + ']'); - if(onActionIntersect && !!pageParam.cursor){ + entries.forEach((entry: IntersectionObserverEntry) => { + if (entry.isIntersecting) { + console.log('Element is now intersecting with the root. [' + onActionIntersect + ']'); + if (onActionIntersect && !!pageParam.cursor) { setOnActionIntersect(false); - callList('page'); - } - } - else{ - console.log('Element is no longer intersecting with the root.'); - } - }); - }; + callList('page'); + } + } + else { + console.log('Element is no longer intersecting with the root.'); + } + }); + }; - const { setTarget } = useIntersectionObserver({ - threshold: 1, - onIntersect - }); + const { setTarget } = useIntersectionObserver({ + threshold: 1, + onIntersect + }); const onClickToNavigate = () => { navigate(PATHS.additionalService.linkPayment.request) @@ -95,40 +95,40 @@ export const LinkPaymentHistoryWrap = () => { ...{ sortType: sortType } } }; - if(type !== 'page' && listParams.page){ - listParams.page.cursor = null; - } + if (type !== 'page' && listParams.page) { + listParams.page.cursor = null; + } linkPayHistoryList(listParams).then((rs) => { - if(type === 'page'){ - setListItems([ - ...listItems, - ...rs.content - ]); - } - else{ - setListItems(rs.content); - } - if(rs.hasNext + if (type === 'page') { + setListItems([ + ...listItems, + ...rs.content + ]); + } + else { + setListItems(rs.content); + } + if (rs.hasNext && rs.nextCursor !== pageParam.cursor - && rs.content.length === DEFAULT_PAGE_PARAM.size - ){ - setPageParam({ - ...pageParam, - ...{ cursor: rs.nextCursor } - }); - } - else{ - setPageParam({ - ...pageParam, - ...{ cursor: null } - }); - } + && rs.content.length === DEFAULT_PAGE_PARAM.size + ) { + setPageParam({ + ...pageParam, + ...{ cursor: rs.nextCursor } + }); + } + else { + setPageParam({ + ...pageParam, + ...{ cursor: null } + }); + } setOnActionIntersect( - !!rs.hasNext - && rs.nextCursor !== pageParam.cursor - && rs.content.length === DEFAULT_PAGE_PARAM.size - ); + !!rs.hasNext + && rs.nextCursor !== pageParam.cursor + && rs.content.length === DEFAULT_PAGE_PARAM.size + ); }); }; @@ -170,13 +170,13 @@ export const LinkPaymentHistoryWrap = () => { const setDetailData = (detailData: DetailData) => { setDetailOn(detailData.detailOn); - if(detailData.mid){ + if (detailData.mid) { setDetailMid(detailData.mid); } - if(detailData.requestId){ + if (detailData.requestId) { setDetailRequestId(detailData.requestId); } - if(detailData.subReqId){ + if (detailData.subReqId) { setDetailSubReqId(detailData.subReqId); } }; @@ -250,12 +250,12 @@ export const LinkPaymentHistoryWrap = () => { -
+