Order sidebar collections alphabetically

This commit is contained in:
Jori Lallo
2017-10-09 20:59:01 -07:00
parent d44ef41c34
commit 78b856e7a6
2 changed files with 5 additions and 1 deletions

View File

@@ -33,7 +33,7 @@ type Props = {
return (
<Flex column>
<Header>Collections</Header>
{collections.data.map(collection => (
{collections.orderedData.map(collection => (
<CollectionLink
key={collection.id}
history={history}

View File

@@ -48,6 +48,10 @@ class CollectionsStore {
: undefined;
}
@computed get orderedData(): Collection[] {
return _.sortBy(this.data, collection => collection.name);
}
/**
* List of paths to each of the documents, where paths are composed of id and title/name pairs
*/