Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explore: Implemented sort by newest humans #38

Merged
merged 2 commits into from
Jun 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/explorer/src/views/Browse.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ const Page = () => {
})()
}, [services, user])

const sortByNewest = items => {
return Object.values(items).sort((a, b) => b.created - a.created)
}

return (
<div className='flex flex-col min-h-screen'>
<Navbar
Expand All @@ -96,7 +100,7 @@ const Page = () => {
<div className='block text-center'>
<h1 className='uppercase text-center py-4'>Humans</h1>
<ul>
{state && state.profiles && Object.entries(state.profiles).map(([_, e]) => {
{state && state.profiles && sortByNewest(state.profiles).map((e) => {
const meta = e
const profile = e.data
const created = Date.now() - meta.created
Expand Down