mirror of
https://github.com/pheralb/svgl.git
synced 2025-03-13 16:40:34 +08:00
⚙️ Delete unused function
This commit is contained in:
parent
37486f48e4
commit
c622b769f7
@ -122,7 +122,7 @@
|
|||||||
body: JSON.stringify({ code: content, typescript: tsx, name: title })
|
body: JSON.stringify({ code: content, typescript: tsx, name: title })
|
||||||
});
|
});
|
||||||
const data = await getCode.json();
|
const data = await getCode.json();
|
||||||
await copyReactContent(data);
|
await navigator.clipboard.writeText(data);
|
||||||
toast.success(`Copied as React ${tsx ? 'TSX' : 'JSX'} component`, {
|
toast.success(`Copied as React ${tsx ? 'TSX' : 'JSX'} component`, {
|
||||||
description: `${svgInfo.title} - ${svgInfo.category}`
|
description: `${svgInfo.title} - ${svgInfo.category}`
|
||||||
});
|
});
|
||||||
@ -135,18 +135,6 @@
|
|||||||
isLoading = false;
|
isLoading = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Copy React content:
|
|
||||||
const copyReactContent = async (content: string) => {
|
|
||||||
try {
|
|
||||||
const clipboardItem = new ClipboardItem({
|
|
||||||
'text/plain': new Blob([content], { type: 'text/plain' })
|
|
||||||
});
|
|
||||||
await navigator.clipboard.write([clipboardItem]);
|
|
||||||
} catch (error) {
|
|
||||||
await navigator.clipboard.writeText(content);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Popover.Root open={optionsOpen} onOpenChange={(isOpen) => (optionsOpen = isOpen)}>
|
<Popover.Root open={optionsOpen} onOpenChange={(isOpen) => (optionsOpen = isOpen)}>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user