정렬 박스 및 드랍다운 섹션 화살표 공통화 처리
This commit is contained in:
@@ -1,13 +1,5 @@
|
||||
import { DefaulResponsePagination, DefaultRequestPagination } from '@/entities/common/model/types';
|
||||
|
||||
export enum SortByKeys {
|
||||
New = 'New',
|
||||
Amount = 'Amount',
|
||||
};
|
||||
export interface SortOptionsBoxProps {
|
||||
sortBy: SortByKeys;
|
||||
onClickToSort: (sortBy: SortByKeys) => void;
|
||||
};
|
||||
export enum SettlementTabKeys {
|
||||
Calendar = 'calendar',
|
||||
List = 'list'
|
||||
|
||||
@@ -6,7 +6,7 @@ import { ListDateGroup } from './list-date-group';
|
||||
import { PATHS } from '@/shared/constants/paths';
|
||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||
import { DEFAULT_PAGE_PARAM } from '@/entities/common/model/constant';
|
||||
import { SortOptionsBox } from '@/entities/settlement/ui/sort-options-box';
|
||||
import { SortOptionsBox } from '@/entities/common/ui/sort-options-box';
|
||||
import { useSettlementsHistoryMutation } from '../api/use-settlements-history-mutation';
|
||||
import { useSettlementsHistorySummaryMutation } from '../api/use-settlements-history-summary-mutation';
|
||||
import { useSettlementsTransactionSummaryMutation } from '../api/use-settlements-transaction-summary-mutation';
|
||||
@@ -18,13 +18,13 @@ import 'react-slidedown/lib/slidedown.css';
|
||||
import { ListFilter } from './filter/list-filter';
|
||||
import { useDownloadExcelMutation } from '@/entities/transaction/api/use-download-excel-mutation';
|
||||
import {
|
||||
SortByKeys,
|
||||
SettlementPeriodType,
|
||||
SettlementPaymentMethod,
|
||||
SettlementsHistoryContent,
|
||||
ListDateGroupProps,
|
||||
SettlementsTransactionListContent
|
||||
} from '@/entities/settlement/model/types';
|
||||
} from '../model/types';
|
||||
import { SortByKeys } from '@/entities/common/model/types';
|
||||
|
||||
export interface ListWrapProps {
|
||||
startDateFromCalendar?: string;
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
import { SortByKeys, SortOptionsBoxProps } from '../model/types';
|
||||
export const SortOptionsBox = ({
|
||||
sortBy,
|
||||
onClickToSort
|
||||
}: SortOptionsBoxProps) => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="sort-options">
|
||||
<button
|
||||
className={ `sort-btn ${(sortBy === SortByKeys.New)? 'active': ''}` }
|
||||
onClick={ () => onClickToSort(SortByKeys.New) }
|
||||
>최신순</button>
|
||||
<span className="sort-divider">|</span>
|
||||
<button
|
||||
className={ `sort-btn ${(sortBy === SortByKeys.Amount)? 'active': ''}` }
|
||||
onClick={ () => onClickToSort(SortByKeys.Amount) }
|
||||
>고액순</button>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user