Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0fa6b3d

Browse files
chore: ignore dynamic content on chromatic (#16214)
1 parentf8844ca commit0fa6b3d

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

‎site/src/components/ErrorBoundary/GlobalErrorBoundary.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ const ErrorStack: FC<ErrorStackProps> = ({ error }) => {
128128
</p>
129129
{error.stack&&(
130130
<preclassName="m-0 py-2 px-0 overflow-x-auto text-xs">
131-
<codedata-testid="code">{error.stack}</code>
131+
<codedata-testid="code"data-chromatic="ignore">
132+
{error.stack}
133+
</code>
132134
</pre>
133135
)}
134136
</>

‎site/src/pages/CliInstallPage/CliInstallPage.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1+
importisChromaticfrom"chromatic/isChromatic";
12
importtype{FC}from"react";
23
import{Helmet}from"react-helmet-async";
34
import{pageTitle}from"utils/page";
45
import{CliInstallPageView}from"./CliInstallPageView";
56

67
exportconstCliInstallPage:FC=()=>{
8+
constorigin=isChromatic() ?"https://example.com" :window.location.origin;
9+
710
return(
811
<>
912
<Helmet>
1013
<title>{pageTitle("Install the Coder CLI")}</title>
1114
</Helmet>
12-
<CliInstallPageView/>
15+
<CliInstallPageVieworigin={origin}/>
1316
</>
1417
);
1518
};

‎site/src/pages/CliInstallPage/CliInstallPageView.stories.tsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import { CliInstallPageView } from "./CliInstallPageView";
44
constmeta:Meta<typeofCliInstallPageView>={
55
title:"pages/CliInstallPage",
66
component:CliInstallPageView,
7+
args:{
8+
origin:"https://example.com",
9+
},
710
};
811

912
exportdefaultmeta;

‎site/src/pages/CliInstallPage/CliInstallPageView.tsx‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ import { Welcome } from "components/Welcome/Welcome";
44
importtype{FC}from"react";
55
import{LinkasRouterLink}from"react-router-dom";
66

7-
exportconstCliInstallPageView:FC=()=>{
8-
constorigin=location.origin;
7+
typeCliInstallPageViewProps={
8+
origin:string;
9+
};
910

11+
exportconstCliInstallPageView:FC<CliInstallPageViewProps>=({ origin})=>{
1012
return(
1113
<divcss={styles.container}>
1214
<Welcome>Install the Coder CLI</Welcome>
@@ -18,7 +20,6 @@ export const CliInstallPageView: FC = () => {
1820

1921
<CodeExample
2022
css={{maxWidth:"100%"}}
21-
data-chromatic="ignore"
2223
code={`curl -fsSL${origin}/install.sh | sh`}
2324
secret={false}
2425
/>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp