Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the empty project logic #57

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion renderer/src/components/Projects/ProjectList.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default function ProjectList() {
orderBy={orderBy}
onRequestSort={handleRequestSort}
/>
<ProjectRow projects={projects} filteredProjects={filteredProjects} order={order} orderBy={orderBy} showArchived={showArchived} openExportPopUp={handleExportPopUp} setCurrentProject={setCurrentProject} handleClickStarred={handleClickStarred} />
<ProjectRow projects={[]} filteredProjects={filteredProjects} order={order} orderBy={orderBy} showArchived={showArchived} openExportPopUp={handleExportPopUp} setCurrentProject={setCurrentProject} handleClickStarred={handleClickStarred} />
</table>
{(!projects) && <div><LoadingScreen /></div>}
</div>
Expand Down
15 changes: 8 additions & 7 deletions renderer/src/components/Projects/ProjectRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ const ProjectRow = ({
}
return 0;
}

return (
<tbody className="bg-white divide-y divide-gray-200" id="projects-list-body">
{projects?.length === 0 && (
{((projects?.length === 0 && filteredProjects.length > 0) || (!showArchived && projects.length === archivedProjects.length)) && (
<tr>
<td colSpan="7" className="space-y-7 px-6 py-28 whitespace-nowrap text-center">
<h2 className="font-medium text-gray-500 tracking-wide">You don&apos;t have any projects yet</h2>
Expand All @@ -87,12 +88,12 @@ const ProjectRow = ({
</tr>
)}
{
projects?.length !== 0 && filteredProjects?.length === 0 && (
<tr>
<td colSpan="7" className="space-y-7 px-6 py-28 whitespace-nowrap text-center">
<h2 className="font-medium text-gray-500 tracking-wide">No projects found. Try a different search term.</h2>
</td>
</tr>
projects.length > 0 && filteredProjects?.length === 0 && (
<tr>
<td colSpan="7" className="space-y-7 px-6 py-28 whitespace-nowrap text-center">
<h2 className="font-medium text-gray-500 tracking-wide">No projects found. Try a different search term.</h2>
</td>
</tr>
)
}
{
Expand Down