Skip to content

Commit

Permalink
Merge pull request #7 from etchteam/fix/duplicate-loading-issue
Browse files Browse the repository at this point in the history
Fix duplicate loading issue
  • Loading branch information
mergify[bot] authored Jan 26, 2024
2 parents 60b83e1 + 8877a34 commit 73c67e6
Show file tree
Hide file tree
Showing 16 changed files with 6,999 additions and 19,546 deletions.
2 changes: 1 addition & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
"stories": ["../stories/**/*.stories.mdx", "../stories/**/*.stories.@(js|jsx|ts|tsx)"],
"addons": ["@storybook/addon-links", "@storybook/addon-essentials", "../src/preset"],
"addons": ["@storybook/addon-links", "@storybook/addon-essentials", "../src"],
framework: {
name: "@storybook/react-webpack5",
options: {}
Expand Down
7 changes: 1 addition & 6 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
import withMarker from '../src/with-marker';

const preview = {
parameters: {
marker: {
destination: '60f162459a86003bf9d741b3',
mode: 'advanced'
}
},
decorators: [
withMarker,
],
}
};

export default preview;
29 changes: 8 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ npm install @etchteam/storybook-addon-marker --save-dev

## Configuration

### Storybook

Create a file called `main.js` in your `.storybook` config folder.

Add the following content to it:
Expand All @@ -22,14 +24,9 @@ module.exports = {
}
```

Then create a file called `preview.js` in the same folder and add your [Marker destination](https://marker.io/blog/integrate-web-app-browser-sdk) as a [parameter](https://storybook.js.org/docs/react/writing-stories/parameters) as well as the `withMarker` [decorator](https://storybook.js.org/docs/react/writing-stories/decorators):
Then create a file called `preview.js` in the same folder and add your [Marker destination](https://marker.io/blog/integrate-web-app-browser-sdk) as a [parameter](https://storybook.js.org/docs/react/writing-stories/parameters).

```js
import { addDecorator } from '@storybook/react';
import withMarker from '@etchteam/storybook-addon-marker/with-marker';

addDecorator(withMarker);

export const parameters = {
marker: {
destination: 'abcd1234567890', // <- Your unique destination ID
Expand All @@ -48,22 +45,12 @@ export const parameters = {
}
```

It's possible to pass other Marker options to the `marker` parameter, either globally or per story. For example, custom metadata can be passed per story with the `customData` property:
### Marker

```js
export default {
title: 'Example/Page',
component: Page,
parameters: {
marker: {
customData: {
story: 'Page'
}
}
}
};
```
Your Marker destination and other Marker configuration options can be found on the [Marker SDK documentation](https://marker.io/blog/integrate-web-app-browser-sdk).

The Widget > Button > Button visibility setting should be set to "hidden" as this addon adds a custom feedback button to the Storybook toolbar.

Where to find your Marker destination and other Marker configuration options can be found on the [Marker SDK documentation](https://marker.io/blog/integrate-web-app-browser-sdk).
---

Made with ☕ at [Etch](https://etch.co)
1 change: 1 addition & 0 deletions manager.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./dist/manager.js');
Loading

0 comments on commit 73c67e6

Please sign in to comment.