Skip to content

Commit

Permalink
feat: additional tag filtering logic
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonNotJson committed Sep 11, 2023
1 parent 5359cf8 commit f89650b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/forum/src/components/Board.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const Board = ({ triggerRefresh, setBoard }: any) => {

useEffect(() => {
setCurrentTags([]);
}, [boardSlug]);
}, [boardSlug, triggerRefresh]);

useEffect(() => {
if (tags.length > 0 || currentTags.length > 0) setTags(currentTags);
Expand Down
9 changes: 4 additions & 5 deletions apps/forum/src/components/SearchTags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const SearchTags: React.FC<Props> = ({ isShow, closeModal, boardSlug }) => {
event.preventDefault();
setTagsSelected(selectedTags);
setQuery("");
setSelectedTags([]);
closeModal();
};

Expand All @@ -73,7 +74,7 @@ const SearchTags: React.FC<Props> = ({ isShow, closeModal, boardSlug }) => {
</h5>
</div>
{/* SEARCH COMPONENT PART */}
<div className="modal-body flex flex-col flex flex-col max-h-[70vh] overflow-y-auto">
<div className="modal-body flex flex-col flex flex-col max-h-[60vh] overflow-y-auto">
<div>
<input
type="text"
Expand Down Expand Up @@ -108,9 +109,7 @@ const SearchTags: React.FC<Props> = ({ isShow, closeModal, boardSlug }) => {
className="inline-block bg-light-card2 hover:bg-light-card3 dark:bg-dark-card1 dark:hover:bg-dark-card2 w-24 px-2 py-1 rounded-full mb-2 font-sans overflow-hidden text-light-text1 dark:text-dark-text1"
onClick={() => handleClick(tag)}
>
<div className="whitespace-nowrap overflow-ellipsis overflow-hidden">
{tag}
</div>
<div className="">{tag}</div>
</button>
))}
</div>
Expand All @@ -126,7 +125,7 @@ const SearchTags: React.FC<Props> = ({ isShow, closeModal, boardSlug }) => {
setSelectedTags(selectedTags.filter((item) => item !== tag))
}
>
{tag}
<div className="whitespace-nowrap overflow-hidden">{tag}</div>
</button>
))}
</div>
Expand Down

0 comments on commit f89650b

Please sign in to comment.