File size: 2,655 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// @flow

import * as React from "react";

import { Page, Grid, Card, Icon } from "tabler-react";

import faIcons from "../data/icons/fa";
import feIcons from "../data/icons/fe";
import flagIcons from "../data/icons/flag";
import paymentIcons from "../data/icons/payment";
import SiteWrapper from "../SiteWrapper.react";

const iconSets: Array<{
  prefix: "fa" | "fe" | "flag" | "payment",
  title: string,
  icons: Array<string>,
  description?: string,
  link?: string,
}> = [
  {
    prefix: "fe",
    title: "Feather Icons",
    icons: feIcons,
    description: "Simply beautiful open source icons.",
    link: "https://feathericons.com",
  },
  {
    prefix: "fa",
    title: "Font Awesome",
    icons: faIcons,
    description: "Powered by Font Awesome set.",
    link: "http://fontawesome.io",
  },
  { prefix: "flag", title: "Flags", icons: flagIcons },
  { prefix: "payment", title: "Payments", icons: paymentIcons },
];

function IconPage(): React.Node {
  return (
    <SiteWrapper>
      <Page.Content title="Icons">
        {iconSets.map(iconSet => (
          <Card key={iconSet.prefix}>
            <Card.Header>
              <Card.Title>{iconSet.title}</Card.Title>
            </Card.Header>
            <Card.Body>
              <Grid.Row>
                <Grid.Col lg={3}>
                  <p>
                    {iconSet.description}
                    {iconSet.link && (
                      <span>
                        {" "}
                        For more info{" "}
                        <a
                          href={iconSet.link}
                          target="_blank"
                          rel="noopener noreferrer"
                        >
                          click here
                        </a>.
                      </span>
                    )}
                  </p>
                  <p>
                    <code>{`<Icon prefix="${
                      iconSet.prefix
                    }" name="ICON_NAME" />`}</code>
                  </p>
                </Grid.Col>
                <Grid.Col lg={9}>
                  <div className="icons-list-wrap">
                    <ul className="icons-list">
                      {iconSet.icons.map(icon => (
                        <li className="icons-list-item" key={icon}>
                          <Icon prefix={iconSet.prefix} name={icon} />
                        </li>
                      ))}
                    </ul>
                  </div>
                </Grid.Col>
              </Grid.Row>
            </Card.Body>
          </Card>
        ))}
      </Page.Content>
    </SiteWrapper>
  );
}

export default IconPage;