File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed
src/features/discussions/disussions/ui Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -30,8 +30,7 @@ export default function Discussions({ problemId }: IDiscussionProps) {
3030 { label : '인기순' , value : '인기순' } ,
3131 { label : '최신순' , value : '최신순' } ,
3232 { label : '추천순' , value : '추천순' } ,
33- ] ;
34-
33+ ] as const ;
3534 useEffect ( ( ) => {
3635 const observer = new IntersectionObserver ( ( entries ) => {
3736 if ( entries [ 0 ] . isIntersecting && hasNextPage ) {
@@ -87,15 +86,29 @@ export default function Discussions({ problemId }: IDiscussionProps) {
8786 < p > 토론 목록을 불러오는데 실패했습니다.</ p >
8887 ) : (
8988 < div className = "flex flex-col w-full" >
90- < Select
89+ { /* <Select
9190 option={sortOptions}
9291 title="정렬"
9392 value={params.sort}
9493 setValue={(value) => {
9594 const typedValue = value as sortType;
9695 setParams((prev) => ({ ...prev, sort: typedValue, sortBy: typedValue }));
9796 }}
98- />
97+ /> */ }
98+ < div className = "flex flex-row gap-1" >
99+ { sortOptions . map ( ( item ) => {
100+ return (
101+ < span
102+ className = { `${ item . value === params . sort ? `text-secondary` : `` } ` }
103+ onClick = { ( ) => {
104+ setParams ( ( prev ) => ( { ...prev , sort : item . label , sortBy : item . label } ) ) ;
105+ } }
106+ >
107+ { item . label }
108+ </ span >
109+ ) ;
110+ } ) }
111+ </ div >
99112 { discussions . length < 1 ? (
100113 < div className = "flex justify-center text-[#ccc] mt-3" >
101114 아직 해당문제의 토론글이 없습니다.
You can’t perform that action at this time.
0 commit comments