Skip to content

Commit

Permalink
⚰️ Removed dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
abdheshnayak committed Mar 11, 2024
1 parent 06b8746 commit ef628c5
Showing 1 changed file with 40 additions and 52 deletions.
92 changes: 40 additions & 52 deletions src/apps/console/routes/_main+/$account+/projects/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { IRemixCtx } from '~/root/lib/types/common';
import fake from '~/root/fake-data-generator/fake';
import { ensureAccountSet } from '~/console/server/utils/auth-utils';
import { GQLServerHandler } from '~/console/server/gql/saved-queries';
import { useReload } from '~/root/lib/client/helpers/reloader';
import Tools from './tools';
import ProjectResourcesV2 from './project-resources-v2';

Expand Down Expand Up @@ -154,58 +153,47 @@ const Projects = () => {
};
};

const reloadPage = useReload();

return (
<div>
<div
onClick={() => {
reloadPage();
}}
>
reloadPage
</div>
<LoadingComp
data={promise}
skeletonData={{
projectsData: fake.ConsoleListProjectsQuery.core_listProjects as any,
clustersCount: 1,
cloudProviderSecretsCount: 1,
}}
>
{({ projectsData, clustersCount, cloudProviderSecretsCount }) => {
const projects = projectsData.edges?.map(({ node }) => node);
if (!projects) {
return null;
}

return (
<Wrapper
header={{
title: 'Projects',
action: projects.length > 0 && (
<Button
variant="primary"
content="Create Project"
prefix={<PlusFill />}
to={`/${account}/new-project`}
LinkComponent={Link}
/>
),
}}
empty={getEmptyState({
projectLength: projects.length,
clustersLength: clustersCount,
secretsLength: cloudProviderSecretsCount,
})}
tools={<Tools />}
>
<ProjectResourcesV2 items={projects} />
</Wrapper>
);
}}
</LoadingComp>
</div>
<LoadingComp
data={promise}
skeletonData={{
projectsData: fake.ConsoleListProjectsQuery.core_listProjects as any,
clustersCount: 1,
cloudProviderSecretsCount: 1,
}}
>
{({ projectsData, clustersCount, cloudProviderSecretsCount }) => {
const projects = projectsData.edges?.map(({ node }) => node);
if (!projects) {
return null;
}

return (
<Wrapper
header={{
title: 'Projects',
action: projects.length > 0 && (
<Button
variant="primary"
content="Create Project"
prefix={<PlusFill />}
to={`/${account}/new-project`}
LinkComponent={Link}
/>
),
}}
empty={getEmptyState({
projectLength: projects.length,
clustersLength: clustersCount,
secretsLength: cloudProviderSecretsCount,
})}
tools={<Tools />}
>
<ProjectResourcesV2 items={projects} />
</Wrapper>
);
}}
</LoadingComp>
);
};

Expand Down

0 comments on commit ef628c5

Please sign in to comment.