Skip to content

Commit f47aa21

Browse files
authored
fix : 비로그인 시 localstorage에 있는 git url 들고오는 코드 이슈 수정, 문제풀이 페이지 토론 정렬 방식 select -> 나열 수정 (#136)
1 parent d7a1363 commit f47aa21

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

src/features/discussions/disussions/ui/Discussions.tsx

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff 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
아직 해당문제의 토론글이 없습니다.

0 commit comments

Comments
 (0)