mirror of
https://github.com/Xevion/icons.git
synced 2025-12-06 05:15:26 -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 DisplayIconSingle from "@components/render/DisplayIconSingle";
|
||||
|
||||
const regex = /^([A-Z][a-z]{1,})[A-Z]\w+$/;
|
||||
|
||||
type Props = {
|
||||
icons: { id: string, setId: string }[];
|
||||
};
|
||||
|
||||
@@ -23,7 +23,7 @@ const Home: NextPage = () => {
|
||||
|
||||
const filtered = useMemo(() => {
|
||||
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 results = fuse.search(query, {limit: maximumResults});
|
||||
@@ -33,7 +33,7 @@ const Home: NextPage = () => {
|
||||
}, [debouncedQuery]);
|
||||
|
||||
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]);
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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 */
|
||||
// language=JavaScript
|
||||
|
||||
Reference in New Issue
Block a user