posts
This commit is contained in:
parent
9bfdd2f9ca
commit
836294c229
1 changed files with 11 additions and 3 deletions
|
@ -1,6 +1,10 @@
|
||||||
import { Component } from 'react'
|
import { Component } from 'react'
|
||||||
import BlogPost from './BlogPost.js'
|
import BlogPost from './BlogPost.js'
|
||||||
|
|
||||||
|
const BLOG_URLS: string[] = [
|
||||||
|
'blog/20220506-change.html',
|
||||||
|
'blog/000000000-swim.html'
|
||||||
|
]
|
||||||
interface IBlogProps {
|
interface IBlogProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,11 +15,15 @@ class Blog extends Component<IBlogProps, IBlogState> {
|
||||||
constructor(props: IBlogProps) {
|
constructor(props: IBlogProps) {
|
||||||
super(props)
|
super(props)
|
||||||
}
|
}
|
||||||
|
renderPosts(urls: string[]): JSX.Element[] {
|
||||||
|
return (
|
||||||
|
urls.map((postURL) => <BlogPost key={postURL} postURL={postURL} />)
|
||||||
|
)
|
||||||
|
}
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<BlogPost postURL='blog/20220506-change.html' />
|
{this.renderPosts(BLOG_URLS)}
|
||||||
<BlogPost postURL='blog/000000000-swim.html' />
|
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue