Skip to content

Commit

Permalink
[projects] fix search input on /new
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexTugarev authored and roboquat committed Aug 25, 2021
1 parent fe14141 commit dec92c5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions components/dashboard/src/projects/NewProject.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,11 @@ export default function NewProject() {
const renderSelectRepository = () => {

const noReposAvailable = reposInAccounts.length === 0;
const filteredRepos = Array.from(reposInAccounts).filter(r => r.account === selectedAccount && r.name.includes(repoSearchFilter));
const filteredRepos = Array.from(reposInAccounts).filter(r => r.account === selectedAccount && `${r.name}`.toLowerCase().includes(repoSearchFilter.toLowerCase()));
const icon = selectedAccount && accounts.get(selectedAccount)?.avatarUrl;

const showSearchInput = !!repoSearchFilter || filteredRepos.length > 0;

const renderRepos = () => (<>
<div className={`mt-10 border rounded-xl border-gray-100 flex-col`}>
<div className="px-8 pt-8 flex flex-col space-y-2">
Expand All @@ -229,7 +231,7 @@ export default function NewProject() {
<img src={CaretDown} title="Select Account" className="filter-grayscale absolute top-1/2 right-3" />
</div>
</ContextMenu>
{filteredRepos.length > 0 && (
{showSearchInput && (
<div className="w-full relative ">
<img src={search} title="Search" className="filter-grayscale absolute top-1/3 left-3" />
<input className="w-96 pl-10 border-0" type="text" placeholder="Search Repositories" value={repoSearchFilter}
Expand Down

0 comments on commit dec92c5

Please sign in to comment.