[UI > AddonPage] Move back to FlatList
This commit is contained in:
parent
0dae5b17e5
commit
63fd59e826
1 changed files with 18 additions and 14 deletions
|
@ -18,7 +18,9 @@ export default function AddonPage<T>({ items, safeModeMessage, safeModeExtras, c
|
|||
|
||||
return (
|
||||
<ErrorBoundary>
|
||||
<RN.ScrollView style={{ flex: 1 }} contentContainerStyle={{ padding: 10 }}>
|
||||
{/* TODO: Implement better searching than just by ID */}
|
||||
<RN.FlatList
|
||||
ListHeaderComponent={<>
|
||||
{settings.safeMode?.enabled && <RN.View style={{ marginBottom: 10 }}>
|
||||
<HelpMessage messageType={0}>{safeModeMessage}</HelpMessage>
|
||||
{safeModeExtras}
|
||||
|
@ -28,10 +30,12 @@ export default function AddonPage<T>({ items, safeModeMessage, safeModeExtras, c
|
|||
onChangeText={(v: string) => setSearch(v.toLowerCase())}
|
||||
placeholder="Search"
|
||||
/>
|
||||
{/* TODO: When I am more awake, implement better searching than just by ID */}
|
||||
{/* TODO: Also when I am more awake, make the search bar not scroll with the cards */}
|
||||
{Object.values(items).filter(i => i.id?.toLowerCase().includes(search)).map((i, id) => <CardComponent item={i} index={id} />)}
|
||||
</RN.ScrollView>
|
||||
</>}
|
||||
style={{ paddingHorizontal: 10, paddingTop: 10 }}
|
||||
contentContainerStyle={{ paddingBottom: 20 }}
|
||||
data={Object.values(items).filter(i => i.id?.toLowerCase().includes(search))}
|
||||
renderItem={({ item, index }) => <CardComponent item={item} index={index} />}
|
||||
/>
|
||||
</ErrorBoundary>
|
||||
)
|
||||
}
|
Loading…
Reference in a new issue