Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature/example-update] 예제 및 README 수정 #31

Merged
merged 3 commits into from
Aug 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 22 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,22 @@

## Support

| name | version | info |
| --------- |---------| ------------------------------------------------- |
| React | 16 ~ 17 | ✅ fully supported |
| React | 18 | 🚧 React 18 warning display, no functional issues |
| Storybook | 6.3.x | ✅ fully supported |
| Storybook | 6.5.x | ✅ fully supported |
### v7

| name | version | info |
| --------- |----------|-------------------|
| React | <= 18 | ✅ fully supported |
| Storybook | >= 7.0.0 | ✅ fully supported |
| Storybook | < 7.0.0 | ❌ [using v6](https://www.npmjs.com/package/storybook-addon-useragent?activeTab=versions) |

### v6

| name | version | info |
| --------- |---------|------------------------------------------------------------------------------------------|
| React | <= 18 | ✅ fully supported |
| Storybook | >= 7.0.0 | ❌ [using v7](https://www.npmjs.com/package/storybook-addon-useragent?activeTab=versions) |
| Storybook | < 7.0.0 | ✅ fully supported |


## Installing and Setup

Expand All @@ -47,7 +57,7 @@ yarn:
yarn add storybook-addon-useragent -D
```

### Add it to addons in `.storybook/main.ts`.
### Add it to addons in `.storybook/main.js`.

```js
module.exports = {
Expand Down Expand Up @@ -81,8 +91,10 @@ export const customUserAgents = [
import { customUserAgents } from "./userAgent";

export const parameters = {
...
userAgent: customUserAgents,
};

```

### Set as default in `stories`
Expand All @@ -98,6 +110,9 @@ import { UserAgentExample } from "./UserAgentExample";
export default {
title: "Example/UserAgentExample",
component: UserAgentExample,
argTypes: {
useragent: { control: "text" },
},
};

const Template = (args) => <UserAgentExample {...args} />;
Expand Down
21 changes: 5 additions & 16 deletions example/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
module.exports = {
stories: [
"../stories/**/*.stories.mdx",
"../stories/**/*.stories.@(js|jsx|ts|tsx)",
],

addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
"storybook-addon-useragent",
],

stories: ["../stories/*.stories.jsx"],
addons: ["@storybook/addon-essentials", "storybook-addon-useragent"],
framework: {
name: "@storybook/react-vite",
options: {}
options: {},
},

docs: {
autodocs: true
}
autodocs: true,
},
};
8 changes: 8 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Storybook Addon User-Agent Example

## Getting Started

```bash
npm install
npm run storybook
```
Loading