Skip to content
This repository has been archived by the owner on Apr 22, 2022. It is now read-only.

Commit

Permalink
Fix edit delete action (#26)
Browse files Browse the repository at this point in the history
* Fix edit delete

* fix storybook
  • Loading branch information
carlosthe19916 authored Jan 4, 2021
1 parent 498a159 commit 316045d
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 37 deletions.
76 changes: 39 additions & 37 deletions src/pages/companies/edit-company/edit-company-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useEffect } from "react";
import { useHistory, useParams } from "react-router-dom";
import { useDispatch } from "react-redux";

import { Alert, Skeleton } from "@patternfly/react-core";
import { Alert, PageSection, Skeleton } from "@patternfly/react-core";

import { useDeleteCompany, useFetchCompany } from "shared/hooks";

Expand Down Expand Up @@ -82,41 +82,43 @@ export const EditCompanyHeader: React.FC<EditCompanyHeaderProps> = () => {
}

return (
<ConditionalRender
when={isFetching}
then={<Skeleton screenreaderText="Loading contents" />}
>
<PageHeader
title={params.company}
breadcrumbs={[
{
title: "Companies",
path: Paths.companyList,
},
{
title: "Company details",
path: Paths.editCompany,
},
]}
menuActions={[
{ label: "Edit", callback: handleOnEdit },
{ label: "Delete", callback: handleOnDelete },
]}
navItems={[
{
title: "Overview",
path: formatPath(Paths.editCompany_overview, {
company: params.company,
}),
},
{
title: "SUNAT",
path: formatPath(Paths.editCompany_sunat, {
company: params.company,
}),
},
]}
/>
</ConditionalRender>
<PageSection variant="light">
<ConditionalRender
when={isFetching}
then={<Skeleton screenreaderText="Loading contents" />}
>
<PageHeader
title={params.company}
breadcrumbs={[
{
title: "Companies",
path: Paths.companyList,
},
{
title: "Company details",
path: Paths.editCompany,
},
]}
menuActions={[
{ label: "Edit", callback: handleOnEdit },
{ label: "Delete", callback: handleOnDelete },
]}
navItems={[
{
title: "Overview",
path: formatPath(Paths.editCompany_overview, {
company: params.company,
}),
},
{
title: "SUNAT",
path: formatPath(Paths.editCompany_sunat, {
company: params.company,
}),
},
]}
/>
</ConditionalRender>
</PageSection>
);
};
2 changes: 2 additions & 0 deletions src/pages/companies/edit-company/edit-company.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Redirect, Route, RouteComponentProps, Switch } from "react-router-dom";
import { PageSection } from "@patternfly/react-core";

import { AppPlaceholder } from "shared/components";
import { DeleteWithMatchModalContainer } from "shared/containers";

import { CompanytRoute, Paths } from "Paths";

Expand Down Expand Up @@ -36,6 +37,7 @@ export const EditCompany: React.FC<AnalysisConfigurationProps> = ({
</Switch>
</Suspense>
</PageSection>
<DeleteWithMatchModalContainer />
</>
);
};

0 comments on commit 316045d

Please sign in to comment.