Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add link to iso volumes from image list #738

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/pages/images/ImageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import NotificationRow from "components/NotificationRow";
import { useDocs } from "context/useDocs";
import CustomLayout from "components/CustomLayout";
import PageHeader from "components/PageHeader";
import CustomIsoBtn from "pages/storage/actions/CustomIsoBtn";

const ImageList: FC = () => {
const docBaseLink = useDocs();
Expand Down Expand Up @@ -225,6 +226,9 @@ const ImageList: FC = () => {
/>
)}
</PageHeader.Left>
<PageHeader.BaseActions>
<CustomIsoBtn project={project} />
</PageHeader.BaseActions>
</PageHeader>
}
>
Expand Down
32 changes: 32 additions & 0 deletions src/pages/storage/actions/CustomIsoBtn.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { FC } from "react";
import { Button, Icon } from "@canonical/react-components";
import { useNavigate } from "react-router-dom";

interface Props {
project: string;
}

const CustomIsoBtn: FC<Props> = ({ project }) => {
const navigate = useNavigate();
const href = `/ui/project/${project}/storage/custom-isos`;

const handleClick = () => (e: MouseEvent) => {
e.preventDefault();
navigate(href);
};

return (
<Button
className="u-no-margin--bottom u-float-right"
hasIcon
href={href}
onClick={handleClick}
element="a"
>
<span>Custom ISOs</span>
<Icon name="external-link" />
</Button>
);
};

export default CustomIsoBtn;
Loading