Skip to content

Commit

Permalink
feat: feat: Show user created projects only
Browse files Browse the repository at this point in the history
  • Loading branch information
bindeali committed Jan 20, 2025
1 parent c1ca0ee commit f643dfd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/project/Projects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ const Projects: React.FC = () => {
const [filterText, setFilterText] = useState("");
const filteredProjects = useMemo(() => {
return data.filter((project) => {
if (filterText === "") return true;
if (project.author.id === sub) return true;
if (project.author.id !== sub) return false;
else {
return project.label.toLowerCase().includes(filterText.toLowerCase());
return filterText === ""
? true
: project.label.toLowerCase().includes(filterText.toLowerCase());
}
});
}, [data, filterText, sub]);
Expand Down

0 comments on commit f643dfd

Please sign in to comment.