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

UI: Fix eject and copy URLs for composition #12233

Merged
merged 1 commit into from Aug 26, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions lib/ui/src/components/preview/tools/copy.tsx
@@ -1,3 +1,4 @@
import { PREVIEW_URL } from 'global';
import React from 'react';
import copy from 'copy-to-clipboard';
import { IconButton, Icons } from '@storybook/components';
Expand All @@ -11,9 +12,7 @@ const copyMapper = ({ state }: Combo) => {

return {
refId,
baseUrl: ref
? `${ref.url}/iframe.html`
: `${state.location.origin + state.location.pathname}iframe.html`,
baseUrl: ref ? `${ref.url}/iframe.html` : (PREVIEW_URL as string) || 'iframe.html',
storyId,
queryParams: state.customQueryParams,
};
Expand Down
5 changes: 2 additions & 3 deletions lib/ui/src/components/preview/tools/eject.tsx
@@ -1,3 +1,4 @@
import { PREVIEW_URL } from 'global';
import React from 'react';
import { IconButton, Icons } from '@storybook/components';
import { Consumer, Combo } from '@storybook/api';
Expand All @@ -10,9 +11,7 @@ const ejectMapper = ({ state }: Combo) => {

return {
refId,
baseUrl: ref
? `${ref.url}/iframe.html`
: `${state.location.origin + state.location.pathname}iframe.html`,
baseUrl: ref ? `${ref.url}/iframe.html` : (PREVIEW_URL as string) || 'iframe.html',
storyId,
queryParams: state.customQueryParams,
};
Expand Down