payment 이하 구조 변경
This commit is contained in:
@@ -1,65 +0,0 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { PATHS } from '@/shared/constants/paths';
|
||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||
import { PaymentTab } from '@/entities/payment/ui/payment-tab';
|
||||
import { DataNotificationWrap } from '@/entities/payment/ui/data-notification-wrap';
|
||||
import { PaymentNonCardResponse, PaymentNotificationDataResponse, PaymentTabKeys } from '@/entities/payment/model/types';
|
||||
import { usePaymentNotificationDataMutation } from '@/entities/payment/api/use-payment-notification-data-mutation';
|
||||
import { HeaderType } from '@/entities/common/model/types';
|
||||
import {
|
||||
useSetHeaderTitle,
|
||||
useSetHeaderType,
|
||||
useSetFooterMode,
|
||||
useSetOnBack
|
||||
} from '@/widgets/sub-layout/use-sub-layout';
|
||||
|
||||
export const DataNotificationPage = () => {
|
||||
const { navigate } = useNavigate();
|
||||
|
||||
const { mutateAsync: paymentNotificationData } = usePaymentNotificationDataMutation();
|
||||
|
||||
const [activeTab, setActiveTab] = useState<PaymentTabKeys>(PaymentTabKeys.DataNotification);
|
||||
const [mid, setMid] = useState<string>('nictest00g');
|
||||
const [gid, setGid] = useState<string>('nictest00g');
|
||||
const [paymentNotificationDataResult, setPaymentNotificationDataResult] = useState<PaymentNotificationDataResponse>();
|
||||
|
||||
useSetHeaderTitle('결제 관리');
|
||||
useSetHeaderType(HeaderType.LeftArrow);
|
||||
useSetFooterMode(true);
|
||||
useSetOnBack(() => {
|
||||
navigate(PATHS.home);
|
||||
});
|
||||
|
||||
const callPaymentNotificationData = () => {
|
||||
let params = {
|
||||
mid: mid,
|
||||
gid: gid
|
||||
};
|
||||
|
||||
paymentNotificationData(params).then((rs) => {
|
||||
console.log(rs);
|
||||
setPaymentNotificationDataResult(rs);
|
||||
});
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
callPaymentNotificationData();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
<main>
|
||||
<div className="tab-content">
|
||||
<div className="tab-pane pt-46 active">
|
||||
<PaymentTab activeTab={ activeTab }></PaymentTab>
|
||||
{ !!paymentNotificationDataResult &&
|
||||
<DataNotificationWrap
|
||||
paymentNotificationData={ paymentNotificationDataResult }
|
||||
></DataNotificationWrap>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</>
|
||||
);
|
||||
};
|
||||
@@ -27,7 +27,7 @@ export const InfoPage = () => {
|
||||
return (
|
||||
<>
|
||||
<main>
|
||||
<div className="tab-content pb-70">
|
||||
<div className="tab-content">
|
||||
<div className="tab-pane pt-46 active">
|
||||
<PaymentTab activeTab={ activeTab }></PaymentTab>
|
||||
<InfoWrap></InfoWrap>
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
import { useState } from 'react';
|
||||
import { PATHS } from '@/shared/constants/paths';
|
||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||
import { PaymentTab } from '@/entities/payment/ui/payment-tab';
|
||||
import { NotificationDataWrap } from '@/entities/payment/ui/notification-data-wrap';
|
||||
import { PaymentTabKeys } from '@/entities/payment/model/types';
|
||||
import { HeaderType } from '@/entities/common/model/types';
|
||||
import {
|
||||
useSetHeaderTitle,
|
||||
useSetHeaderType,
|
||||
useSetFooterMode,
|
||||
useSetOnBack
|
||||
} from '@/widgets/sub-layout/use-sub-layout';
|
||||
|
||||
export const NotificationDataPage = () => {
|
||||
const { navigate } = useNavigate();
|
||||
const [activeTab, setActiveTab] = useState<PaymentTabKeys>(PaymentTabKeys.NotificationData);
|
||||
|
||||
useSetHeaderTitle('결제 관리');
|
||||
useSetHeaderType(HeaderType.LeftArrow);
|
||||
useSetFooterMode(true);
|
||||
useSetOnBack(() => {
|
||||
navigate(PATHS.home);
|
||||
});
|
||||
|
||||
return (
|
||||
<>
|
||||
<main>
|
||||
<div className="tab-content">
|
||||
<div className="tab-pane pt-46 active">
|
||||
<PaymentTab activeTab={ activeTab }></PaymentTab>
|
||||
<NotificationDataWrap></NotificationDataWrap>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</>
|
||||
);
|
||||
};
|
||||
@@ -2,14 +2,14 @@ import { Route } from 'react-router-dom';
|
||||
import { SentryRoutes } from '@/shared/configs/sentry';
|
||||
import { ROUTE_NAMES } from '@/shared/constants/route-names';
|
||||
import { InfoPage } from './info/info-page';
|
||||
import { DataNotificationPage } from './data-notification/data-notification-page';
|
||||
import { NotificationDataPage } from './notification-data/notification-data-page';
|
||||
|
||||
export const PaymentPages = () => {
|
||||
return (
|
||||
<>
|
||||
<SentryRoutes>
|
||||
<Route path={ROUTE_NAMES.payment.info} element={<InfoPage />} />
|
||||
<Route path={ROUTE_NAMES.payment.dataNotification} element={<DataNotificationPage />} />
|
||||
<Route path={ROUTE_NAMES.payment.notificationData} element={<NotificationDataPage />} />
|
||||
</SentryRoutes>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user