Skip to content

Commit

Permalink
EPMRPP-96273 || Header blinks when opening 'Projects' page without pr… (
Browse files Browse the repository at this point in the history
#4126)

* EPMRPP-96273 || Header blinks when opening 'Projects' page without projects

* refactor: remove redundant code

* refactor: make changes according to comments
  • Loading branch information
iso9000t authored Dec 10, 2024
1 parent 1bd2f47 commit 227e972
Showing 1 changed file with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,6 @@ export const OrganizationProjectsPage = () => {
};

const getEmptyPageState = () => {
if (organizationLoading || projectsLoading) {
return (
<div className={cx('loader')}>
<BubblesLoader />
</div>
);
}
return searchValue === null ? (
<EmptyPageState
hasPermission={hasPermission}
Expand All @@ -118,6 +111,22 @@ export const OrganizationProjectsPage = () => {
);
};

const renderContent = () => {
if (organizationLoading || projectsLoading) {
return (
<div className={cx('loader')}>
<BubblesLoader />
</div>
);
}

if (isProjectsEmpty) {
return getEmptyPageState();
}

return <ProjectsListTableWrapper projects={projectsWithAssignedRoles} />;
};

return (
<ScrollWrapper>
<div className={cx('organization-projects-container')}>
Expand All @@ -127,11 +136,7 @@ export const OrganizationProjectsPage = () => {
searchValue={searchValue}
setSearchValue={setSearchValue}
/>
{isProjectsEmpty ? (
getEmptyPageState()
) : (
<ProjectsListTableWrapper projects={projectsWithAssignedRoles} />
)}
{renderContent()}
</div>
</ScrollWrapper>
);
Expand Down

0 comments on commit 227e972

Please sign in to comment.