Skip to content

Commit

Permalink
Add custom viewports to the official-storybook example
Browse files Browse the repository at this point in the history
  • Loading branch information
mshaaban088 committed Feb 26, 2018
1 parent bb9eaab commit 00d4252
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/official-storybook/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { configure } from '@storybook/react';
import { setOptions } from '@storybook/addon-options';
import { addViewports } from '@storybook/addon-viewport';
import 'react-chromatic/storybook-addon';
import addHeadWarning from './head-warning';
import extraViewports from './extra-viewports.json';

addHeadWarning('Preview head not loaded', 'preview-head-not-loaded');
addHeadWarning('Dotenv file not loaded', 'dotenv-file-not-loaded');
Expand All @@ -11,6 +13,8 @@ setOptions({
hierarchyRootSeparator: /\|/,
});

addViewports(extraViewports);

function importAll(req) {
req.keys().forEach(filename => req(filename));
}
Expand Down
16 changes: 16 additions & 0 deletions examples/official-storybook/extra-viewports.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"kindleFire2": {
"name": "Kindle Fire 2",
"styles": {
"width": "600px",
"height": "963px"
}
},
"kindleFireHD": {
"name": "Kindle Fire HD",
"styles": {
"width": "533px",
"height": "801px"
}
}
}

0 comments on commit 00d4252

Please sign in to comment.