Skip to content

Commit

Permalink
feat(app): unicode copy
Browse files Browse the repository at this point in the history
  • Loading branch information
rektdeckard committed Mar 29, 2024
1 parent b8f451d commit 2ae59ff
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/components/IconGrid/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
CaretDoubleLeft,
CaretDoubleRight,
} from "@phosphor-icons/react";
// import { IconStyle } from "@phosphor-icons/core";
import { IconStyle } from "@phosphor-icons/core";
import ReactGA from "react-ga4";

import Tabs, { Tab } from "@/components/Tabs";
Expand Down Expand Up @@ -255,13 +255,13 @@ const Panel = () => {
setCopied(CopyType.SVG_RAW);
};

// const handleCopyUnicode = async () => {
// if (!entry) return;
const handleCopyUnicode = async () => {
if (!entry) return;

// const content = String.fromCharCode(entry.codepoint);
// navigator.clipboard?.writeText(content);
// setCopied(CopyType.UNICODE);
// };
const content = String.fromCharCode(entry.codepoint);
navigator.clipboard?.writeText(content);
setCopied(CopyType.UNICODE);
};

const handleDownloadSVG = (
event: React.MouseEvent<HTMLButtonElement, MouseEvent>
Expand Down Expand Up @@ -352,11 +352,11 @@ const Panel = () => {
<entry.Icon ref={ref} size={64}></entry.Icon>
<figcaption>
<p>{entry.name}</p>
{/* <small className="versioning">
<small className="versioning">
U+{entry.codepoint.toString(16).toUpperCase()}
</small> */}
</small>
<small className="versioning">
available in v{entry.published_in.toFixed(1)}.0+
available in v{entry.published_in.toFixed(1)}+
</small>
</figcaption>
</figure>
Expand Down Expand Up @@ -416,13 +416,13 @@ const Panel = () => {
onClick={handleCopyDataSVG}
/>

{/* <ActionButton
<ActionButton
label="Unicode"
title="Copy Unicode character (v2.1.0 or newer)"
active={copied === CopyType.UNICODE}
disabled={weight === IconStyle.DUOTONE}
onClick={handleCopyUnicode}
/> */}
/>
</>
)}
</div>
Expand Down

0 comments on commit 2ae59ff

Please sign in to comment.