8 changed files with 70 additions and 26 deletions
@ -1,9 +1,19 @@
@@ -1,9 +1,19 @@
|
||||
import { Avatar, Comment } from 'antd'; |
||||
import React from 'react'; |
||||
import { Follower } from '../interfaces/follower'; |
||||
|
||||
interface Props { |
||||
follower: Follower; |
||||
} |
||||
|
||||
export default function FollowerCollection(props: Props) { |
||||
return <div>This is a single follower</div>; |
||||
export default function SingleFollower(props: Props) { |
||||
const { follower } = props; |
||||
|
||||
return ( |
||||
<Comment |
||||
author={follower.username} |
||||
avatar={<Avatar src={follower.image} alt="Han Solo" />} |
||||
content={follower.name} |
||||
/> |
||||
); |
||||
} |
||||
|
@ -1,9 +1,24 @@
@@ -1,9 +1,24 @@
|
||||
import { Pagination } from 'antd'; |
||||
import { Follower } from '../interfaces/follower'; |
||||
import SingleFollower from './Follower'; |
||||
|
||||
interface Props { |
||||
total: number; |
||||
followers: Follower[]; |
||||
} |
||||
|
||||
export default function FollowerCollection(props: Props) { |
||||
return <div>List of followers go here</div>; |
||||
const ITEMS_PER_PAGE = 24; |
||||
|
||||
const { followers, total } = props; |
||||
const pages = Math.ceil(total / ITEMS_PER_PAGE); |
||||
|
||||
return ( |
||||
<div> |
||||
{followers.map(follower => ( |
||||
<SingleFollower key={follower.link} follower={follower} /> |
||||
))} |
||||
<Pagination current={1} pageSize={ITEMS_PER_PAGE} total={pages || 1} /> |
||||
</div> |
||||
); |
||||
} |
||||
|
Loading…
Reference in new issue