-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* init: storybook 세팅 * feat: storybook chromatic 배포 자동화 * refactor: CDD방식 컴포넌트 수정
- Loading branch information
Showing
20 changed files
with
361 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Workflow name | ||
name: "Chromatic Deployment" | ||
|
||
# Event for the workflow | ||
on: push | ||
|
||
# List of jobs | ||
jobs: | ||
chromatic: | ||
name: "Run Chromatic" | ||
runs-on: ubuntu-latest | ||
# Job steps | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- run: npm install | ||
#👇 Adds Chromatic as a step in the workflow | ||
- uses: chromaui/action@latest | ||
# Options required for Chromatic's GitHub Action | ||
with: | ||
#👇 Chromatic projectToken, see https://storybook.js.org/tutorials/intro-to-storybook/react/ko/deploy/ to obtain it | ||
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | ||
token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { Meta, StoryObj } from "@storybook/react"; | ||
import Header from "./header"; | ||
|
||
const meta: Meta<typeof Header> = { | ||
title: "Components/Layout/Header", | ||
component: Header, | ||
tags: ["autodocs"], | ||
parameters: { | ||
componentSubtitle: "Header", | ||
}, | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof Header>; | ||
|
||
export const Desktop: Story = { | ||
parameters: { | ||
viewport: { | ||
defaultViewport: "desktop", | ||
}, | ||
}, | ||
}; | ||
|
||
export const Ipad11Pro: Story = { | ||
parameters: { | ||
viewport: { | ||
defaultViewport: "ipad11p", | ||
}, | ||
}, | ||
}; | ||
|
||
export const Mobile: Story = { | ||
parameters: { | ||
viewport: { | ||
defaultViewport: "iphone6", | ||
}, | ||
}, | ||
}; |
12 changes: 6 additions & 6 deletions
12
src/app/_components/layout/header.tsx → src/app/_components/layout/header/header.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/app/_components/layout/rss-feed-button/rss-feed-button.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from "react"; | ||
import { Meta, StoryObj } from "@storybook/react"; | ||
import RssFeedButton from "./rss-feed-button"; | ||
|
||
const meta: Meta<typeof RssFeedButton> = { | ||
title: "Components/Layout/RssFeedButton", | ||
component: RssFeedButton, | ||
argTypes: { | ||
// 필요한 경우 props의 타입을 명시적으로 지정 | ||
}, | ||
tags: ["autodocs"], | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof RssFeedButton>; | ||
|
||
export const Default: Story = { | ||
render: () => <RssFeedButton />, | ||
}; |
6 changes: 3 additions & 3 deletions
6
...pp/_components/layout/rss-feed-button.tsx → ...ayout/rss-feed-button/rss-feed-button.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
import { Meta, StoryObj } from "@storybook/react"; | ||
import PostBody from "./post-body"; | ||
|
||
const meta: Meta<typeof PostBody> = { | ||
title: "Components/Post/PostBody", | ||
component: PostBody, | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof PostBody>; | ||
|
||
export const H2: Story = { | ||
args: { | ||
content: `## 🤔2단계 제목 | ||
`, | ||
}, | ||
}; | ||
|
||
export const H3: Story = { | ||
args: { | ||
content: `### 🤔3단계 제목`, | ||
}, | ||
}; | ||
|
||
export const Ul: Story = { | ||
args: { | ||
content: `- 순서가 없는 목록 | ||
- 순서가 없는 목록 | ||
- 순서가 없는 목록`, | ||
}, | ||
}; | ||
|
||
export const Ol: Story = { | ||
args: { | ||
content: `1. 순서가 있는 목록 | ||
2. 순서가 있는 목록 | ||
3. 순서가 있는 목록`, | ||
}, | ||
}; | ||
|
||
export const Strong: Story = { | ||
args: { | ||
content: `**굵은 텍스트**`, | ||
}, | ||
}; | ||
|
||
export const FullContent: Story = { | ||
args: { | ||
content: ` | ||
> 인용문 | ||
**굵은 텍스트** | ||
*기울임 텍스트* | ||
## 🤔2단계 제목 | ||
- 순서가 없는 목록 | ||
- 순서가 없는 목록 | ||
- 순서가 없는 목록 | ||
### 🤔3단계 제목 | ||
1. 순서가 있는 목록 | ||
2. 순서가 있는 목록 | ||
3. 순서가 있는 목록 | ||
### 🤔코드 | ||
\`\`\`typescript | ||
const example = "TypeScript"; | ||
interface Example { | ||
name: string; | ||
} | ||
\`\`\` | ||
### 🤔테이블 | ||
| 헤더1 | 헤더2 | 헤더3 | | ||
|-------|-------|-------| | ||
| 데이터1 | 데이터2 | 데이터3 | | ||
| 데이터1 | 데이터2 | 데이터3 | | ||
| 데이터1 | 데이터2 | 데이터3 | | ||
### 🤔링크 | ||
[출처: ](https://www.google.com) 구글 | ||
`, | ||
}, | ||
parameters: { | ||
viewport: { | ||
defaultViewport: "ipad11p", | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import PostCard from "./post-card"; | ||
import { Meta, StoryObj } from "@storybook/react"; | ||
export default { | ||
title: "Components/Post/PostCard", | ||
component: PostCard, | ||
tags: ["autodocs"], | ||
parameters: { | ||
componentSubtitle: "PostCard", | ||
}, | ||
}; | ||
|
||
type Story = StoryObj<typeof PostCard>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
title: "Post Title", | ||
slug: "post-slug", | ||
coverImage: "https://via.placeholder.com/150", | ||
date: "2024-01-01", | ||
excerpt: "Post Excerpt", | ||
category: "Category", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.