Skip to content

Commit 7510a33

Browse files
committed
Only render button when async clipboard API is supported
1 parent d9adfb7 commit 7510a33

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

.storybook/components/Icons.tsx

+11-9
Original file line numberDiff line numberDiff line change
@@ -203,15 +203,17 @@ export function Icons() {
203203
)}
204204
/>
205205
)}
206-
<IconButton
207-
variant="tertiary"
208-
size="s"
209-
icon={iconComponents.Link}
210-
className={classes.copy}
211-
onClick={copyIconURL}
212-
>
213-
Copy URL
214-
</IconButton>
206+
{navigator.clipboard && (
207+
<IconButton
208+
variant="tertiary"
209+
size="s"
210+
icon={iconComponents.Link}
211+
className={classes.copy}
212+
onClick={copyIconURL}
213+
>
214+
Copy URL
215+
</IconButton>
216+
)}
215217
</div>
216218
);
217219
})}

0 commit comments

Comments
 (0)