Skip to content

Commit

Permalink
Fix children error
Browse files Browse the repository at this point in the history
  • Loading branch information
Karol-2 committed Feb 27, 2024
1 parent 8be6829 commit 6dc775d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/Paginator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useState } from "react";
import User from "../models/User";


export interface PaginatorProps {
interface PaginatorProps {
users: User[],
itemsPerPage: number,
renderItem: (user: User) => React.ReactNode
Expand Down
27 changes: 14 additions & 13 deletions frontend/src/pages/SearchPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,20 +133,21 @@ function SearchPage() {
</button>
</form>
</div>
{usersFound && (<div>
<Paginator
users={usersFound.map((match: [User, number])=> match[0])}
itemsPerPage={5}
renderItem={(user)=> <FoundUser
user={user}
key={String(0)}
currentId={userId}
isFriend={isFriend(usersFriends, user)}
/>}
>
{usersFound && (
<Paginator
users={usersFound.map((match: [User, number]) => match[0])}
itemsPerPage={5}
renderItem={(user) => (
<FoundUser
user={user}
key={String(0)}
currentId={userId}
isFriend={isFriend(usersFriends, user)}
/>
)}
/>
)}

</Paginator>
</div>)}

</section>
<Footer />
Expand Down

0 comments on commit 6dc775d

Please sign in to comment.