Skip to content

Commit 301efc5

Browse files
authored
feat: add template copy link (codesandbox#3936)
1 parent 298a43d commit 301efc5

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

packages/app/src/app/pages/Dashboard/Content/SandboxCard/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ class SandboxItemComponent extends React.PureComponent<Props, State> {
404404

405405
copySandboxURL = () => {
406406
const url = sandboxUrl({ id: this.props.id, alias: this.props.alias });
407-
407+
// TODO: Use effects.browse.copyToClipboard after refactoring to Function Component
408408
copyToClipboard(`https://codesandbox.io${url}`);
409409

410410
return true;

packages/app/src/app/pages/Dashboard/Content/routes/Templates/OwnedTemplates/OwnedTemplates.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ export const OwnedTemplates = (props: OwnedTemplatesProps) => {
2929
actions: {
3030
dashboard: { deleteTemplate },
3131
},
32+
effects: {
33+
browser: { copyToClipboard },
34+
},
3235
} = useOvermind();
3336
const { teamId } = props;
3437
const { loading, error, data, refetch } = useQuery<
@@ -99,6 +102,15 @@ export const OwnedTemplates = (props: OwnedTemplatesProps) => {
99102
return true;
100103
},
101104
},
105+
{
106+
title: 'Copy Template Link',
107+
action: () => {
108+
copyToClipboard(
109+
`https://codesandbox.io${sandboxUrl(template.sandbox)}`
110+
);
111+
return true;
112+
},
113+
},
102114
],
103115
{
104116
title: `Delete Template`,

0 commit comments

Comments
 (0)