Skip to content

feat(site): add numbers to SSHButton content for clarity #15661

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 8 commits into from
Dec 12, 2024
Prev Previous commit
Next Next commit
Use HTML <li> tags instead of numbering directly
  • Loading branch information
benwinding committed Nov 28, 2024
commit e80c9a88da9d727f5c9ff0a33f7ebbc2fdd4b5d1
41 changes: 20 additions & 21 deletions site/src/modules/resources/SSHButton/SSHButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,28 +48,18 @@ export const SSHButton: FC<SSHButtonProps> = ({
Run the following commands to connect with SSH:
</HelpTooltipText>

<Stack spacing={0.5} css={styles.codeExamples}>
<div>
<HelpTooltipText>
<strong css={styles.codeExampleLabel}>
1. Configure SSH hosts on machine:
</strong>
</HelpTooltipText>
<CodeExample secret={false} code="coder config-ssh" />
</div>

<div>
<HelpTooltipText>
<strong css={styles.codeExampleLabel}>
2. Connect to the agent:
</strong>
</HelpTooltipText>
<CodeExample
secret={false}
code={`ssh ${sshPrefix}${workspaceName}.${agentName}`}
<ol style={{ margin: 0, padding: 0 }}>
<Stack spacing={0.5} css={styles.codeExamples}>
<SSHStep
helpText="Configure SSH hosts on machine:"
codeExample="coder config-ssh"
/>
<SSHStep
helpText="Connect to the agent:"
codeExample={`ssh ${sshPrefix}${workspaceName}.${agentName}`}
/>
</div>
</Stack>
</Stack>
</ol>

<HelpTooltipLinksGroup>
<HelpTooltipLink href={docs("/install")}>
Expand All @@ -92,6 +82,15 @@ export const SSHButton: FC<SSHButtonProps> = ({
);
};

const SSHStep = (props: { helpText: string; codeExample: string }) => (
<li style={{ listStylePosition: "inside" }}>
<HelpTooltipText style={{ display: "inline" }}>
<strong css={styles.codeExampleLabel}>Connect to the agent:</strong>
</HelpTooltipText>
<CodeExample secret={false} code={props.codeExample} />
</li>
);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for reviewing @aslilac 🙏

Changed to use semantic HTML <li> tags (did it naively to reduce changes, but agree semantic html is better)

image


const classNames = {
paper: (css, theme) => css`
padding: 16px 24px 24px;
Expand Down
Loading