sort 관련 정리
This commit is contained in:
@@ -5,8 +5,9 @@ import { LinkPaymentHistoryFilter } from "./filter/link-payment-history-filter";
|
||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||
import { PATHS } from "@/shared/constants/paths";
|
||||
import { LinkPaymentHistoryList } from "./link-payment-history-list";
|
||||
import { SortOptionsBox } from "../sort-options-box";
|
||||
import { AdditionalServiceCategory, LinkPaymentSendMethod, LinkPaymentHistoryListItem, LinkPaymentTransactionStatus, ProcessResult, SortByKeys } from "../../model/types";
|
||||
import { SortTypeBox } from '@/entities/common/ui/sort-type-box';
|
||||
import { SortTypeKeys } from '@/entities/common/model/types';
|
||||
import { AdditionalServiceCategory, LinkPaymentSendMethod, LinkPaymentHistoryListItem, LinkPaymentTransactionStatus, ProcessResult } from "../../model/types";
|
||||
import { LinkPaymentSearchType, } from "../../model/types";
|
||||
import { useExtensionLinkPayHistoryListMutation } from '../../api/link-payment/use-extension-link-pay-history-list-mutation';
|
||||
import { DEFAULT_PAGE_PARAM } from '@/entities/common/model/constant';
|
||||
@@ -24,7 +25,7 @@ export const LinkPaymentHistoryWrap = () => {
|
||||
const userMid = useStore.getState().UserStore.mid;
|
||||
|
||||
const [filterOn, setFilterOn] = useState<boolean>(false);
|
||||
const [sortBy, setSortBy] = useState<SortByKeys>(SortByKeys.New);
|
||||
const [sortType, setSortType] = useState<SortTypeKeys>(SortTypeKeys.LATEST);
|
||||
const [listItems, setListItems] = useState({});
|
||||
const [pageParam, setPageParam] = useState(DEFAULT_PAGE_PARAM);
|
||||
const [mid, setMid] = useState<string>(userMid);
|
||||
@@ -44,10 +45,10 @@ export const LinkPaymentHistoryWrap = () => {
|
||||
};
|
||||
|
||||
const callList = (option?: {
|
||||
sortBy?: string,
|
||||
sortType?: SortTypeKeys,
|
||||
val?: string
|
||||
}) => {
|
||||
pageParam.sortBy = (option?.sortBy) ? option.sortBy : sortBy;
|
||||
pageParam.sortType = (option?.sortType) ? option.sortType : sortType;
|
||||
setPageParam(pageParam);
|
||||
|
||||
let listParams = {
|
||||
@@ -106,9 +107,11 @@ export const LinkPaymentHistoryWrap = () => {
|
||||
setProcessResult(val);
|
||||
}
|
||||
|
||||
const onClickToSort = (sort: SortByKeys) => {
|
||||
setSortBy(sort);
|
||||
callList({ sortBy: sort });
|
||||
const onClickToSort = (sort: SortTypeKeys) => {
|
||||
setSortType(sort);
|
||||
callList({
|
||||
sortType: sort
|
||||
});
|
||||
};
|
||||
|
||||
const onClickToOpenFilter = () => {
|
||||
@@ -153,11 +156,11 @@ export const LinkPaymentHistoryWrap = () => {
|
||||
</section>
|
||||
|
||||
<div className="filter-section">
|
||||
<SortOptionsBox
|
||||
sortBy={sortBy}
|
||||
onClickToSort={onClickToSort}
|
||||
<SortTypeBox
|
||||
sortType={ sortType }
|
||||
onClickToSort={ onClickToSort }
|
||||
>
|
||||
</SortOptionsBox>
|
||||
</SortTypeBox>
|
||||
<div className="excrow">
|
||||
<div className="full-menu-keywords no-padding">
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user