ArticleCard + ArticleCardList refactoring
This commit is contained in:
1 parent
0ea937847a
commit
f0f33fe201
5 files changed
+27
-31
No files matched your search
@@ -0,0 +1,24 @@
|
||||
import React from 'react'
|
||||
import Paginator from './Paginator'
|
||||
import { ArticleCard } from './ArticleCard'
|
||||
|
||||
export const ArticleCardList = ({ articles, nextPage, prevPage }) => (
|
||||
<div className="ArticleCardList">
|
||||
{!prevPage ? null : (
|
||||
<Paginator url={`/articles/${prevPage}`} type="top" />
|
||||
)}
|
||||
|
||||
<div className="ArticleCardList-body">
|
||||
{articles.map((article, i) => (
|
||||
<ArticleCard
|
||||
key={i}
|
||||
article={article}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{!nextPage ? null : (
|
||||
<Paginator url={`/articles/${nextPage}`} type="bottom" />
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
Reference in new issue
Block a user