BOD-17 Added Contracts list page + updates and bugfixes on other pages.
This commit is contained in:
10
client/src/pages/contracts/contracts.page.component.jsx
Normal file
10
client/src/pages/contracts/contracts.page.component.jsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import React from "react";
|
||||
import ContractsList from "../../components/contracts-list/contracts-list.component";
|
||||
|
||||
export default function ContractsPageComponent({ loading, data }) {
|
||||
return (
|
||||
<div>
|
||||
<ContractsList loading={loading} contracts={data} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
19
client/src/pages/contracts/contracts.page.container.jsx
Normal file
19
client/src/pages/contracts/contracts.page.container.jsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import React from "react";
|
||||
import ContractsPageComponent from "./contracts.page.component";
|
||||
import { useQuery } from "@apollo/react-hooks";
|
||||
import { QUERY_ACTIVE_CONTRACTS } from "../../graphql/cccontracts.queries";
|
||||
import AlertComponent from "../../components/alert/alert.component";
|
||||
|
||||
export default function ContractsPageContainer() {
|
||||
const { loading, error, data } = useQuery(QUERY_ACTIVE_CONTRACTS);
|
||||
|
||||
if (error) return <AlertComponent message={error.message} type="error" />;
|
||||
return (
|
||||
<div>
|
||||
<ContractsPageComponent
|
||||
loading={loading}
|
||||
data={data ? data.cccontracts : []}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user