Skip to content

[ERP-2110 & ERP-2111] Replaced all remaining Alert and Text Components #30

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

Merged
merged 3 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
9 changes: 6 additions & 3 deletions src/components/tool/guide/Config/AlertHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export default function AlertHelper({
alertType = "info",
alertMsg = null,
onClose = {},
children = null,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really a fan of having two different props to set the same thing, as you have to know internal details of the component in order to know which prop has precedent. Is there a reason to not use one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually we can just make one props to support multiple types.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

}) {
return (
<>
Expand All @@ -13,9 +14,11 @@ export default function AlertHelper({
<Box w="100%">
<Alert display="flex" status={alertType}>
<AlertIcon />
{alertMsg && typeof alertMsg === "function"
? alertMsg()
: `${alertMsg}`}
{children
? children
: alertMsg && typeof alertMsg === "function"
? alertMsg()
: `${alertMsg}`}
{alertDismissible && (
<CloseButton
size="sm"
Expand Down
30 changes: 14 additions & 16 deletions src/components/tool/guide/Instructions/ConnectInstructions.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,6 @@ import InstructionText from "./components/InstructionText";
import { OperatingSystemTabs } from "./components/OperatingSystemTabs";

function LyraInstructions({ username }) {
const enableSSHText = () => {
return (
<TextWithLink
textBeforeLink={"You may need to enable the "}
link={{
href: "https://learn.microsoft.com/en-us/windows/terminal/tutorials/ssh",
text: "ssh feature",
isExternal: true,
}}
hasExternalIcon={false}
textAfterLink={" in Windows."}
/>
);
};
return (
<>
<InstructionHeading>Connect to Lyra</InstructionHeading>
Expand All @@ -46,9 +32,21 @@ function LyraInstructions({ username }) {
<Box>
<AlertHelper
alertType={"info"}
alertMsg={enableSSHText}
// alertMsg={enableSSHText}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

alertDismissible={false}
/>
>
<TextWithLink
textBeforeLink={"You may need to enable the "}
link={{
href: "https://learn.microsoft.com/en-us/windows/terminal/tutorials/ssh",
text: "ssh feature",
color: "blue.500",
isExternal: true,
}}
hasExternalIcon={false}
textAfterLink={" in Windows."}
/>
</AlertHelper>
<InstructionText>
<Flex alignItems={"center"}>
<TextWithLink
Expand Down
Loading