feat(app): add option to download raw svg

This commit is contained in:
rektdeckard
2023-08-21 00:50:46 -06:00
parent 2fc3263cdc
commit 358ad08165
3 changed files with 27 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "phosphor-home", "name": "phosphor-home",
"version": "2.0.2", "version": "2.0.3",
"license": "MIT", "license": "MIT",
"homepage": "https://phosphoricons.com", "homepage": "https://phosphoricons.com",
"author": { "author": {

View File

@@ -212,8 +212,9 @@ figcaption > p {
align-items: center; align-items: center;
justify-content: flex-start; */ justify-content: flex-start; */
display: inline-grid; display: inline-grid;
grid-template-columns: 66px 66px 92px; grid-template-columns: 1fr 1fr;
gap: 6px; max-height: 60px;
/* gap: 6px; */
} }
.action-button { .action-button {
@@ -255,6 +256,10 @@ figcaption > p {
margin-inline: -10px; margin-inline: -10px;
border-radius: 0; border-radius: 0;
} }
.detail-actions {
display: inline-flex;
}
} }
@media screen and (max-width: 536px) { @media screen and (max-width: 536px) {

View File

@@ -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 ( const handleDownloadPNG = async (
event: React.MouseEvent<HTMLButtonElement, MouseEvent> event: React.MouseEvent<HTMLButtonElement, MouseEvent>
) => { ) => {
@@ -340,6 +352,13 @@ const Panel = () => {
onClick={handleDownloadSVG} onClick={handleDownloadSVG}
/> />
<ActionButton
label="SVG Raw"
title="Download raw SVG including original strokes"
download
onClick={handleDownloadRawSVG}
/>
<ActionButton <ActionButton
label="SVG" label="SVG"
title="Copy SVG" title="Copy SVG"