sort 관련 정리
This commit is contained in:
@@ -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>
|
||||
</>
|
||||
);
|
||||
};
|
||||
22
src/entities/common/ui/sort-type-box.tsx
Normal file
22
src/entities/common/ui/sort-type-box.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import { SortTypeKeys, SortTypeBoxProps } from '../model/types';
|
||||
export const SortTypeBox = ({
|
||||
sortType,
|
||||
onClickToSort
|
||||
}: SortTypeBoxProps) => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="sort-options">
|
||||
<button
|
||||
className={ `sort-btn ${(sortType === SortTypeKeys.LATEST)? 'active': ''}` }
|
||||
onClick={ () => onClickToSort(SortTypeKeys.LATEST) }
|
||||
>최신순</button>
|
||||
<span className="sort-divider">|</span>
|
||||
<button
|
||||
className={ `sort-btn ${(sortType === SortTypeKeys.HIGH_AMOUNT)? 'active': ''}` }
|
||||
onClick={ () => onClickToSort(SortTypeKeys.HIGH_AMOUNT) }
|
||||
>고액순</button>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user