MCPcopy Create free account
hub / github.com/callstack/react-native-paper / IconsList

Function IconsList

docs/src/components/IconsList.tsx:11–49  ·  view source on GitHub ↗
({ latest }: { latest?: boolean })

Source from the content-addressed store, hash-verified

9};
10
11export default function IconsList({ latest }: { latest?: boolean }) {
12 const icons = latest ? latestIcons : oldIcons;
13
14 const [query, setQuery] = useState('');
15
16 const iconNames = Object.keys(icons).filter(
17 (item) =>
18 item.includes(query.replace(/\s/g, '-')) ||
19 item.replace(/-/g, '').includes(query)
20 );
21
22 return (
23 <div className="icons-list-container">
24 <input
25 className="icons-list-searchbar"
26 type="search"
27 value={query}
28 onChange={(event) => {
29 setQuery(event.target.value);
30 }}
31 placeholder="Find icon by name…"
32 />
33 {iconNames.length ? (
34 <div className="icons-list-results">
35 {iconNames.map((name) => (
36 <div className="icons-list-icon-container" key={name}>
37 <span className="icons-list-icon">
38 {String.fromCodePoint(icons[name])}
39 </span>
40 <span className="icons-list-icon-name">{name}</span>
41 </div>
42 ))}
43 </div>
44 ) : (
45 <p>No matching icon found :(</p>
46 )}
47 </div>
48 );
49}

Callers

nothing calls this directly

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…