Skip to content

Commit

Permalink
feat(pools): use MainToolbar on pools list header MAASENG-2520 (#5258)
Browse files Browse the repository at this point in the history
  • Loading branch information
ndv99 authored Jan 8, 2024
1 parent f60aeac commit 4ee6421
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions src/app/pools/views/Pools.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { MainToolbar } from "@canonical/maas-react-components";
import { Button } from "@canonical/react-components";
import pluralize from "pluralize";
import { useSelector } from "react-redux";
Expand All @@ -6,7 +7,6 @@ import { Link, Route, Routes } from "react-router-dom-v5-compat";
import PoolList from "./PoolList";

import PageContent from "app/base/components/PageContent";
import MachinesHeader from "app/base/components/node/MachinesHeader";
import { useFetchActions } from "app/base/hooks";
import urls from "app/base/urls";
import NotFound from "app/base/views/NotFound";
Expand All @@ -29,20 +29,17 @@ const Pools = (): JSX.Element => {
return (
<PageContent
header={
<MachinesHeader
buttons={[
<MainToolbar>
<MainToolbar.Title>
<Link to={urls.machines.index}>{machineCount} machines </Link>
in {resourcePoolsCount} {pluralize("pool", resourcePoolsCount)}
</MainToolbar.Title>
<MainToolbar.Controls>
<Button data-testid="add-pool" element={Link} to={urls.pools.add}>
Add pool
</Button>,
]}
machineCount={machineCount}
title={
<>
<Link to={urls.machines.index}>{machineCount} machines </Link>
in {resourcePoolsCount} {pluralize("pool", resourcePoolsCount)}
</>
}
/>
</Button>
</MainToolbar.Controls>
</MainToolbar>
}
sidePanelContent={null}
sidePanelTitle={null}
Expand Down

0 comments on commit 4ee6421

Please sign in to comment.