2020-10-31 07:53:25 -04:00
|
|
|
import {Button, Flex, Link, Stack, Text,} from "@chakra-ui/core";
|
2020-10-26 08:59:56 +01:00
|
|
|
import download from "downloadjs";
|
|
|
|
|
import JSZip from "jszip";
|
2020-11-03 20:58:51 +01:00
|
|
|
import { Download, Github } from 'lucide-react';
|
2020-10-31 07:53:25 -04:00
|
|
|
import {IconCustomizerDrawer} from "./IconCustomizerDrawer";
|
2020-10-26 08:59:56 +01:00
|
|
|
|
|
|
|
|
function generateZip(icons) {
|
|
|
|
|
const zip = new JSZip();
|
|
|
|
|
Object.values(icons).forEach((icon) =>
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
zip.file(`${icon.name}.svg`, icon.src)
|
|
|
|
|
);
|
|
|
|
|
return zip.generateAsync({ type: 'blob' });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const Header = ({ data }) => {
|
|
|
|
|
const downloadAllIcons = async () => {
|
|
|
|
|
|
|
|
|
|
const zip = await generateZip(data);
|
|
|
|
|
download(zip, 'feather.zip');
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const repositoryUrl = 'https://github.com/lucide-icons/lucide';
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Flex direction="column" align="center" justify="center">
|
2020-11-03 20:58:51 +01:00
|
|
|
<Text fontSize="4xl" as="b" mb="4" textAlign="center">
|
2020-10-26 08:59:56 +01:00
|
|
|
Simply beautiful open source icons, community-sourced
|
|
|
|
|
</Text>
|
|
|
|
|
<Text fontSize="lg" as="p" textAlign="center" mb="8">
|
|
|
|
|
An open-source icon library, a fork of <Link href="https://github.com/feathericons/feather" isExternal>Feather Icons</Link>. <br/>We're expanding the icon set as much as possible while keeping it nice-looking - <Link href={repositoryUrl} isExternal>join us</Link>!
|
|
|
|
|
</Text>
|
|
|
|
|
<Stack isInline marginTop={3} marginBottom={10}>
|
|
|
|
|
<Button
|
|
|
|
|
leftIcon={<Download/>}
|
|
|
|
|
size="lg"
|
|
|
|
|
onClick={downloadAllIcons}
|
|
|
|
|
>
|
|
|
|
|
Download all
|
|
|
|
|
</Button>
|
2020-10-31 07:53:25 -04:00
|
|
|
<IconCustomizerDrawer/>
|
2020-10-26 08:59:56 +01:00
|
|
|
<Button
|
|
|
|
|
as="a"
|
2020-11-03 20:58:51 +01:00
|
|
|
leftIcon={<Github/>}
|
2020-10-26 08:59:56 +01:00
|
|
|
size="lg"
|
|
|
|
|
href={repositoryUrl}
|
|
|
|
|
target="__blank"
|
|
|
|
|
onClick={downloadAllIcons}
|
|
|
|
|
>
|
|
|
|
|
Github
|
|
|
|
|
</Button>
|
|
|
|
|
</Stack>
|
|
|
|
|
</Flex>
|
|
|
|
|
)
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default Header;
|