Skip to content

Commit

Permalink
feat: add template copy link
Browse files Browse the repository at this point in the history
  • Loading branch information
jyash97 committed Apr 18, 2020
1 parent 298a43d commit 8d41d1e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ class SandboxItemComponent extends React.PureComponent<Props, State> {

copySandboxURL = () => {
const url = sandboxUrl({ id: this.props.id, alias: this.props.alias });

// TODO: Use effects.browse.copyToClipboard after refactoring to Function Component
copyToClipboard(`https://codesandbox.io${url}`);

return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ export const OwnedTemplates = (props: OwnedTemplatesProps) => {
actions: {
dashboard: { deleteTemplate },
},
effects: {
browser: { copyToClipboard },
},
} = useOvermind();
const { teamId } = props;
const { loading, error, data, refetch } = useQuery<
Expand Down Expand Up @@ -99,6 +102,15 @@ export const OwnedTemplates = (props: OwnedTemplatesProps) => {
return true;
},
},
{
title: 'Copy Template Link',
action: () => {
copyToClipboard(
`https://codesandbox.io${sandboxUrl(template.sandbox)}`
);
return true;
},
},
],
{
title: `Delete Template`,
Expand Down

0 comments on commit 8d41d1e

Please sign in to comment.