fixed storyshots with react-diff-view

This commit is contained in:
Sebastian Sdorra
2020-01-06 14:48:32 +01:00
parent 04e533d92e
commit 3e1828eb12
3 changed files with 16438 additions and 4 deletions

View File

@@ -16,14 +16,17 @@ storiesOf("Diff", module)
.add("Collapsed", () => <Diff diff={diffFiles} defaultCollapse={true} />)
.add("File Controls", () => <Diff diff={diffFiles} fileControlFactory={() => <Button>Custom Control</Button>} />)
.add("File Annotation", () => (
<Diff diff={diffFiles} fileAnnotationFactory={file => [<p>Custom File annotation for {file.newPath}</p>]} />
<Diff
diff={diffFiles}
fileAnnotationFactory={file => [<p key={file.newPath}>Custom File annotation for {file.newPath}</p>]}
/>
))
.add("Line Annotation", () => (
<Diff
diff={diffFiles}
annotationFactory={ctx => {
return {
N2: [<p>Line Annotation</p>]
N2: <p key="N2">Line Annotation</p>
};
}}
/>