feat(app): add option to download raw svg
This commit is contained in:
@@ -260,6 +260,18 @@ const Panel = () => {
|
||||
);
|
||||
};
|
||||
|
||||
const handleDownloadRawSVG = async () => {
|
||||
if (!entry) return;
|
||||
|
||||
const { name } = entry;
|
||||
saveAs(
|
||||
`https://raw.githubusercontent.com/phosphor-icons/core/main/raw/${weight}/${name}${
|
||||
weight === "regular" ? "" : `-${weight}`
|
||||
}.svg`,
|
||||
`${entry?.name}${weight === "regular" ? "" : `-${weight}`}.svg`
|
||||
);
|
||||
};
|
||||
|
||||
const handleDownloadPNG = async (
|
||||
event: React.MouseEvent<HTMLButtonElement, MouseEvent>
|
||||
) => {
|
||||
@@ -340,6 +352,13 @@ const Panel = () => {
|
||||
onClick={handleDownloadSVG}
|
||||
/>
|
||||
|
||||
<ActionButton
|
||||
label="SVG Raw"
|
||||
title="Download raw SVG including original strokes"
|
||||
download
|
||||
onClick={handleDownloadRawSVG}
|
||||
/>
|
||||
|
||||
<ActionButton
|
||||
label="SVG"
|
||||
title="Copy SVG"
|
||||
|
||||
Reference in New Issue
Block a user