feat(app): unicode copy
This commit is contained in:
@@ -18,7 +18,7 @@ import {
|
|||||||
CaretDoubleLeft,
|
CaretDoubleLeft,
|
||||||
CaretDoubleRight,
|
CaretDoubleRight,
|
||||||
} from "@phosphor-icons/react";
|
} from "@phosphor-icons/react";
|
||||||
// import { IconStyle } from "@phosphor-icons/core";
|
import { IconStyle } from "@phosphor-icons/core";
|
||||||
import ReactGA from "react-ga4";
|
import ReactGA from "react-ga4";
|
||||||
|
|
||||||
import Tabs, { Tab } from "@/components/Tabs";
|
import Tabs, { Tab } from "@/components/Tabs";
|
||||||
@@ -255,13 +255,13 @@ const Panel = () => {
|
|||||||
setCopied(CopyType.SVG_RAW);
|
setCopied(CopyType.SVG_RAW);
|
||||||
};
|
};
|
||||||
|
|
||||||
// const handleCopyUnicode = async () => {
|
const handleCopyUnicode = async () => {
|
||||||
// if (!entry) return;
|
if (!entry) return;
|
||||||
|
|
||||||
// const content = String.fromCharCode(entry.codepoint);
|
const content = String.fromCharCode(entry.codepoint);
|
||||||
// navigator.clipboard?.writeText(content);
|
navigator.clipboard?.writeText(content);
|
||||||
// setCopied(CopyType.UNICODE);
|
setCopied(CopyType.UNICODE);
|
||||||
// };
|
};
|
||||||
|
|
||||||
const handleDownloadSVG = (
|
const handleDownloadSVG = (
|
||||||
event: React.MouseEvent<HTMLButtonElement, MouseEvent>
|
event: React.MouseEvent<HTMLButtonElement, MouseEvent>
|
||||||
@@ -352,11 +352,11 @@ const Panel = () => {
|
|||||||
<entry.Icon ref={ref} size={64}></entry.Icon>
|
<entry.Icon ref={ref} size={64}></entry.Icon>
|
||||||
<figcaption>
|
<figcaption>
|
||||||
<p>{entry.name}</p>
|
<p>{entry.name}</p>
|
||||||
{/* <small className="versioning">
|
|
||||||
U+{entry.codepoint.toString(16).toUpperCase()}
|
|
||||||
</small> */}
|
|
||||||
<small className="versioning">
|
<small className="versioning">
|
||||||
available in v{entry.published_in.toFixed(1)}.0+
|
U+{entry.codepoint.toString(16).toUpperCase()}
|
||||||
|
</small>
|
||||||
|
<small className="versioning">
|
||||||
|
available in v{entry.published_in.toFixed(1)}+
|
||||||
</small>
|
</small>
|
||||||
</figcaption>
|
</figcaption>
|
||||||
</figure>
|
</figure>
|
||||||
@@ -416,13 +416,13 @@ const Panel = () => {
|
|||||||
onClick={handleCopyDataSVG}
|
onClick={handleCopyDataSVG}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* <ActionButton
|
<ActionButton
|
||||||
label="Unicode"
|
label="Unicode"
|
||||||
title="Copy Unicode character (v2.1.0 or newer)"
|
title="Copy Unicode character (v2.1.0 or newer)"
|
||||||
active={copied === CopyType.UNICODE}
|
active={copied === CopyType.UNICODE}
|
||||||
disabled={weight === IconStyle.DUOTONE}
|
disabled={weight === IconStyle.DUOTONE}
|
||||||
onClick={handleCopyUnicode}
|
onClick={handleCopyUnicode}
|
||||||
/> */}
|
/>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user