-
-
Notifications
You must be signed in to change notification settings - Fork 303
/
AllIcons.tsx
33 lines (29 loc) · 926 Bytes
/
AllIcons.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import React, { ReactElement } from "react";
import * as MaterialIcons from "@react-md/material-icons";
import { Tooltipped } from "@react-md/tooltip";
import Code from "components/Code";
import styles from "./AllIcons.module.scss";
const allIcons = Object.entries(MaterialIcons).filter(([name]) =>
name.endsWith("SVGIcon")
);
export default function AllIcons(): ReactElement {
return (
<div className={styles.container}>
{allIcons.map(([name, Icon]) => (
<div key={name} className={styles.icon}>
<Icon />
<Tooltipped id={`icon-${name}`} tooltip={name}>
{({ tooltip, ...a11y }) => (
<>
<Code {...a11y} className={styles.name} tabIndex={0}>
{name.replace(/SVGIcon/, "")}
</Code>
{tooltip}
</>
)}
</Tooltipped>
</div>
))}
</div>
);
}