Skip to content

Commit

Permalink
fix: duplicate loading issue
Browse files Browse the repository at this point in the history
  • Loading branch information
DanWebb committed Jan 26, 2024
1 parent 6f8aa32 commit 002b148
Show file tree
Hide file tree
Showing 16 changed files with 5,696 additions and 15,012 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;
22 changes: 1 addition & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,14 @@ 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 withMarker from '@etchteam/storybook-addon-marker/with-marker';

export const parameters = {
marker: {
destination: 'abcd1234567890', // <- Your unique destination ID
}
}

export const decorators = [withMarker];
```

To set the type of capture to trigger, the optional `mode` property can be added to the marker options:
Expand All @@ -49,22 +45,6 @@ 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:

```js
export default {
title: 'Example/Page',
component: Page,
parameters: {
marker: {
customData: {
story: 'Page'
}
}
}
};
```

### Marker

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).
Expand Down
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 002b148

Please sign in to comment.