Skip to content

Commit

Permalink
chore: add correct path to be used both on live or static
Browse files Browse the repository at this point in the history
  • Loading branch information
basilgood committed Jul 29, 2024
1 parent 71297d7 commit 1bbf4fa
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const config = {

return config;
},
// staticDirs: ['images'],
staticDirs: ['../stories/images'],
};

export default config;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"storybook:start": "storybook dev -p 6006",
"storybook:build": "storybook build",
"storybook:deploy": "storybook-to-ghpages",
"storybook:preview": "npm run storybook:build && http-server -c-1 -p 6006 -so ./storybook-static",
"storybook:preview": "npm run storybook:build && http-server -c-1 -p 6006 -o",
"prepare": "husky install"
},
"release": {
Expand Down
14 changes: 10 additions & 4 deletions stories/cosmoz-image-viewer.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ export const Basic = ({
?loop=${loop}
?show-zoom=${showZoom}
?detached-show-zoom=${detachedShowZoom}
.images=${['stories/images/cosmos1.jpg', 'stories/images/cosmos2.jpg']}
.images=${[
'cosmos1.jpg',
'cosmos2.jpg',
]}
></cosmoz-image-viewer>
`;

Expand All @@ -52,10 +55,13 @@ Basic.args = {

export const Issue21 = () => {
const images1 = [
'stories/images/stockholm.jpg',
'stories/images/strasbourg.jpg',
'stockholm.jpg',
'strasbourg.jpg',
],
images2 = ['stories/images/cosmos1.jpg', 'stories/images/cosmos2.jpg'];
images2 = [
'cosmos1.jpg',
'cosmos2.jpg',
];
return html`
<cosmoz-image-viewer
show-detach
Expand Down
6 changes: 3 additions & 3 deletions stories/data.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export const images = [
'stories/images/stockholm.jpg',
'stockholm.jpg',
'this-is-a-loading-error.jpg',
() => 'stories/images/a_size.png',
() => 'a_size.png',
() =>
new Promise((resolve) =>
setTimeout(() => resolve('stories/images/strasbourg.jpg'), 500),
setTimeout(() => resolve('strasbourg.jpg'), 500),
),
];
2 changes: 1 addition & 1 deletion stories/haunted-pan-zoom.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
};
const Template = ({ disabled, height, zoomStiffness, panStiffness }) => html`
<haunted-pan-zoom
src="stories/images/a_size.png"
src="a_size.png"
style="height: ${height}px;"
?disabled=${disabled}
.zoomStiffness=${zoomStiffness}
Expand Down

0 comments on commit 1bbf4fa

Please sign in to comment.