mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: ignore dynamic content on chromatic (#16214)
This commit is contained in:
@@ -128,7 +128,9 @@ const ErrorStack: FC<ErrorStackProps> = ({ error }) => {
|
||||
</p>
|
||||
{error.stack && (
|
||||
<pre className="m-0 py-2 px-0 overflow-x-auto text-xs">
|
||||
<code data-testid="code">{error.stack}</code>
|
||||
<code data-testid="code" data-chromatic="ignore">
|
||||
{error.stack}
|
||||
</code>
|
||||
</pre>
|
||||
)}
|
||||
</>
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
import isChromatic from "chromatic/isChromatic";
|
||||
import type { FC } from "react";
|
||||
import { Helmet } from "react-helmet-async";
|
||||
import { pageTitle } from "utils/page";
|
||||
import { CliInstallPageView } from "./CliInstallPageView";
|
||||
|
||||
export const CliInstallPage: FC = () => {
|
||||
const origin = isChromatic() ? "https://example.com" : window.location.origin;
|
||||
|
||||
return (
|
||||
<>
|
||||
<Helmet>
|
||||
<title>{pageTitle("Install the Coder CLI")}</title>
|
||||
</Helmet>
|
||||
<CliInstallPageView />
|
||||
<CliInstallPageView origin={origin} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -4,6 +4,9 @@ import { CliInstallPageView } from "./CliInstallPageView";
|
||||
const meta: Meta<typeof CliInstallPageView> = {
|
||||
title: "pages/CliInstallPage",
|
||||
component: CliInstallPageView,
|
||||
args: {
|
||||
origin: "https://example.com",
|
||||
},
|
||||
};
|
||||
|
||||
export default meta;
|
||||
|
||||
@@ -4,9 +4,11 @@ import { Welcome } from "components/Welcome/Welcome";
|
||||
import type { FC } from "react";
|
||||
import { Link as RouterLink } from "react-router-dom";
|
||||
|
||||
export const CliInstallPageView: FC = () => {
|
||||
const origin = location.origin;
|
||||
type CliInstallPageViewProps = {
|
||||
origin: string;
|
||||
};
|
||||
|
||||
export const CliInstallPageView: FC<CliInstallPageViewProps> = ({ origin }) => {
|
||||
return (
|
||||
<div css={styles.container}>
|
||||
<Welcome>Install the Coder CLI</Welcome>
|
||||
@@ -18,7 +20,6 @@ export const CliInstallPageView: FC = () => {
|
||||
|
||||
<CodeExample
|
||||
css={{ maxWidth: "100%" }}
|
||||
data-chromatic="ignore"
|
||||
code={`curl -fsSL ${origin}/install.sh | sh`}
|
||||
secret={false}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user