Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 79ae348

Browse files
committed
Add storybook
1 parent b43cb4d commit 79ae348

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { Story } from "@storybook/react"
2+
import React from "react"
3+
import { CodeBlock, CodeBlockProps } from "./index"
4+
5+
const sampleLines = `Successfully assigned coder/image-jcws7 to gke-master-workspaces-1-ef039342-cybd
6+
Container image "gcr.io/coder-dogfood/master/coder-dev-ubuntu@sha256:80604e432c039daf558edfd7c01b9ea1f62f9c4b0f30aeab954efe11c404f8ee" already present on machine
7+
Created container user
8+
Started container user
9+
Using user 'coder' with shell '/bin/bash'`.split('\n')
10+
11+
export default {
12+
title: "CodeBlock",
13+
component: CodeBlockProps,
14+
argTypes: {
15+
lines: { control: "object", defaultValue: sampleLines },
16+
},
17+
}
18+
19+
const Template: Story<CodeBlockProps> = (args) => <CodeBlock {...args} />
20+
21+
export const Example = Template.bind({})
22+
Example.args = {
23+
lines: sampleLines,
24+
}

site/components/CodeBlock/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { makeStyles } from "@material-ui/core/styles"
22
import React from "react"
33

4-
interface Props {
4+
interface CodeBlockProps {
55
lines: string[]
66
}
77

8-
export const CodeBlock: React.FC<Props> = ({ lines }) => {
8+
export const CodeBlock: React.FC<CodeBlockProps> = ({ lines }) => {
99
const styles = useStyles()
1010

1111
return (

0 commit comments

Comments
 (0)