Skip to content

Commit

Permalink
[web] InstallButton: fix link to IssuesPage
Browse files Browse the repository at this point in the history
By using a link instead of a buton since it a link that navigates to a
different place, not a button that triggers an action.

Additionally, it uses HTML <strong> element for wrapping a important
message in the confirmation dialog instead of just marking it as `bold`
via CSS.
  • Loading branch information
dgdavid committed Dec 26, 2023
1 parent 4e11228 commit 7410080
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions web/src/components/core/InstallButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,34 +23,26 @@ import React, { useState } from "react";
import { useInstallerClient } from "~/context/installer";

import { Button } from "@patternfly/react-core";
import { useNavigate } from "react-router-dom";
import { Link } from "react-router-dom";

import { If, Popup } from "~/components/core";
import { _ } from "~/i18n";

const InstallConfirmationPopup = ({ hasIssues, onAccept, onClose }) => {
const navigate = useNavigate();

const IssuesWarning = () => {
const IssuesLink = ({ text }) => {
return (
<Button variant="link" isInline onClick={() => navigate("/issues")}>
{text}
</Button>
);
};

// TRANSLATORS: the installer reports some errors,
// the text in square brackets [] is a clickable link
const [msgStart, msgLink, msgEnd] = _("There are some reported issues. \
Please, check [the list of issues] \
before proceeding with the installation.").split(/[[\]]/);

return (
<p className="bold">
{msgStart}
<IssuesLink text={msgLink} />
{msgEnd}
<p>
<strong>
{msgStart}
<Link to="/issues">{msgLink}</Link>
{msgEnd}
</strong>
</p>
);
};
Expand Down

0 comments on commit 7410080

Please sign in to comment.