Links: add dynamic icon count to download link

This commit is contained in:
rektdeckard
2020-10-12 00:37:11 -04:00
parent 173a019d31
commit 759fa5f53a
2 changed files with 7 additions and 3 deletions

View File

@@ -2,6 +2,8 @@ import React from "react";
import { OutboundLink } from "react-ga"; import { OutboundLink } from "react-ga";
import { ArrowElbowDownRight } from "phosphor-react"; import { ArrowElbowDownRight } from "phosphor-react";
import { iconCount } from "../../lib/icons";
import "./Links.css"; import "./Links.css";
interface LinksProps {} interface LinksProps {}
@@ -18,7 +20,7 @@ const Links: React.FC<LinksProps> = () => {
download download
type="application/zip" type="application/zip"
> >
Download all Download all ({iconCount})
</OutboundLink> </OutboundLink>
</div> </div>
<div> <div>
@@ -29,7 +31,7 @@ const Links: React.FC<LinksProps> = () => {
eventLabel="Figma library" eventLabel="Figma library"
style={{ textDecoration: "line-through" }} style={{ textDecoration: "line-through" }}
> >
Figma library Add Figma library
</OutboundLink> </OutboundLink>
</div> </div>
<div> <div>
@@ -40,7 +42,7 @@ const Links: React.FC<LinksProps> = () => {
eventLabel="Figma plugin" eventLabel="Figma plugin"
style={{ textDecoration: "line-through" }} style={{ textDecoration: "line-through" }}
> >
Figma plugin Add Figma plugin
</OutboundLink> </OutboundLink>
</div> </div>
<div> <div>

View File

@@ -5562,3 +5562,5 @@ export const icons: ReadonlyArray<IconEntry> = [
if (process.env.NODE_ENV === "development") { if (process.env.NODE_ENV === "development") {
console.log(`${icons.length} icons`); console.log(`${icons.length} icons`);
} }
export const iconCount = (icons.length * 6).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");