mirror of
https://github.com/Xevion/icons.git
synced 2025-12-10 08:07:33 -06:00
Attempt to mitigate loading all packs on load
- resolve type warnings - remove unused RegEx
This commit is contained in:
@@ -1,8 +1,6 @@
|
|||||||
import type {FunctionComponent} from "react";
|
import type {FunctionComponent} from "react";
|
||||||
import DisplayIconSingle from "@components/render/DisplayIconSingle";
|
import DisplayIconSingle from "@components/render/DisplayIconSingle";
|
||||||
|
|
||||||
const regex = /^([A-Z][a-z]{1,})[A-Z]\w+$/;
|
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
icons: { id: string, setId: string }[];
|
icons: { id: string, setId: string }[];
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const Home: NextPage = () => {
|
|||||||
|
|
||||||
const filtered = useMemo(() => {
|
const filtered = useMemo(() => {
|
||||||
const start = new Date();
|
const start = new Date();
|
||||||
const results = icons.filter(({id}) => id.toLowerCase().indexOf(query) !== -1);
|
const results = debouncedQuery.length == 0 ? [] : icons.filter(({id}) => id.toLowerCase().indexOf(query) !== -1);
|
||||||
const end = new Date();
|
const end = new Date();
|
||||||
|
|
||||||
// const results = fuse.search(query, {limit: maximumResults});
|
// const results = fuse.search(query, {limit: maximumResults});
|
||||||
@@ -33,7 +33,7 @@ const Home: NextPage = () => {
|
|||||||
}, [debouncedQuery]);
|
}, [debouncedQuery]);
|
||||||
|
|
||||||
const catalog = useMemo(() => {
|
const catalog = useMemo(() => {
|
||||||
return <IconCatalog icons={debouncedQuery.length === 0 ? [] : filtered.map(i => i).slice(0, 100)}/>;
|
return <IconCatalog icons={filtered.map(i => i).slice(0, 100)}/>;
|
||||||
}, [filtered]);
|
}, [filtered]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import codegen from "babel-plugin-codegen/macro";
|
import codegen from "babel-plugin-codegen/macro";
|
||||||
import {IconType} from "react-icons";
|
import type {IconType} from "react-icons";
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call */
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call */
|
||||||
// language=JavaScript
|
// language=JavaScript
|
||||||
|
|||||||
Reference in New Issue
Block a user