Skip to content

Commit 77de460

Browse files
committed
태그버튼 삭제
1 parent 928daa7 commit 77de460

2 files changed

Lines changed: 10 additions & 166 deletions

File tree

src/components/community/Community.css

Lines changed: 0 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,6 @@
262262
background: var(--community-surface);
263263
}
264264

265-
.tag-search-row {
266-
align-items: flex-start;
267-
flex-wrap: wrap;
268-
}
269-
270265
.search-row input {
271266
flex: 1;
272267
min-width: 0;
@@ -294,60 +289,6 @@
294289
transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
295290
}
296291

297-
.tag-search-selector {
298-
flex: 1 1 0;
299-
min-width: 0;
300-
display: flex;
301-
flex-wrap: wrap;
302-
gap: 8px;
303-
}
304-
305-
.tag-search-option {
306-
padding: 10px 16px;
307-
border-radius: 999px;
308-
border: 1px solid rgba(124, 92, 255, 0.22);
309-
background: rgba(124, 92, 255, 0.08);
310-
color: var(--community-muted);
311-
font-size: 13px;
312-
font-weight: 600;
313-
cursor: pointer;
314-
-webkit-appearance: none;
315-
appearance: none;
316-
transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
317-
}
318-
319-
.tag-search-option:hover:not(:disabled) {
320-
transform: translateY(-1px);
321-
background: rgba(124, 92, 255, 0.16);
322-
border-color: rgba(124, 92, 255, 0.34);
323-
color: var(--community-text);
324-
box-shadow: 0 14px 24px -20px rgba(124, 92, 255, 0.4);
325-
}
326-
327-
.tag-search-option.is-active {
328-
background: var(--community-accent);
329-
border-color: var(--community-accent);
330-
color: #ffffff;
331-
box-shadow: 0 16px 32px -24px rgba(124, 92, 255, 0.6);
332-
}
333-
334-
.tag-search-option:disabled {
335-
cursor: not-allowed;
336-
opacity: 0.55;
337-
box-shadow: none;
338-
}
339-
340-
.tag-search-option:focus-visible {
341-
outline: 2px solid rgba(124, 92, 255, 0.55);
342-
outline-offset: 2px;
343-
}
344-
345-
.tag-search-helper {
346-
margin: 4px 0 0;
347-
font-size: 12px;
348-
color: var(--community-muted);
349-
}
350-
351292
.search-btn {
352293
background: var(--community-accent);
353294
color: #ffffff;
@@ -360,12 +301,6 @@
360301
box-shadow: 0 22px 36px -24px rgba(124, 92, 255, 0.7);
361302
}
362303

363-
.reset-btn {
364-
border: 1px solid var(--community-border);
365-
background: var(--community-surface);
366-
color: var(--community-muted);
367-
}
368-
369304
.filter-area {
370305
display: flex;
371306
align-items: center;
@@ -816,22 +751,6 @@
816751
display: none;
817752
}
818753

819-
.search-row {
820-
flex-direction: column;
821-
}
822-
823-
.tag-search-row {
824-
align-items: stretch;
825-
}
826-
827-
.tag-search-selector {
828-
width: 100%;
829-
}
830-
831-
.tag-search-helper {
832-
text-align: left;
833-
}
834-
835754
.search-row button {
836755
width: 100%;
837756
}

src/components/community/Community.jsx

Lines changed: 10 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ import { useNavigate } from "react-router-dom";
33
import "./Community.css";
44
import config from "../../config";
55

6-
const ALLOWED_TAGS = [
7-
"JAVA", "C", "CPP", "JPA", "JAVASCRIPT", "PYTHON", "OOP", "BIGDATA", "SPRING", "TYPESCRIPT", "ML"
8-
];
9-
106
const SEARCH_SCOPE_OPTIONS = [
117
{ value: "all", label: "전체" },
128
{ value: "author", label: "작성자" },
@@ -55,8 +51,6 @@ export default function Community() {
5551
const [searchOperator, setSearchOperator] = useState(DEFAULT_OPERATOR);
5652

5753
const PAGE_SIZE = 10;
58-
const selectedTagCount = selectedTagFilters.length;
59-
const reachedTagFilterLimit = selectedTagCount >= 10;
6054

6155
useEffect(() => {
6256
let ignore = false;
@@ -264,39 +258,6 @@ export default function Community() {
264258
setLastKnownPage(1);
265259
};
266260

267-
const handleReset = () => {
268-
setSearchInput("");
269-
setKeyword("");
270-
setSelectedTagFilters([]);
271-
setTagKeyword([]);
272-
setSearchScope(DEFAULT_SCOPE);
273-
setSearchOperator(DEFAULT_OPERATOR);
274-
setCurrentPage(1);
275-
setLastKnownPage(1);
276-
};
277-
278-
const toggleTagFilter = (tag, { resetSearch = false } = {}) => {
279-
setSelectedTagFilters((prev) => {
280-
if (prev.includes(tag)) {
281-
const next = prev.filter((item) => item !== tag);
282-
setTagKeyword(next.map((item) => item.toLowerCase()));
283-
return next;
284-
}
285-
if (prev.length >= 10) {
286-
return prev;
287-
}
288-
const next = [...prev, tag];
289-
setTagKeyword(next.map((item) => item.toLowerCase()));
290-
return next;
291-
});
292-
if (resetSearch) {
293-
setSearchInput("");
294-
setKeyword("");
295-
}
296-
setCurrentPage(1);
297-
setLastKnownPage(1);
298-
};
299-
300261
const handleTopWriterSelect = useCallback((writerName) => {
301262
const trimmed = (writerName || "").trim();
302263
if (!trimmed) return;
@@ -555,16 +516,6 @@ export default function Community() {
555516
</div>
556517

557518
<div className="search-bar">
558-
<form className="search-row" onSubmit={handleSearchSubmit}>
559-
<input
560-
type="search"
561-
placeholder="궁금한 질문을 검색해보세요!"
562-
value={searchInput}
563-
onChange={(event) => setSearchInput(event.target.value)}
564-
aria-label="게시글 검색"
565-
/>
566-
<button type="submit" className="search-btn">검색</button>
567-
</form>
568519
<div className="search-options">
569520
<div className="search-option">
570521
<label htmlFor="community-search-scope">검색 대상</label>
@@ -603,42 +554,16 @@ export default function Community() {
603554
</select>
604555
</div>
605556
</div>
606-
<div className="search-row tag-search-row" role="presentation">
607-
<div
608-
className="tag-search-selector"
609-
role="group"
610-
aria-label="태그 검색"
611-
>
612-
{ALLOWED_TAGS.map((tag) => {
613-
const isActive = selectedTagFilters.includes(tag);
614-
const isDisabled = !isActive && reachedTagFilterLimit;
615-
const printable = `#${tag.toLowerCase()}`;
616-
const buttonLabel = isActive
617-
? `${printable} 태그 필터 제거`
618-
: isDisabled
619-
? "태그 필터는 최대 10개까지 선택할 수 있어요"
620-
: `${printable} 태그 필터 추가`;
621-
return (
622-
<button
623-
key={tag}
624-
type="button"
625-
className={`tag-search-option ${isActive ? "is-active" : ""}`.trim()}
626-
onClick={() => toggleTagFilter(tag)}
627-
aria-pressed={isActive}
628-
disabled={isDisabled}
629-
title={buttonLabel}
630-
>
631-
{printable}
632-
</button>
633-
);
634-
})}
635-
</div>
636-
<button type="button" className="reset-btn" onClick={handleReset}>초기화</button>
637-
</div>
638-
<p className="tag-search-helper" aria-live="polite">
639-
태그는 클릭해서 추가하거나 제거할 수 있어요. 선택 {selectedTagCount}
640-
{reachedTagFilterLimit ? " (최대 10개 선택됨)" : ""}
641-
</p>
557+
<form className="search-row" onSubmit={handleSearchSubmit}>
558+
<input
559+
type="search"
560+
placeholder="궁금한 질문을 검색해보세요!"
561+
value={searchInput}
562+
onChange={(event) => setSearchInput(event.target.value)}
563+
aria-label="게시글 검색"
564+
/>
565+
<button type="submit" className="search-btn">검색</button>
566+
</form>
642567
</div>
643568

644569
<div className="filter-area">

0 commit comments

Comments
 (0)