show recent posts on top
This commit is contained in:
parent
b977e3f9ec
commit
b8d5ede31a
1 changed files with 2 additions and 2 deletions
|
@ -36,11 +36,11 @@ const PostList = (props: Props) => {
|
||||||
const [postsLength, setPostsLength] = useState(0)
|
const [postsLength, setPostsLength] = useState(0)
|
||||||
const [postCards, setPostCards] = useState<JSX.Element[]>([])
|
const [postCards, setPostCards] = useState<JSX.Element[]>([])
|
||||||
|
|
||||||
const loadPostCards = () => {
|
function loadPostCards() {
|
||||||
let postCount = 0
|
let postCount = 0
|
||||||
const postCards = [] as JSX.Element[]
|
const postCards = [] as JSX.Element[]
|
||||||
|
|
||||||
for (const date in map.date) {
|
for (const date of Object.keys(map.date).reverse()) {
|
||||||
if (postCount >= howMany) break
|
if (postCount >= howMany) break
|
||||||
|
|
||||||
const length = map.date[date].length
|
const length = map.date[date].length
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue